From 68959af9523a445c141789b6f613bca53d131284 Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 10 Jan 2026 01:57:42 +0000 Subject: [PATCH 1/2] feat: A new service `BackupDrProtectionSummary` is added feat: A new message `ListResourceBackupConfigsRequest` is added feat: A new message `ListResourceBackupConfigsResponse` is added feat: A new message `ResourceBackupConfig` is added feat: A new resource_definition `backupdr.googleapis.com/ResourceBackupConfig` is added feat: A new message `BackupConfigDetails` is added feat: A new message `PitrSettings` is added feat: A new message `BackupDrTemplateConfig` is added feat: A new message `BackupDrPlanConfig` is added feat: A new message `BackupDrPlanRule` is added feat: A new message `BackupLocation` is added PiperOrigin-RevId: 854009996 Source-Link: https://github.com/googleapis/googleapis/commit/524b2de63ab28fd96abd5a1b077f00a5503d79c4 Source-Link: https://github.com/googleapis/googleapis-gen/commit/89b4811a23cd2976091304113fb10f871ab01e3e Copy-Tag: eyJwIjoicGFja2FnZXMvZ29vZ2xlLWNsb3VkLWJhY2t1cGRyLy5Pd2xCb3QueWFtbCIsImgiOiI4OWI0ODExYTIzY2QyOTc2MDkxMzA0MTEzZmIxMGY4NzFhYjAxZTNlIn0= --- .../google-cloud-backupdr/.eslintignore | 7 + .../google-cloud-backupdr/.eslintrc.json | 3 + .../google-cloud-backupdr/.gitattributes | 4 + .../google-cloud-backupdr/.gitignore | 14 + .../google-cloud-backupdr/.jsdoc.js | 55 + .../google-cloud-backupdr/.mocharc.js | 33 + owl-bot-staging/google-cloud-backupdr/.nycrc | 24 + .../google-cloud-backupdr/.prettierignore | 6 + .../google-cloud-backupdr/.prettierrc.js | 22 + .../google-cloud-backupdr/CODE_OF_CONDUCT.md | 94 + .../google-cloud-backupdr/CONTRIBUTING.md | 76 + owl-bot-staging/google-cloud-backupdr/LICENSE | 202 + .../google-cloud-backupdr/README.md | 152 + .../google/cloud/backupdr/v1/backupdr.proto | 844 + .../google/cloud/backupdr/v1/backupplan.proto | 622 + .../backupdr/v1/backupplanassociation.proto | 436 + .../cloud/backupdr/v1/backupvault.proto | 1390 + .../cloud/backupdr/v1/backupvault_ba.proto | 49 + .../backupdr/v1/backupvault_cloudsql.proto | 146 + .../cloud/backupdr/v1/backupvault_disk.proto | 227 + .../cloud/backupdr/v1/backupvault_gce.proto | 957 + .../backupdr/v1/datasourcereference.proto | 249 + .../backupdr/v1/protection_summary.proto | 322 + .../google-cloud-backupdr/protos/protos.d.ts | 25533 ++++++ .../google-cloud-backupdr/protos/protos.js | 69448 ++++++++++++++++ .../google-cloud-backupdr/protos/protos.json | 9151 ++ .../v1/backup_d_r.create_backup_plan.js | 91 + ...ckup_d_r.create_backup_plan_association.js | 89 + .../v1/backup_d_r.create_backup_vault.js | 93 + .../v1/backup_d_r.create_management_server.js | 90 + .../generated/v1/backup_d_r.delete_backup.js | 76 + .../v1/backup_d_r.delete_backup_plan.js | 77 + ...ckup_d_r.delete_backup_plan_association.js | 77 + .../v1/backup_d_r.delete_backup_vault.js | 102 + .../v1/backup_d_r.delete_management_server.js | 76 + ...kup_plan_associations_for_resource_type.js | 105 + ...kup_d_r.fetch_backups_for_resource_type.js | 104 + ...ata_source_references_for_resource_type.js | 109 + .../backup_d_r.fetch_usable_backup_vaults.js | 85 + .../generated/v1/backup_d_r.get_backup.js | 67 + .../v1/backup_d_r.get_backup_plan.js | 62 + .../backup_d_r.get_backup_plan_association.js | 62 + .../v1/backup_d_r.get_backup_plan_revision.js | 63 + .../v1/backup_d_r.get_backup_vault.js | 67 + .../v1/backup_d_r.get_data_source.js | 62 + .../backup_d_r.get_data_source_reference.js | 63 + .../v1/backup_d_r.get_management_server.js | 62 + .../v1/backup_d_r.initialize_service.js | 89 + ...ackup_d_r.list_backup_plan_associations.js | 81 + .../backup_d_r.list_backup_plan_revisions.js | 84 + .../v1/backup_d_r.list_backup_plans.js | 93 + .../v1/backup_d_r.list_backup_vaults.js | 90 + .../generated/v1/backup_d_r.list_backups.js | 90 + .../backup_d_r.list_data_source_references.js | 96 + .../v1/backup_d_r.list_data_sources.js | 85 + .../v1/backup_d_r.list_management_servers.js | 85 + .../generated/v1/backup_d_r.restore_backup.js | 109 + .../generated/v1/backup_d_r.trigger_backup.js | 82 + .../generated/v1/backup_d_r.update_backup.js | 85 + .../v1/backup_d_r.update_backup_plan.js | 88 + ...ckup_d_r.update_backup_plan_association.js | 87 + .../v1/backup_d_r.update_backup_vault.js | 100 + .../v1/backup_d_r.update_data_source.js | 89 + ...on_summary.list_resource_backup_configs.js | 84 + ...pet_metadata_google.cloud.backupdr.v1.json | 1959 + .../google-cloud-backupdr/src/index.ts | 29 + .../src/v1/backup_d_r_client.ts | 7449 ++ .../src/v1/backup_d_r_client_config.json | 204 + .../src/v1/backup_d_r_proto_list.json | 12 + .../v1/backup_dr_protection_summary_client.ts | 1361 + ...p_dr_protection_summary_client_config.json | 43 + ...ckup_dr_protection_summary_proto_list.json | 12 + .../src/v1/gapic_metadata.json | 469 + .../google-cloud-backupdr/src/v1/index.ts | 20 + .../system-test/fixtures/sample/src/index.js | 28 + .../system-test/fixtures/sample/src/index.ts | 38 + .../system-test/install.ts | 49 + .../test/gapic_backup_d_r_v1.ts | 7933 ++ .../gapic_backup_dr_protection_summary_v1.ts | 1435 + .../google-cloud-backupdr/tsconfig.json | 22 + .../google-cloud-backupdr/webpack.config.js | 64 + 81 files changed, 134392 insertions(+) create mode 100644 owl-bot-staging/google-cloud-backupdr/.eslintignore create mode 100644 owl-bot-staging/google-cloud-backupdr/.eslintrc.json create mode 100644 owl-bot-staging/google-cloud-backupdr/.gitattributes create mode 100644 owl-bot-staging/google-cloud-backupdr/.gitignore create mode 100644 owl-bot-staging/google-cloud-backupdr/.jsdoc.js create mode 100644 owl-bot-staging/google-cloud-backupdr/.mocharc.js create mode 100644 owl-bot-staging/google-cloud-backupdr/.nycrc create mode 100644 owl-bot-staging/google-cloud-backupdr/.prettierignore create mode 100644 owl-bot-staging/google-cloud-backupdr/.prettierrc.js create mode 100644 owl-bot-staging/google-cloud-backupdr/CODE_OF_CONDUCT.md create mode 100644 owl-bot-staging/google-cloud-backupdr/CONTRIBUTING.md create mode 100644 owl-bot-staging/google-cloud-backupdr/LICENSE create mode 100644 owl-bot-staging/google-cloud-backupdr/README.md create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/protos.js create mode 100644 owl-bot-staging/google-cloud-backupdr/protos/protos.json create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js create mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json create mode 100644 owl-bot-staging/google-cloud-backupdr/src/index.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json create mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/index.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js create mode 100644 owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/system-test/install.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts create mode 100644 owl-bot-staging/google-cloud-backupdr/tsconfig.json create mode 100644 owl-bot-staging/google-cloud-backupdr/webpack.config.js diff --git a/owl-bot-staging/google-cloud-backupdr/.eslintignore b/owl-bot-staging/google-cloud-backupdr/.eslintignore new file mode 100644 index 00000000000..cfc348ec4d1 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.eslintignore @@ -0,0 +1,7 @@ +**/node_modules +**/.coverage +build/ +docs/ +protos/ +system-test/ +samples/generated/ diff --git a/owl-bot-staging/google-cloud-backupdr/.eslintrc.json b/owl-bot-staging/google-cloud-backupdr/.eslintrc.json new file mode 100644 index 00000000000..78215349546 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.eslintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "./node_modules/gts" +} diff --git a/owl-bot-staging/google-cloud-backupdr/.gitattributes b/owl-bot-staging/google-cloud-backupdr/.gitattributes new file mode 100644 index 00000000000..33739cb74e4 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.gitignore b/owl-bot-staging/google-cloud-backupdr/.gitignore new file mode 100644 index 00000000000..d4f03a0df2e --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.jsdoc.js b/owl-bot-staging/google-cloud-backupdr/.jsdoc.js new file mode 100644 index 00000000000..c694adb20c8 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.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/backupdr', + theme: 'lumen', + default: { + outputSourceFiles: false + } + }, + markdown: { + idInHeadings: true + } +}; diff --git a/owl-bot-staging/google-cloud-backupdr/.mocharc.js b/owl-bot-staging/google-cloud-backupdr/.mocharc.js new file mode 100644 index 00000000000..5eb34e86c87 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.nycrc b/owl-bot-staging/google-cloud-backupdr/.nycrc new file mode 100644 index 00000000000..81a95fc94b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.prettierignore b/owl-bot-staging/google-cloud-backupdr/.prettierignore new file mode 100644 index 00000000000..9340ad9b86d --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.prettierignore @@ -0,0 +1,6 @@ +**/node_modules +**/coverage +test/fixtures +build/ +docs/ +protos/ diff --git a/owl-bot-staging/google-cloud-backupdr/.prettierrc.js b/owl-bot-staging/google-cloud-backupdr/.prettierrc.js new file mode 100644 index 00000000000..7649ee3c254 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/.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-backupdr/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-backupdr/CODE_OF_CONDUCT.md new file mode 100644 index 00000000000..2add2547a81 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/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-backupdr/CONTRIBUTING.md b/owl-bot-staging/google-cloud-backupdr/CONTRIBUTING.md new file mode 100644 index 00000000000..c0fc2a0dfe7 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/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 Backupdr 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=backupdr.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-backupdr/LICENSE b/owl-bot-staging/google-cloud-backupdr/LICENSE new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/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-backupdr/README.md b/owl-bot-staging/google-cloud-backupdr/README.md new file mode 100644 index 00000000000..e6ee413b3b5 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/README.md @@ -0,0 +1,152 @@ +[//]: # "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 + +# [Backup and DR Service 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/backupdr.svg)](https://www.npmjs.org/package/@google-cloud/backupdr) + +Backup and DR Service API client for Node.js + +[//]: # "partials.introduction" + +A comprehensive list of changes in each version may be found in +[the CHANGELOG][homepage_changelog]. + +* [Backup and DR Service API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/backupdr/latest) +* [Backup and DR Service API Documentation](https://cloud.google.com/backup-disaster-recovery/docs/reference/rpc) + +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 Backup and DR Service 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/backupdr +``` + +[//]: # "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 backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js) | +| create backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js) | +| create backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js) | +| create management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js) | +| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js) | +| delete backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js) | +| delete backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js) | +| delete backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js) | +| delete management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js) | +| fetch backup plan associations for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js) | +| fetch backups for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js) | +| fetch data source references for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js) | +| fetch usable backup vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js) | +| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js) | +| get backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js) | +| get backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js) | +| get backup plan revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js) | +| get backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js) | +| get data source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js) | +| get data source reference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js) | +| get management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js) | +| initialize service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js) | +| list backup plan associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js) | +| list backup plan revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js) | +| list backup plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js) | +| list backup vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js) | +| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js) | +| list data source references | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js) | +| list data sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js) | +| list management servers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js) | +| restore backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js) | +| trigger backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js) | +| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js) | +| update backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js) | +| update backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js) | +| update backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js) | +| update data source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js) | +| list resource backup configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js) | +| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json) | + + +## 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/backupdr@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-backupdr/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-backupdr/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=backupdr.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-backupdr/samples +[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/CHANGELOG.md +[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto new file mode 100644 index 00000000000..3624e8b2ddd --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto @@ -0,0 +1,844 @@ +// 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.backupdr.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupplan.proto"; +import "google/cloud/backupdr/v1/backupplanassociation.proto"; +import "google/cloud/backupdr/v1/backupvault.proto"; +import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; +import "google/cloud/backupdr/v1/datasourcereference.proto"; +import "google/longrunning/operations.proto"; +import "google/protobuf/empty.proto"; +import "google/protobuf/timestamp.proto"; +import "google/protobuf/wrappers.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupDRProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// The BackupDR Service +service BackupDR { + option (google.api.default_host) = "backupdr.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists ManagementServers in a given project and location. + rpc ListManagementServers(ListManagementServersRequest) + returns (ListManagementServersResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/managementServers" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a single ManagementServer. + rpc GetManagementServer(GetManagementServerRequest) + returns (ManagementServer) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/managementServers/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Creates a new ManagementServer in a given project and location. + rpc CreateManagementServer(CreateManagementServerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/managementServers" + body: "management_server" + }; + option (google.api.method_signature) = + "parent,management_server,management_server_id"; + option (google.longrunning.operation_info) = { + response_type: "ManagementServer" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a single ManagementServer. + rpc DeleteManagementServer(DeleteManagementServerRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/managementServers/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Creates a new BackupVault in a given project and location. + rpc CreateBackupVault(CreateBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupVaults" + body: "backup_vault" + }; + option (google.api.method_signature) = + "parent,backup_vault,backup_vault_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupVault" + metadata_type: "OperationMetadata" + }; + } + + // Lists BackupVaults in a given project and location. + rpc ListBackupVaults(ListBackupVaultsRequest) + returns (ListBackupVaultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupVaults" + }; + option (google.api.method_signature) = "parent"; + } + + // FetchUsableBackupVaults lists usable BackupVaults in a given project and + // location. Usable BackupVault are the ones that user has + // backupdr.backupVaults.get permission. + rpc FetchUsableBackupVaults(FetchUsableBackupVaultsRequest) + returns (FetchUsableBackupVaultsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a BackupVault. + rpc GetBackupVault(GetBackupVaultRequest) returns (BackupVault) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a BackupVault. + rpc UpdateBackupVault(UpdateBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}" + body: "backup_vault" + }; + option (google.api.method_signature) = "backup_vault,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "BackupVault" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a BackupVault. + rpc DeleteBackupVault(DeleteBackupVaultRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupVaults/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Lists DataSources in a given project and location. + rpc ListDataSources(ListDataSourcesRequest) + returns (ListDataSourcesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" + }; + option (google.api.method_signature) = "parent"; + } + + // Gets details of a DataSource. + rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a DataSource. + rpc UpdateDataSource(UpdateDataSourceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}" + body: "data_source" + }; + option (google.api.method_signature) = "data_source,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "DataSource" + metadata_type: "OperationMetadata" + }; + } + + // Lists Backups in a given project and location. + rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetch Backups for a given resource type. + rpc FetchBackupsForResourceType(FetchBackupsForResourceTypeRequest) + returns (FetchBackupsForResourceTypeResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType" + }; + option (google.api.method_signature) = "parent,resource_type"; + } + + // Gets details of a Backup. + rpc GetBackup(GetBackupRequest) returns (Backup) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Updates the settings of a Backup. + rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + body: "backup" + }; + option (google.api.method_signature) = "backup,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Deletes a Backup. + rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "Backup" + metadata_type: "OperationMetadata" + }; + } + + // Restore from a Backup + rpc RestoreBackup(RestoreBackupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore" + body: "*" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "RestoreBackupResponse" + metadata_type: "OperationMetadata" + }; + } + + // Create a BackupPlan + rpc CreateBackupPlan(CreateBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupPlans" + body: "backup_plan" + }; + option (google.api.method_signature) = "parent,backup_plan,backup_plan_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlan" + metadata_type: "OperationMetadata" + }; + } + + // Update a BackupPlan. + rpc UpdateBackupPlan(UpdateBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}" + body: "backup_plan" + }; + option (google.api.method_signature) = "backup_plan,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlan" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlan. + rpc GetBackupPlan(GetBackupPlanRequest) returns (BackupPlan) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlans/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlans in a given project and location. + rpc ListBackupPlans(ListBackupPlansRequest) + returns (ListBackupPlansResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlans" + }; + option (google.api.method_signature) = "parent"; + } + + // Deletes a single BackupPlan. + rpc DeleteBackupPlan(DeleteBackupPlanRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlans/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlanRevision. + rpc GetBackupPlanRevision(GetBackupPlanRevisionRequest) + returns (BackupPlanRevision) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlans/*/revisions/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlanRevisions in a given project and location. + rpc ListBackupPlanRevisions(ListBackupPlanRevisionsRequest) + returns (ListBackupPlanRevisionsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*/backupPlans/*}/revisions" + }; + option (google.api.method_signature) = "parent"; + } + + // Create a BackupPlanAssociation + rpc CreateBackupPlanAssociation(CreateBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + body: "backup_plan_association" + }; + option (google.api.method_signature) = + "parent,backup_plan_association,backup_plan_association_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } + + // Update a BackupPlanAssociation. + rpc UpdateBackupPlanAssociation(UpdateBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + patch: "/v1/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}" + body: "backup_plan_association" + }; + option (google.api.method_signature) = + "backup_plan_association,update_mask"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single BackupPlanAssociation. + rpc GetBackupPlanAssociation(GetBackupPlanAssociationRequest) + returns (BackupPlanAssociation) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists BackupPlanAssociations in a given project and location. + rpc ListBackupPlanAssociations(ListBackupPlanAssociationsRequest) + returns (ListBackupPlanAssociationsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + }; + option (google.api.method_signature) = "parent"; + } + + // List BackupPlanAssociations for a given resource type. + rpc FetchBackupPlanAssociationsForResourceType( + FetchBackupPlanAssociationsForResourceTypeRequest) + returns (FetchBackupPlanAssociationsForResourceTypeResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType" + }; + option (google.api.method_signature) = "parent,resource_type"; + } + + // Deletes a single BackupPlanAssociation. + rpc DeleteBackupPlanAssociation(DeleteBackupPlanAssociationRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "OperationMetadata" + }; + } + + // Triggers a new Backup. + rpc TriggerBackup(TriggerBackupRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup" + body: "*" + }; + option (google.api.method_signature) = "name,rule_id"; + option (google.longrunning.operation_info) = { + response_type: "BackupPlanAssociation" + metadata_type: "OperationMetadata" + }; + } + + // Gets details of a single DataSourceReference. + rpc GetDataSourceReference(GetDataSourceReferenceRequest) + returns (DataSourceReference) { + option (google.api.http) = { + get: "/v1/{name=projects/*/locations/*/dataSourceReferences/*}" + }; + option (google.api.method_signature) = "name"; + } + + // Lists DataSourceReferences for a given project and location. + rpc ListDataSourceReferences(ListDataSourceReferencesRequest) + returns (ListDataSourceReferencesResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataSourceReferences" + }; + option (google.api.method_signature) = "parent"; + } + + // Fetch DataSourceReferences for a given project, location and resource type. + rpc FetchDataSourceReferencesForResourceType( + FetchDataSourceReferencesForResourceTypeRequest) + returns (FetchDataSourceReferencesForResourceTypeResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/dataSourceReferences:fetchForResourceType" + }; + option (google.api.method_signature) = "parent,resource_type"; + } + + // Initializes the service related config for a project. + rpc InitializeService(InitializeServiceRequest) + returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1/{name=projects/*/locations/*/serviceConfig}:initialize" + body: "*" + }; + option (google.longrunning.operation_info) = { + response_type: "InitializeServiceResponse" + metadata_type: "OperationMetadata" + }; + } +} + +// Network configuration for ManagementServer instance. +message NetworkConfig { + // VPC peering modes supported by Cloud BackupDR. + enum PeeringMode { + // Peering mode not set. + PEERING_MODE_UNSPECIFIED = 0; + + // Connect using Private Service Access to the Management Server. Private + // services access provides an IP address range for multiple Google Cloud + // services, including Cloud BackupDR. + PRIVATE_SERVICE_ACCESS = 1; + } + + // Optional. The resource name of the Google Compute Engine VPC network to + // which the ManagementServer instance is connected. + string network = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The network connect mode of the ManagementServer instance. For + // this version, only PRIVATE_SERVICE_ACCESS is supported. + PeeringMode peering_mode = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// ManagementURI for the Management Server resource. +message ManagementURI { + // Output only. The ManagementServer AGM/RD WebUI URL. + string web_ui = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The ManagementServer AGM/RD API URL. + string api = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ManagementURI depending on the Workforce Identity i.e. either 1p or 3p. +message WorkforceIdentityBasedManagementURI { + // Output only. First party Management URI for Google Identities. + string first_party_management_uri = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Third party Management URI for External Identity Providers. + string third_party_management_uri = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// OAuth Client ID depending on the Workforce Identity i.e. either 1p or 3p, +message WorkforceIdentityBasedOAuth2ClientID { + // Output only. First party OAuth Client ID for Google Identities. + string first_party_oauth2_client_id = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Third party OAuth Client ID for External Identity Providers. + string third_party_oauth2_client_id = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// ManagementServer describes a single BackupDR ManagementServer instance. +message ManagementServer { + option (google.api.resource) = { + type: "backupdr.googleapis.com/ManagementServer" + pattern: "projects/{project}/locations/{location}/managementServers/{managementserver}" + plural: "managementServers" + singular: "managementServer" + }; + + // Type of backup service resource. + enum InstanceType { + // Instance type is not mentioned. + INSTANCE_TYPE_UNSPECIFIED = 0; + + // Instance for backup and restore management (i.e., AGM). + BACKUP_RESTORE = 1; + } + + // State of Management server instance. + enum InstanceState { + // State not set. + INSTANCE_STATE_UNSPECIFIED = 0; + + // The instance is being created. + CREATING = 1; + + // The instance has been created and is fully usable. + READY = 2; + + // The instance configuration is being updated. Certain kinds of updates + // may cause the instance to become unusable while the update is in + // progress. + UPDATING = 3; + + // The instance is being deleted. + DELETING = 4; + + // The instance is being repaired and may be unstable. + REPAIRING = 5; + + // Maintenance is being performed on this instance. + MAINTENANCE = 6; + + // The instance is experiencing an issue and might be unusable. You can get + // further details from the statusMessage field of Instance resource. + ERROR = 7; + } + + // Output only. Identifier. The resource name. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the ManagementServer instance (2048 characters + // or less). + string description = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource labels to represent user provided metadata. + // Labels currently defined: + // 1. migrate_from_go= + // If set to true, the MS is created in migration ready mode. + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + google.protobuf.Timestamp update_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The type of the ManagementServer resource. + InstanceType type = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The hostname or ip address of the exposed AGM endpoints, used + // by clients to connect to AGM/RD graphical user interface and APIs. + ManagementURI management_uri = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The hostnames of the exposed AGM endpoints for both types of + // user i.e. 1p and 3p, used to connect AGM/RM UI. + WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = + 16 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The ManagementServer state. + InstanceState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. VPC networks to which the ManagementServer instance is connected. + // For this version, only a single network is supported. This field is + // optional if MS is created without PSA + repeated NetworkConfig networks = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Server specified ETag for the ManagementServer resource to + // prevent simultaneous updates from overwiting each other. + string etag = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The OAuth 2.0 client id is required to make API calls to the + // BackupDR instance API of this ManagementServer. This is the value that + // should be provided in the 'aud' field of the OIDC ID Token (see openid + // specification + // https://openid.net/specs/openid-connect-core-1_0.html#IDToken). + string oauth2_client_id = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. + WorkforceIdentityBasedOAuth2ClientID + workforce_identity_based_oauth2_client_id = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The hostname or ip address of the exposed AGM endpoints, used + // by BAs to connect to BA proxy. + repeated string ba_proxy_uri = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + google.protobuf.BoolValue satisfies_pzs = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Reserved for future use. + bool satisfies_pzi = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for listing management servers. +message ListManagementServersRequest { + // Required. The project and location for which to retrieve management servers + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud BackupDR, locations map to Google Cloud regions, for example + // **us-central1**. To retrieve management servers for all locations, use "-" + // for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/ManagementServer" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + optional string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + optional string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing management servers. +message ListManagementServersResponse { + // The list of ManagementServer instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return management servers in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated ManagementServer management_servers = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a management server instance. +message GetManagementServerRequest { + // Required. Name of the management server resource name, in the format + // 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/ManagementServer" + } + ]; +} + +// Request message for creating a management server instance. +message CreateManagementServerRequest { + // Required. The management server project and location in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + // locations map to Google Cloud regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/ManagementServer" + } + ]; + + // Required. The name of the management server to create. The name must be + // unique for the specified project and location. + string management_server_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. A [management server + // resource][google.cloud.backupdr.v1.ManagementServer] + ManagementServer management_server = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for deleting a management server instance. +message DeleteManagementServerRequest { + // Required. Name of the resource + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/ManagementServer" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for initializing the service. +message InitializeServiceRequest { + // Required. The resource name of the serviceConfig used to initialize the + // service. Format: + // `projects/{project_id}/locations/{location}/serviceConfig`. + string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource type to which the default service config will be + // applied. Examples include, "compute.googleapis.com/Instance" and + // "storage.googleapis.com/Bucket". + string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // The configuration for initializing the resource. + oneof initialization_config { + // Optional. The configuration for initializing a Cloud SQL instance. + CloudSqlInstanceInitializationConfig + cloud_sql_instance_initialization_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// Response message for initializing the service. +message InitializeServiceResponse { + // The resource name of the default `BackupVault` created. + // Format: + // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`. + string backup_vault_name = 1; + + // The resource name of the default `BackupPlan` created. + // Format: + // `projects/{project_id}/locations/{location}/backupPlans/{backup_plan_id}`. + string backup_plan_name = 2; +} + +// Represents the metadata of the long-running operation. +message OperationMetadata { + // Output only. The time the operation was created. + google.protobuf.Timestamp create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time the operation finished running. + google.protobuf.Timestamp end_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Server-defined resource path for the target of the operation. + string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Name of the verb executed by the operation. + string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Human-readable status of the operation, if any. + string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Identifies whether the user has requested cancellation + // of the operation. Operations that have successfully been cancelled + // have + // [google.longrunning.Operation.error][google.longrunning.Operation.error] + // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, + // corresponding to 'Code.CANCELLED'. + bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. API version used to start the operation. + string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. AdditionalInfo contains additional Info related to backup plan + // association resource. + map additional_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto new file mode 100644 index 00000000000..0e88524f3b2 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto @@ -0,0 +1,622 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/type/dayofweek.proto"; +import "google/type/month.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// A `BackupPlan` specifies some common fields, such as `description` as well +// as one or more `BackupRule` messages. Each `BackupRule` has a retention +// policy and defines a schedule by which the system is to perform backup +// workloads. +message BackupPlan { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlan" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}" + plural: "backupPlans" + singular: "backupPlan" + }; + + // `State` enumerates the possible states for a `BackupPlan`. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + + // The resource is being updated. + UPDATING = 5; + } + + // Output only. Identifier. The resource name of the `BackupPlan`. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the `BackupPlan` resource. + // + // The description allows for additional details about `BackupPlan` and its + // use cases to be provided. An example description is the following: "This + // is a backup plan that performs a daily backup at 6pm and retains data for 3 + // months". The description must be at most 2048 characters. + string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This collection of key/value pairs allows for custom labels to be + // supplied by the user. Example, {"tag": "Weekly"}. + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. When the `BackupPlan` was created. + google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. When the `BackupPlan` was last updated. + google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The backup rules for this `BackupPlan`. There must be at least + // one `BackupRule` message. + repeated BackupRule backup_rules = 6 [(google.api.field_behavior) = REQUIRED]; + + // Output only. The `State` for the `BackupPlan`. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The resource type to which the `BackupPlan` will be applied. + // Examples include, "compute.googleapis.com/Instance", + // "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", + // "compute.googleapis.com/Disk". + string resource_type = 8 [(google.api.field_behavior) = REQUIRED]; + + // Optional. `etag` is returned from the service in the response. As a user of + // the service, you may provide an etag value in this field to prevent stale + // resources. + string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Required. Resource name of backup vault which will be used as storage + // location for backups. Format: + // projects/{project}/locations/{location}/backupVaults/{backupvault} + string backup_vault = 10 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Output only. The Google Cloud Platform Service Account to be used by the + // BackupVault for taking backups. Specify the email address of the Backup + // Vault Service Account. + string backup_vault_service_account = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Applicable only for CloudSQL resource_type. + // + // Configures how long logs will be stored. It is defined in “days”. This + // value should be greater than or equal to minimum enforced log retention + // duration of the backup vault. + int64 log_retention_days = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. All resource types to which backupPlan can be applied. + repeated string supported_resource_types = 13 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The user friendly revision ID of the `BackupPlanRevision`. + // + // Example: v0, v1, v2, etc. + string revision_id = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource id of the `BackupPlanRevision`. + // + // Format: + // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}` + string revision_name = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// `BackupRule` binds the backup schedule to a retention policy. +message BackupRule { + // Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is + // unique per `BackupPlan`.The `rule_id` must start with a lowercase letter + // followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, + // /[a-z][a-z0-9-]{,62}/. + string rule_id = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.field_behavior) = IMMUTABLE + ]; + + // Required. Configures the duration for which backup data will be kept. It is + // defined in “days”. The value should be greater than or equal to minimum + // enforced retention of the backup vault. + // + // Minimum value is 1 and maximum value is 36159 for custom retention + // on-demand backup. + // Minimum and maximum values are workload specific for all other rules. + int32 backup_retention_days = 4 [(google.api.field_behavior) = REQUIRED]; + + // The schedule that defines the automated backup workloads for this + // `BackupRule`. + oneof backup_schedule_oneof { + // Optional. Defines a schedule that runs within the confines of a defined + // window of time. + StandardSchedule standard_schedule = 5 + [(google.api.field_behavior) = OPTIONAL]; + } +} + +// `StandardSchedule` defines a schedule that run within the confines of a +// defined window of days. We can define recurrence type for schedule as +// HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY. +message StandardSchedule { + // `RecurrenceTypes` enumerates the applicable periodicity for the schedule. + enum RecurrenceType { + // recurrence type not set + RECURRENCE_TYPE_UNSPECIFIED = 0; + + // The `BackupRule` is to be applied hourly. + HOURLY = 1; + + // The `BackupRule` is to be applied daily. + DAILY = 2; + + // The `BackupRule` is to be applied weekly. + WEEKLY = 3; + + // The `BackupRule` is to be applied monthly. + MONTHLY = 4; + + // The `BackupRule` is to be applied yearly. + YEARLY = 5; + } + + // Required. Specifies the `RecurrenceType` for the schedule. + RecurrenceType recurrence_type = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Specifies frequency for hourly backups. A hourly frequency of 2 + // means jobs will run every 2 hours from start time till end time defined. + // + // This is required for `recurrence_type`, `HOURLY` and is not applicable + // otherwise. A validation error will occur if a value is supplied and + // `recurrence_type` is not `HOURLY`. + // + // Value of hourly frequency should be between 4 and 23. + // + // Reason for limit : We found that there is bandwidth limitation of 3GB/S for + // GMI while taking a backup and 5GB/S while doing a restore. Given the amount + // of parallel backups and restore we are targeting, this will potentially + // take the backup time to mins and hours (in worst case scenario). + int32 hourly_frequency = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs + // will run. + // + // This is required for `recurrence_type`, `WEEKLY` and is not applicable + // otherwise. A validation error will occur if a value is supplied and + // `recurrence_type` is not `WEEKLY`. + repeated google.type.DayOfWeek days_of_week = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. + // + // Values for `days_of_month` are only applicable for `recurrence_type`, + // `MONTHLY` and `YEARLY`. A validation error will occur if other values are + // supplied. + repeated int32 days_of_month = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST + // MONDAY, on which jobs will run. This will be specified by two fields in + // `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, + // e.g. `LAST`. + // + // This field is only applicable for `recurrence_type`, `MONTHLY` and + // `YEARLY`. A validation error will occur if other values are supplied. + WeekDayOfMonth week_day_of_month = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on + // which jobs will run. + // + // This field is only applicable when `recurrence_type` is `YEARLY`. A + // validation error will occur if other values are supplied. + repeated google.type.Month months = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Required. A BackupWindow defines the window of day during which backup jobs + // will run. Jobs are queued at the beginning of the window and will be marked + // as `NOT_RUN` if they do not start by the end of the window. + // + // Note: running jobs will not be cancelled at the end of the window. + BackupWindow backup_window = 7 [(google.api.field_behavior) = REQUIRED]; + + // Required. The time zone to be used when interpreting the schedule. + // The value of this field must be a time zone name from the IANA tz database. + // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the + // list of valid timezone names. For e.g., Europe/Paris. + string time_zone = 8 [(google.api.field_behavior) = REQUIRED]; +} + +// `BackupWindow` defines a window of the day during which backup jobs will run. +message BackupWindow { + // Required. The hour of day (0-23) when the window starts for e.g. if value + // of start hour of day is 6 that mean backup window start at 6:00. + int32 start_hour_of_day = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The hour of day (1-24) when the window end for e.g. if value of + // end hour of day is 10 that mean backup window end time is 10:00. + // + // End hour of day should be greater than start hour of day. + // 0 <= start_hour_of_day < end_hour_of_day <= 24 + // + // End hour of day is not include in backup window that mean if + // end_hour_of_day= 10 jobs should start before 10:00. + int32 end_hour_of_day = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// `WeekDayOfMonth` defines the week day of the month on which the backups will +// run. The message combines a `WeekOfMonth` and `DayOfWeek` to produce values +// like `FIRST`/`MONDAY` or `LAST`/`FRIDAY`. +message WeekDayOfMonth { + // `WeekOfMonth` enumerates possible weeks in the month, e.g. the first, + // third, or last week of the month. + enum WeekOfMonth { + // The zero value. Do not use. + WEEK_OF_MONTH_UNSPECIFIED = 0; + + // The first week of the month. + FIRST = 1; + + // The second week of the month. + SECOND = 2; + + // The third week of the month. + THIRD = 3; + + // The fourth week of the month. + FOURTH = 4; + + // The last week of the month. + LAST = 5; + } + + // Required. Specifies the week of the month. + WeekOfMonth week_of_month = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Specifies the day of the week. + google.type.DayOfWeek day_of_week = 2 + [(google.api.field_behavior) = REQUIRED]; +} + +// The request message for creating a `BackupPlan`. +message CreateBackupPlanRequest { + // Required. The `BackupPlan` project and location in the format + // `projects/{project}/locations/{location}`. In Cloud BackupDR locations + // map to GCP regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Required. The name of the `BackupPlan` to create. The name must be unique + // for the specified project and location.The name must start with a lowercase + // letter followed by up to 62 lowercase letters, numbers, or hyphens. + // Pattern, /[a-z][a-z0-9-]{,62}/. + string backup_plan_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The `BackupPlan` resource object to create. + BackupPlan backup_plan = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// The request message for getting a list `BackupPlan`. +message ListBackupPlansRequest { + // Required. The project and location for which to retrieve `BackupPlans` + // information. Format: `projects/{project}/locations/{location}`. In Cloud + // BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + // retrieve backup plans for all locations, use "-" for the + // `{location}` value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Optional. The maximum number of `BackupPlans` to return in a single + // response. If not specified, a default value will be chosen by the service. + // Note that the response may include a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value of + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // received from a previous `ListBackupPlans` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListBackupPlans` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field match expression used to filter the results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Field by which to sort the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for getting a list of `BackupPlan`. +message ListBackupPlansResponse { + // The list of `BackupPlans` in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of resources from all locations. In case any location is unreachable, + // the response will only return backup plans in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + // BackupPlan + repeated BackupPlan backup_plans = 1; + + // A token which may be sent as + // [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in + // a subsequent `ListBackupPlans` call to retrieve the next page of results. + // If this field is omitted or empty, then there are no more results to + // return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// The request message for getting a `BackupPlan`. +message GetBackupPlanRequest { + // Required. The resource name of the `BackupPlan` to retrieve. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; +} + +// The request message for deleting a `BackupPlan`. +message DeleteBackupPlanRequest { + // Required. The resource name of the `BackupPlan` to delete. + // + // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for updating a backup plan. +message UpdateBackupPlanRequest { + // Required. The resource being updated + BackupPlan backup_plan = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // Field mask is used to specify the fields to be overwritten in the + // BackupPlan resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + // Currently, these fields are supported in update: description, schedules, + // retention period, adding and removing Backup Rules. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// `BackupPlanRevision` represents a snapshot of a `BackupPlan` at a point in +// time. +message BackupPlanRevision { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlanRevision" + pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}" + plural: "backupPlanRevisions" + singular: "backupPlanRevision" + }; + + // The state of the `BackupPlanRevision`. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + } + + // Output only. Identifier. The resource name of the `BackupPlanRevision`. + // + // Format: + // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The user friendly revision ID of the `BackupPlanRevision`. + // + // Example: v0, v1, v2, etc. + string revision_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource State + State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The Backup Plan being encompassed by this revision. + BackupPlan backup_plan_snapshot = 4; + + // Output only. The timestamp that the revision was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The request message for getting a `BackupPlanRevision`. +message GetBackupPlanRevisionRequest { + // Required. The resource name of the `BackupPlanRevision` to retrieve. + // + // Format: + // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanRevision" + } + ]; +} + +// The request message for getting a list of `BackupPlanRevision`. +message ListBackupPlanRevisionsRequest { + // Required. The project and location for which to retrieve + // `BackupPlanRevisions` information. Format: + // `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + // Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanRevision" + } + ]; + + // Optional. The maximum number of `BackupPlans` to return in a single + // response. If not specified, a default value will be chosen by the service. + // Note that the response may include a partial list and a caller should + // only rely on the response's + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // to determine if there are more instances left to be queried. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The value of + // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] + // received from a previous `ListBackupPlans` call. + // Provide this to retrieve the subsequent page in a multi-page list of + // results. When paginating, all other parameters provided to + // `ListBackupPlans` must match the call that provided the page token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// The response message for getting a list of `BackupPlanRevision`. +message ListBackupPlanRevisionsResponse { + // The list of `BackupPlanRevisions` in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of resources from all locations. In case any location is unreachable, + // the response will only return backup plans in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupPlanRevision backup_plan_revisions = 1; + + // A token which may be sent as + // [page_token][google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.page_token] + // in a subsequent `ListBackupPlanRevisions` call to retrieve the next page of + // results. If this field is omitted or empty, then there are no more results + // to return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto new file mode 100644 index 00000000000..2f97b4c8c17 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto @@ -0,0 +1,436 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupPlanAssociationProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// A BackupPlanAssociation represents a single BackupPlanAssociation which +// contains details like workload, backup plan etc +message BackupPlanAssociation { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + pattern: "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}" + plural: "backupPlanAssociations" + singular: "backupPlanAssociation" + }; + + // Enum for State of BackupPlan Association + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The resource is being created. + CREATING = 1; + + // The resource has been created and is fully usable. + ACTIVE = 2; + + // The resource is being deleted. + DELETING = 3; + + // The resource has been created but is not usable. + INACTIVE = 4; + + // The resource is being updated. + UPDATING = 5; + } + + // Output only. Identifier. The resource name of BackupPlanAssociation in + // below format Format : + // projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} + string name = 1 [ + (google.api.field_behavior) = IDENTIFIER, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Required. Immutable. Resource type of workload on which backupplan is + // applied + string resource_type = 2 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Immutable. Resource name of workload on which the backup plan is + // applied. + // + // The format can either be the resource name (e.g., + // "projects/my-project/zones/us-central1-a/instances/my-instance") or the + // full resource URI (e.g., + // "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance"). + string resource = 3 [ + (google.api.field_behavior) = IMMUTABLE, + (google.api.field_behavior) = REQUIRED + ]; + + // Required. Resource name of backup plan which needs to be applied on + // workload. Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId} + string backup_plan = 4 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + } + ]; + + // Output only. The time when the instance was created. + google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The BackupPlanAssociation resource state. + State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The config info related to backup rules. + repeated RuleConfigInfo rules_config_info = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Resource name of data source which will be used as storage + // location for backups taken. Format : + // projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} + string data_source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Properties of the protected GCP resource. + oneof resource_properties { + // Output only. Cloud SQL instance's backup plan association properties. + CloudSqlInstanceBackupPlanAssociationProperties + cloud_sql_instance_backup_plan_association_properties = 10 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. The user friendly revision ID of the `BackupPlanRevision`. + // + // Example: v0, v1, v2, etc. + string backup_plan_revision_id = 11 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The resource id of the `BackupPlanRevision`. + // + // Format: + // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}` + string backup_plan_revision_name = 12 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Message for rules config info. +message RuleConfigInfo { + // Enum for LastBackupState + enum LastBackupState { + // State not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0; + + // The first backup is pending. + FIRST_BACKUP_PENDING = 1; + + // The most recent backup could not be run/failed because of the lack of + // permissions. + PERMISSION_DENIED = 2; + + // The last backup operation succeeded. + SUCCEEDED = 3; + + // The last backup operation failed. + FAILED = 4; + } + + // Output only. Backup Rule id fetched from backup plan. + string rule_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The last backup state for rule. + LastBackupState last_backup_state = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. google.rpc.Status object to store the last backup error. + google.rpc.Status last_backup_error = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The point in time when the last successful backup was captured + // from the source. + google.protobuf.Timestamp last_successful_backup_consistency_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for creating a backup plan. +message CreateBackupPlanAssociationRequest { + // Required. The backup plan association project and location in the format + // `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + // map to GCP regions, for example **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. The name of the backup plan association to create. The name must + // be unique for the specified project and location. + string backup_plan_association_id = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + BackupPlanAssociation backup_plan_association = 3 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for List BackupPlanAssociation +message ListBackupPlanAssociationsRequest { + // Required. The project and location for which to retrieve backup Plan + // Associations information, in the format + // `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + // map to GCP regions, for example **us-central1**. To retrieve backup plan + // associations for all locations, use "-" for the + // `{location}` value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for List BackupPlanAssociation +message ListBackupPlanAssociationsResponse { + // The list of Backup Plan Associations in the project for the specified + // location. + // + // If the `{location}` value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup plan associations in reachable + // locations and the 'unreachable' field will be populated with a list of + // unreachable locations. + repeated BackupPlanAssociation backup_plan_associations = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the FetchBackupPlanAssociationsForResourceType method. +message FetchBackupPlanAssociationsForResourceTypeRequest { + // Required. The parent resource name. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. The type of the GCP resource. + // Ex: sql.googleapis.com/Instance + string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of BackupPlanAssociations to return. The + // service may return fewer than this value. If unspecified, at most 50 + // BackupPlanAssociations will be returned. The maximum value is 100; values + // above 100 will be coerced to 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous call of + // `FetchBackupPlanAssociationsForResourceType`. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `FetchBackupPlanAssociationsForResourceType` must match + // the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters the results fetched in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. Supported + // fields: + // * resource + // * backup_plan + // * state + // * data_source + // * cloud_sql_instance_backup_plan_association_properties.instance_create_time + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. + // + // Supported fields: + // * name + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the FetchBackupPlanAssociationsForResourceType method. +message FetchBackupPlanAssociationsForResourceTypeResponse { + // Output only. The BackupPlanAssociations from the specified parent. + repeated BackupPlanAssociation backup_plan_associations = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Request message for getting a BackupPlanAssociation resource. +message GetBackupPlanAssociationRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; +} + +// Request message for deleting a backup plan association. +message DeleteBackupPlanAssociationRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for updating a backup plan association. +message UpdateBackupPlanAssociationRequest { + // Required. The resource being updated + BackupPlanAssociation backup_plan_association = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The list of fields to update. + // Field mask is used to specify the fields to be overwritten in the + // BackupPlanAssociation resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + // Currently backup_plan_association.backup_plan is the only supported field. + google.protobuf.FieldMask update_mask = 2 + [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and t + // he request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for triggering a backup. +message TriggerBackupRequest { + // Required. Name of the backup plan association resource, in the format + // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + } + ]; + + // Required. backup rule_id for which a backup needs to be triggered. + string rule_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto new file mode 100644 index 00000000000..8e82cbdb878 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto @@ -0,0 +1,1390 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupvault_ba.proto"; +import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; +import "google/cloud/backupdr/v1/backupvault_disk.proto"; +import "google/cloud/backupdr/v1/backupvault_gce.proto"; +import "google/protobuf/duration.proto"; +import "google/protobuf/field_mask.proto"; +import "google/protobuf/timestamp.proto"; +import "google/rpc/status.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupVaultProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKey" + pattern: "projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}" +}; +option (google.api.resource_definition) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" +}; + +// Message describing a BackupVault object. +message BackupVault { + option (google.api.resource) = { + type: "backupdr.googleapis.com/BackupVault" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}" + plural: "backupVaults" + singular: "backupVault" + }; + + // How a backup's enforced retention end time is inherited. + enum BackupRetentionInheritance { + // Inheritance behavior not set. This will default to + // `INHERIT_VAULT_RETENTION`. + BACKUP_RETENTION_INHERITANCE_UNSPECIFIED = 0; + + // The enforced retention end time of a backup will be inherited from the + // backup vault's `backup_minimum_enforced_retention_duration` field. + // + // This is the default behavior. + INHERIT_VAULT_RETENTION = 1; + + // The enforced retention end time of a backup will always match the expire + // time of the backup. + // + // If this is set, the backup's enforced retention end time will be set to + // match the expire time during creation of the backup. When updating, the + // ERET and expire time must be updated together and have the same value. + // Invalid update requests will be rejected by the server. + MATCH_BACKUP_EXPIRE_TIME = 2; + } + + // Holds the state of the backup vault resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The backup vault is being created. + CREATING = 1; + + // The backup vault has been created and is fully usable. + ACTIVE = 2; + + // The backup vault is being deleted. + DELETING = 3; + + // The backup vault is experiencing an issue and might be unusable. + ERROR = 4; + + // The backup vault is being updated. + UPDATING = 5; + } + + // Holds the access restriction for the backup vault. + enum AccessRestriction { + // Access restriction not set. If user does not provide any value or pass + // this value, it will be changed to WITHIN_ORGANIZATION. + ACCESS_RESTRICTION_UNSPECIFIED = 0; + + // Access to or from resources outside your current project will be denied. + WITHIN_PROJECT = 1; + + // Access to or from resources outside your current organization will be + // denied. + WITHIN_ORGANIZATION = 2; + + // No access restriction. + UNRESTRICTED = 3; + + // Access to or from resources outside your current organization will be + // denied except for backup appliance. + WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4; + } + + // Message describing the EncryptionConfig of backup vault. + // This determines how data within the vault is encrypted at rest. + message EncryptionConfig { + // Optional. The Cloud KMS key name to encrypt backups in this backup vault. + // Must be in the same region as the vault. Some workload backups like + // compute disk backups may use their inherited source key instead. Format: + // projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key} + optional string kms_key_name = 1 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKey" + } + ]; + } + + // Output only. Identifier. Name of the backup vault to create. It must have + // the + // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. + // `{backupvault}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the project and location. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Optional. The description of the BackupVault instance (2048 characters or + // less). + optional string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined: + map labels = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The default and minimum enforced retention for each backup within + // the backup vault. The enforced retention for each backup can be extended. + optional google.protobuf.Duration backup_minimum_enforced_retention_duration = + 20 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Setting for how a backup's enforced retention end time is + // inherited. + optional BackupRetentionInheritance backup_retention_inheritance = 27 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Set to true when there are no backups nested under this + // resource. + optional bool deletable = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Server specified ETag for the backup vault resource to + // prevent simultaneous updates from overwiting each other. + optional string etag = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The BackupVault resource instance state. + State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Time after which the BackupVault resource is locked. + optional google.protobuf.Timestamp effective_time = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The number of backups in this backup vault. + int64 backup_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Service account used by the BackupVault Service for this + // BackupVault. The user should grant this account permissions in their + // workload project to enable the service to run backups and restores there. + string service_account = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total size of the storage used by all backup resources. + int64 total_stored_bytes = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Immutable after resource creation until resource deletion. + string uid = 21 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. User annotations. See https://google.aip.dev/128#annotations + // Stores small amounts of arbitrary data. + map annotations = 22 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Note: This field is added for future use case and will not be + // supported in the current release. + // + // Access restriction for the backup vault. + // Default value is WITHIN_ORGANIZATION if not provided during creation. + AccessRestriction access_restriction = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The encryption config of the backup vault. + optional EncryptionConfig encryption_config = 29 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message describing a DataSource object. +// Datasource object used to represent Datasource details for both admin and +// basic view. +message DataSource { + option (google.api.resource) = { + type: "backupdr.googleapis.com/DataSource" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}" + plural: "dataSources" + singular: "dataSource" + }; + + // Holds the state of the data source resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The data source is being created. + CREATING = 1; + + // The data source has been created and is fully usable. + ACTIVE = 2; + + // The data source is being deleted. + DELETING = 3; + + // The data source is experiencing an issue and might be unusable. + ERROR = 4; + } + + // Output only. Identifier. Name of the datasource to create. + // It must have the + // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. + // `{datasource}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the backup vault. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The DataSource resource instance state. + State state = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined: + map labels = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Number of backups in the data source. + optional int64 backup_count = 7; + + // Server specified ETag for the ManagementServer resource to prevent + // simultaneous updates from overwiting each other. + optional string etag = 14; + + // The number of bytes (metadata and data) stored in this datasource. + optional int64 total_stored_bytes = 23; + + // Output only. The backup configuration state. + BackupConfigState config_state = 24 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Details of how the resource is configured for backup. + BackupConfigInfo backup_config_info = 25 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The source resource that is represented by this DataSource. It can be a + // Google Cloud resource, or one backed up by a Backup Appliance. + oneof source_resource { + // The backed up resource is a Google Cloud resource. + // The word 'DataSource' was included in the names to indicate that this is + // the representation of the Google Cloud resource used within the + // DataSource object. + DataSourceGcpResource data_source_gcp_resource = 26; + + // The backed up resource is a backup appliance application. + DataSourceBackupApplianceApplication + data_source_backup_appliance_application = 27; + } + + // Output only. This field is set to true if the backup is blocked by vault + // access restriction. + bool backup_blocked_by_vault_access_restriction = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupConfigInfo has information about how the resource is configured +// for Backup and about the most recent backup to this vault. +message BackupConfigInfo { + // LastBackupstate tracks whether the last backup was not yet started, + // successful, failed, or could not be run because of the lack of permissions. + enum LastBackupState { + // Status not set. + LAST_BACKUP_STATE_UNSPECIFIED = 0; + + // The first backup has not yet completed + FIRST_BACKUP_PENDING = 1; + + // The most recent backup was successful + SUCCEEDED = 2; + + // The most recent backup failed + FAILED = 3; + + // The most recent backup could not be run/failed because of the lack of + // permissions + PERMISSION_DENIED = 4; + } + + // Output only. The status of the last backup to this BackupVault + LastBackupState last_backup_state = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the last backup were successful, this field has the + // consistency date. + google.protobuf.Timestamp last_successful_backup_consistency_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. If the last backup failed, this field has the error message. + google.rpc.Status last_backup_error = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration Info has the resource format-specific configuration. + oneof backup_config { + // Configuration for a Google Cloud resource. + GcpBackupConfig gcp_backup_config = 4; + + // Configuration for an application backed up by a Backup Appliance. + BackupApplianceBackupConfig backup_appliance_backup_config = 5; + } +} + +// GcpBackupConfig captures the Backup configuration details for Google Cloud +// resources. All Google Cloud resources regardless of type are protected with +// backup plan associations. +message GcpBackupConfig { + // The name of the backup plan. + string backup_plan = 1 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + }]; + + // The description of the backup plan. + string backup_plan_description = 2; + + // The name of the backup plan association. + string backup_plan_association = 3 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlanAssociation" + }]; + + // The names of the backup plan rules which point to this backupvault + repeated string backup_plan_rules = 4; + + // The name of the backup plan revision. + string backup_plan_revision_name = 5; + + // The user friendly id of the backup plan revision. + // E.g. v0, v1 etc. + string backup_plan_revision_id = 6; +} + +// BackupApplianceBackupConfig captures the backup configuration for +// applications that are protected by Backup Appliances. +message BackupApplianceBackupConfig { + // The name of the backup appliance. + string backup_appliance_name = 1; + + // The ID of the backup appliance. + int64 backup_appliance_id = 2; + + // The ID of the SLA of this application. + int64 sla_id = 3; + + // The name of the application. + string application_name = 4; + + // The name of the host where the application is running. + string host_name = 5; + + // The name of the SLT associated with the application. + string slt_name = 6; + + // The name of the SLP associated with the application. + string slp_name = 7; +} + +// DataSourceGcpResource is used for protected resources that are Google Cloud +// Resources. This name is easeier to understand than GcpResourceDataSource or +// GcpDataSourceResource +message DataSourceGcpResource { + // Output only. Full resource pathname URL of the source Google Cloud + // resource. + string gcp_resourcename = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // The type of the Google Cloud resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; + + // gcp_Properties has properties of the Google Cloud Resource. + oneof gcp_resource_properties { + // ComputeInstanceDataSourceProperties has a subset of Compute Instance + // properties that are useful at the Datasource level. + ComputeInstanceDataSourceProperties compute_instance_datasource_properties = + 4; + + // Output only. CloudSqlInstanceDataSourceProperties has a subset of Cloud + // SQL Instance properties that are useful at the Datasource level. + CloudSqlInstanceDataSourceProperties + cloud_sql_instance_datasource_properties = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // DiskDataSourceProperties has a subset of Disk properties that are useful + // at the Datasource level. + DiskDataSourceProperties disk_datasource_properties = 7; + } +} + +// BackupApplianceApplication describes a Source Resource when it is an +// application backed up by a BackupAppliance. +message DataSourceBackupApplianceApplication { + // The name of the Application as known to the Backup Appliance. + string application_name = 1; + + // Appliance name. + string backup_appliance = 2; + + // Appliance Id of the Backup Appliance. + int64 appliance_id = 3; + + // The type of the application. e.g. VMBackup + string type = 4; + + // The appid field of the application within the Backup Appliance. + int64 application_id = 8; + + // Hostname of the host where the application is running. + string hostname = 6; + + // Hostid of the application host. + int64 host_id = 7; +} + +// ServiceLockInfo represents the details of a lock taken by the service on a +// Backup resource. +message ServiceLockInfo { + // Output only. The name of the operation that created this lock. + // The lock will automatically be released when the operation completes. + string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupApplianceLockInfo contains metadata about the backupappliance that +// created the lock. +message BackupApplianceLockInfo { + // Required. The ID of the backup/recovery appliance that created this lock. + int64 backup_appliance_id = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The name of the backup/recovery appliance that created this lock. + string backup_appliance_name = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The + // value of this string is only meaningful to the client and it is not + // interpreted by the BackupVault service. + string lock_reason = 5 [(google.api.field_behavior) = REQUIRED]; + + // The information about this lock. + oneof lock_source { + // The job name on the backup/recovery appliance that created this lock. + string job_name = 6; + + // The image name that depends on this Backup. + string backup_image = 7; + + // The SLA on the backup/recovery appliance that owns the lock. + int64 sla_id = 8; + } +} + +// BackupLock represents a single lock on a Backup resource. An unexpired +// lock on a Backup prevents the Backup from being deleted. +message BackupLock { + // Required. The time after which this lock is not considered valid and will + // no longer protect the Backup from deletion. + google.protobuf.Timestamp lock_until_time = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Metadata about the owner and reason for the lock. + oneof ClientLockInfo { + // If the client is a backup and recovery appliance, this + // contains metadata about why the lock exists. + BackupApplianceLockInfo backup_appliance_lock_info = 3; + + // Output only. Contains metadata about the lock exist for Google Cloud + // native backups. + ServiceLockInfo service_lock_info = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Message describing a Backup object. +message Backup { + option (google.api.resource) = { + type: "backupdr.googleapis.com/Backup" + pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}" + plural: "backups" + singular: "backup" + }; + + // Holds the state of the backup resource. + enum State { + // State not set. + STATE_UNSPECIFIED = 0; + + // The backup is being created. + CREATING = 1; + + // The backup has been created and is fully usable. + ACTIVE = 2; + + // The backup is being deleted. + DELETING = 3; + + // The backup is experiencing an issue and might be unusable. + ERROR = 4; + + // The backup is being uploaded. + UPLOADING = 5; + } + + // Type of the backup, scheduled or ondemand. + enum BackupType { + // Backup type is unspecified. + BACKUP_TYPE_UNSPECIFIED = 0; + + // Scheduled backup. + SCHEDULED = 1; + + // On demand backup. + ON_DEMAND = 2; + + // Operational backup. + ON_DEMAND_OPERATIONAL = 3; + } + + // GCPBackupPlanInfo captures the plan configuration details of Google Cloud + // resources at the time of backup. + message GCPBackupPlanInfo { + // Resource name of backup plan by which workload is protected at the time + // of the backup. + // Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId} + string backup_plan = 1 [(google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupPlan" + }]; + + // The rule id of the backup plan which triggered this backup in case of + // scheduled backup or used for + string backup_plan_rule_id = 2; + + // Resource name of the backup plan revision which triggered this backup in + // case of scheduled backup or used for on demand backup. + // Format: + // projects/{project}/locations/{location}/backupPlans/{backupPlanId}/revisions/{revisionId} + string backup_plan_revision_name = 3; + + // The user friendly id of the backup plan revision which triggered this + // backup in case of scheduled backup or used for on demand backup. + string backup_plan_revision_id = 4; + } + + // Output only. Identifier. Name of the backup to create. It must have the + // format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. + // `{backup}` cannot be changed after creation. It must be between 3-63 + // characters long and must be unique within the datasource. + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = IDENTIFIER + ]; + + // Output only. The description of the Backup instance (2048 characters or + // less). + optional string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was created. + optional google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when the instance was updated. + optional google.protobuf.Timestamp update_time = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Resource labels to represent user provided metadata. + // No labels currently defined. + map labels = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The backup can not be deleted before this time. + optional google.protobuf.Timestamp enforced_retention_end_time = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. Setting for how the enforced retention end time is inherited. + // This value is copied from this backup's BackupVault. + optional BackupVault.BackupRetentionInheritance backup_retention_inheritance = + 30 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. When this backup is automatically expired. + optional google.protobuf.Timestamp expire_time = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The point in time when this backup was captured from the + // source. + optional google.protobuf.Timestamp consistency_time = 9 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Server specified ETag to prevent updates from overwriting each + // other. + optional string etag = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Output only. The Backup resource instance state. + State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The list of BackupLocks taken by the service to prevent the + // deletion of the backup. + repeated BackupLock service_locks = 17 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The list of BackupLocks taken by the accessor Backup Appliance. + repeated BackupLock backup_appliance_locks = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Workload specific backup properties. + oneof backup_properties { + // Output only. Compute Engine specific backup properties. + ComputeInstanceBackupProperties compute_instance_backup_properties = 19 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Cloud SQL specific backup properties. + CloudSqlInstanceBackupProperties cloud_sql_instance_backup_properties = 26 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Backup Appliance specific backup properties. + BackupApplianceBackupProperties backup_appliance_backup_properties = 21 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Disk specific backup properties. + DiskBackupProperties disk_backup_properties = 28 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. Type of the backup, unspecified, scheduled or ondemand. + BackupType backup_type = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Configuration Info has the resource format-specific configuration. + oneof plan_info { + // Output only. Configuration for a Google Cloud resource. + GCPBackupPlanInfo gcp_backup_plan_info = 22 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Output only. source resource size in bytes at the time of the backup. + int64 resource_size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. Output only. Reserved for future use. + optional bool satisfies_pzs = 24 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Output only. Reserved for future use. + optional bool satisfies_pzi = 25 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.field_behavior) = OPTIONAL + ]; + + // Resource that is being backed up. + oneof source_resource { + // Output only. Unique identifier of the GCP resource that is being backed + // up. + BackupGcpResource gcp_resource = 31 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } + + // Optional. Output only. The list of KMS key versions used to encrypt the + // backup. + repeated string kms_key_versions = 33 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "cloudkms.googleapis.com/CryptoKeyVersion" + } + ]; +} + +// Message for creating a BackupVault. +message CreateBackupVaultRequest { + // Required. Value for parent. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Required. ID of the requesting object + // If auto-generating ID server-side, remove this field and + // backup_vault_id from the method_signature of Create RPC + string backup_vault_id = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being created + BackupVault backup_vault = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 4 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing backupvault stores. +message ListBackupVaultsRequest { + // Required. The project and location for which to retrieve backupvault stores + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + // To retrieve backupvault stores for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // Vault. + BackupVaultView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing BackupVaults. +message ListBackupVaultsResponse { + // The list of BackupVault instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup vaults in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupVault backup_vaults = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for fetching usable BackupVaults. +message FetchUsableBackupVaultsRequest { + // Required. The project and location for which to retrieve backupvault stores + // information, in the format 'projects/{project_id}/locations/{location}'. In + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + // To retrieve backupvault stores for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for fetching usable BackupVaults. +message FetchUsableBackupVaultsResponse { + // The list of BackupVault instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return backup vaults in reachable locations and + // the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated BackupVault backup_vaults = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the FetchBackupsForResourceType method. +message FetchBackupsForResourceTypeRequest { + // Required. Datasources are the parent resource for the backups. + // Format: + // projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/Backup" + } + ]; + + // Required. The type of the GCP resource. + // Ex: sqladmin.googleapis.com/Instance + string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of Backups to return. The service may + // return fewer than this value. If unspecified, at most 50 + // Backups will be returned. The maximum value is 100; values + // above 100 will be coerced to 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous call of + // `FetchBackupsForResourceType`. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `FetchBackupsForResourceType` must match + // the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters the results fetched in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. Supported + // fields: + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This parameter is used to specify the view of the backup. + // If not specified, the default view is BASIC. + BackupView view = 7 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the FetchBackupsForResourceType method. +message FetchBackupsForResourceTypeResponse { + // The Backups from the specified parent. + repeated Backup backups = 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; +} + +// Request message for getting a BackupVault. +message GetBackupVaultRequest { + // Required. Name of the backupvault store resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // Vault + BackupVaultView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a BackupVault. +message UpdateBackupVaultRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // BackupVault resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + BackupVault backup_vault = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, will not check plan duration against backup vault + // enforcement duration. + bool force = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, we will force update access restriction even if + // some non compliant data sources are present. The default is 'false'. + bool force_update_access_restriction = 6 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Message for deleting a BackupVault. +message DeleteBackupVaultRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/BackupVault" + } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. If set to true, any data source from this backup vault will also + // be deleted. + bool force = 3 [(google.api.field_behavior) = OPTIONAL]; + + // The current etag of the backup vault. + // If an etag is provided and does not match the current etag of the + // connection, deletion will be blocked. + string etag = 4; + + // Optional. Only validate the request, but do not perform mutations. + // The default is 'false'. + bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If true and the BackupVault is not found, the request will + // succeed but no action will be taken. + bool allow_missing = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. If set to true, backupvault deletion will proceed even if there + // are backup plans referencing the backupvault. The default is 'false'. + bool ignore_backup_plan_references = 7 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing DataSources. +message ListDataSourcesRequest { + // Required. The project and location for which to retrieve data + // sources information, in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + // locations map to Google Cloud regions, for example **us-central1**. + // To retrieve data sources for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/DataSource" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing DataSources. +message ListDataSourcesResponse { + // The list of DataSource instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return data sources in reachable locations + // and the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated DataSource data_sources = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a DataSource instance. +message GetDataSourceRequest { + // Required. Name of the data source resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/DataSource" + } + ]; +} + +// Request message for updating a data source instance. +message UpdateDataSourceRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // DataSource resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + DataSource data_source = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Enable upsert. + bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for listing Backups. +message ListBackupsRequest { + // Required. The project and location for which to retrieve backup + // information, in the format + // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + // locations map to Google Cloud regions, for example **us-central1**. + // To retrieve data sources for all locations, use "-" for the + // '{location}' value. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/Backup" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will pick an appropriate default. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // resource. + BackupView view = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for listing Backups. +message ListBackupsResponse { + // The list of Backup instances in the project for the specified + // location. + // + // If the '{location}' value in the request is "-", the response contains a + // list of instances from all locations. In case any location is unreachable, + // the response will only return data sources in reachable locations + // and the 'unreachable' field will be populated with a list of unreachable + // locations. + repeated Backup backups = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request message for getting a Backup. +message GetBackupRequest { + // Required. Name of the data source resource name, in the format + // 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. Reserved for future use to provide a BASIC & FULL view of Backup + // resource. + BackupView view = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// Request message for updating a Backup. +message UpdateBackupRequest { + // Required. Field mask is used to specify the fields to be overwritten in the + // Backup resource by the update. + // The fields specified in the update_mask are relative to the resource, not + // the full request. A field will be overwritten if it is in the mask. If the + // user does not provide a mask then the request will fail. + google.protobuf.FieldMask update_mask = 1 + [(google.api.field_behavior) = REQUIRED]; + + // Required. The resource being updated + Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes since the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 3 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Message for deleting a Backup. +message DeleteBackupRequest { + // Required. Name of the resource. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; +} + +// Request message for restoring from a Backup. +message RestoreBackupRequest { + // Required. The resource name of the Backup instance, in the format + // 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } + ]; + + // Optional. An optional request ID to identify requests. Specify a unique + // request ID so that if you must retry your request, the server will know to + // ignore the request if it has already been completed. The server will + // guarantee that for at least 60 minutes after the first request. + // + // For example, consider a situation where you make an initial request and + // the request times out. If you make the request again with the same request + // ID, the server can check if original operation with the same request ID + // was received, and if so, will ignore the second request. This prevents + // clients from accidentally creating duplicate commitments. + // + // The request ID must be a valid UUID with the exception that zero UUID is + // not supported (00000000-0000-0000-0000-000000000000). + string request_id = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OPTIONAL + ]; + + // The target environment for the restore operation. + oneof target_environment { + // Compute Engine target environment to be used during restore. + ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; + + // Disk target environment to be used during restore. + DiskTargetEnvironment disk_target_environment = 5; + + // Region disk target environment to be used during restore. + RegionDiskTargetEnvironment region_disk_target_environment = 6; + } + + // The property overrides for the instance being restored. + oneof instance_properties { + // Compute Engine instance properties to be overridden during restore. + ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; + + // Disk properties to be overridden during restore. + DiskRestoreProperties disk_restore_properties = 7; + } + + // Optional. A field mask used to clear server-side default values + // for fields within the `instance_properties` oneof. + // + // When a field in this mask is cleared, the server will not apply its + // default logic (like inheriting a value from the source) for that field. + // + // The most common current use case is clearing default encryption keys. + // + // Examples of field mask paths: + // - Compute Instance Disks: + // `compute_instance_restore_properties.disks.*.disk_encryption_key` + // - Single Disk: `disk_restore_properties.disk_encryption_key` + optional google.protobuf.FieldMask clear_overrides_field_mask = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Response message for restoring from a Backup. +message RestoreBackupResponse { + // Details of the target resource created/modified as part of restore. + TargetResource target_resource = 1; +} + +// Details of the target resource created/modified as part of restore. +message TargetResource { + // Minimum details to identify the restored resource. + oneof target_resource_info { + // Details of the native Google Cloud resource created as part of restore. + GcpResource gcp_resource = 1; + } +} + +// Minimum details to identify a Google Cloud resource +message GcpResource { + // Name of the Google Cloud resource. + string gcp_resourcename = 1; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // Type of the resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; +} + +// Minimum details to identify a Google Cloud resource for a backup. +message BackupGcpResource { + // Name of the Google Cloud resource. + string gcp_resourcename = 1; + + // Location of the resource: //"global"/"unspecified". + string location = 2; + + // Type of the resource. Use the Unified Resource Type, + // eg. compute.googleapis.com/Instance. + string type = 3; +} + +// Backup configuration state. Is the resource configured for backup? +enum BackupConfigState { + // The possible states of backup configuration. + // Status not set. + BACKUP_CONFIG_STATE_UNSPECIFIED = 0; + + // The data source is actively protected (i.e. there is a + // BackupPlanAssociation or Appliance SLA pointing to it) + ACTIVE = 1; + + // The data source is no longer protected (but may have backups under it) + PASSIVE = 2; +} + +// BackupView contains enum options for Partial and Full view. +enum BackupView { + // If the value is not set, the default 'FULL' view is used. + BACKUP_VIEW_UNSPECIFIED = 0; + + // Includes basic data about the Backup, but not the full contents. + BACKUP_VIEW_BASIC = 1; + + // Includes all data about the Backup. + // This is the default value (for both ListBackups and GetBackup). + BACKUP_VIEW_FULL = 2; +} + +// BackupVaultView contains enum options for Partial and Full view. +enum BackupVaultView { + // If the value is not set, the default 'FULL' view is used. + BACKUP_VAULT_VIEW_UNSPECIFIED = 0; + + // Includes basic data about the Backup Vault, but not the full contents. + BACKUP_VAULT_VIEW_BASIC = 1; + + // Includes all data about the Backup Vault. + // This is the default value (for both ListBackupVaults and GetBackupVault). + BACKUP_VAULT_VIEW_FULL = 2; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto new file mode 100644 index 00000000000..42d294ff894 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto @@ -0,0 +1,49 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultBaProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// BackupApplianceBackupProperties represents BackupDR backup appliance's +// properties. +message BackupApplianceBackupProperties { + // Output only. The numeric generation ID of the backup (monotonically + // increasing). + optional int32 generation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The time when this backup object was finalized (if none, + // backup is not finalized). + optional google.protobuf.Timestamp finalize_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. The earliest timestamp of data available in this Backup. + optional google.protobuf.Timestamp recovery_range_start_time = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The latest timestamp of data available in this Backup. + optional google.protobuf.Timestamp recovery_range_end_time = 4 + [(google.api.field_behavior) = OPTIONAL]; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto new file mode 100644 index 00000000000..c50279109b4 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto @@ -0,0 +1,146 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultCloudSqlProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; +option (google.api.resource_definition) = { + type: "sqladmin.googleapis.com/Instance" + pattern: "projects/{project}/instances/{instance}" +}; + +// CloudSqlInstanceDataSourceProperties represents the properties of a +// Cloud SQL resource that are stored in the DataSource. +message CloudSqlInstanceDataSourceProperties { + // Output only. Name of the Cloud SQL instance backed up by the datasource. + // Format: + // projects/{project}/instances/{instance} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "sqladmin.googleapis.com/Instance" + } + ]; + + // Output only. The installed database version of the Cloud SQL instance. + string database_installed_version = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The instance creation timestamp. + google.protobuf.Timestamp instance_create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The tier (or machine type) for this instance. Example: + // `db-custom-1-3840` + string instance_tier = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CloudSqlInstanceBackupProperties represents Cloud SQL Instance +// Backup properties. +message CloudSqlInstanceBackupProperties { + // Output only. The installed database version of the Cloud SQL instance + // when the backup was taken. + string database_installed_version = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the backup is a final backup. + bool final_backup = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The source instance of the backup. + // Format: + // projects/{project}/instances/{instance} + string source_instance = 4 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "sqladmin.googleapis.com/Instance" + } + ]; + + // Output only. The instance creation timestamp. + google.protobuf.Timestamp instance_create_time = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The tier (or machine type) for this instance. Example: + // `db-custom-1-3840` + string instance_tier = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The instance delete timestamp. + google.protobuf.Timestamp instance_delete_time = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CloudSqlInstanceDataSourceReferenceProperties represents the properties of a +// Cloud SQL resource that are stored in the DataSourceReference. +message CloudSqlInstanceDataSourceReferenceProperties { + // Output only. Name of the Cloud SQL instance backed up by the datasource. + // Format: + // projects/{project}/instances/{instance} + string name = 1 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "sqladmin.googleapis.com/Instance" + } + ]; + + // Output only. The installed database version of the Cloud SQL instance. + string database_installed_version = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The instance creation timestamp. + google.protobuf.Timestamp instance_create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The tier (or machine type) for this instance. Example: + // `db-custom-1-3840` + string instance_tier = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// CloudSqlInstanceInitializationConfig contains the configuration for +// initializing a Cloud SQL instance. +message CloudSqlInstanceInitializationConfig { + // The edition of the Cloud SQL instance. For details, see + // https://cloud.google.com/sql/docs/editions-intro. + enum Edition { + // Unspecified edition. + EDITION_UNSPECIFIED = 0; + + // Enterprise edition. + ENTERPRISE = 1; + + // Enterprise Plus edition. + ENTERPRISE_PLUS = 2; + } + + // Required. The edition of the Cloud SQL instance. + Edition edition = 1 [(google.api.field_behavior) = REQUIRED]; +} + +// Cloud SQL instance's BPA properties. +message CloudSqlInstanceBackupPlanAssociationProperties { + // Output only. The time when the instance was created. + google.protobuf.Timestamp instance_create_time = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto new file mode 100644 index 00000000000..f91c17525d8 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto @@ -0,0 +1,227 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupvault_gce.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultDiskProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; +option (google.api.resource_definition) = { + type: "compute.googleapis.com/StoragePool" + pattern: "projects/{project}/zones/{zone}/storagePools/{storage_pool}" +}; + +// DiskTargetEnvironment represents the target environment for the disk. +message DiskTargetEnvironment { + // Required. Target project for the disk. + string project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Target zone for the disk. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// RegionDiskTargetEnvironment represents the target environment for the disk. +message RegionDiskTargetEnvironment { + // Required. Target project for the disk. + string project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. Target region for the disk. + string region = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. Target URLs of the replica zones for the disk. + repeated string replica_zones = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// DiskRestoreProperties represents the properties of a Disk restore. +message DiskRestoreProperties { + // The supported access modes of the disk. + enum AccessMode { + // The default AccessMode, means the disk can be attached to single instance + // in RW mode. + READ_WRITE_SINGLE = 0; + + // The AccessMode means the disk can be attached to multiple instances in RW + // mode. + READ_WRITE_MANY = 1; + + // The AccessMode means the disk can be attached to multiple instances in RO + // mode. + READ_ONLY_MANY = 2; + } + + // Architecture of the source disk. + enum Architecture { + // Default value. This value is unused. + ARCHITECTURE_UNSPECIFIED = 0; + + // Disks with architecture X86_64 + X86_64 = 1; + + // Disks with architecture ARM64 + ARM64 = 2; + } + + // Required. Name of the disk. + optional string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. An optional description of this resource. Provide this property + // when you create the resource. + optional string description = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Required. The size of the disk in GB. + optional int64 size_gb = 3 [(google.api.field_behavior) = REQUIRED]; + + // Optional. A list of publicly available licenses that are applicable to this + // backup. This is applicable if the original image had licenses attached, + // e.g. Windows image + repeated string licenses = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of features to enable in the guest operating system. This + // is applicable only for bootable images. + repeated GuestOsFeature guest_os_feature = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts the disk using a + // customer-supplied encryption key or a customer-managed encryption key. + optional CustomerEncryptionKey disk_encryption_key = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Physical block size of the persistent disk, in bytes. + // If not present in a request, a default value is used. + // Currently, the supported size is 4096. + optional int64 physical_block_size_bytes = 7 + [(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. + optional int64 provisioned_iops = 8 [(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. + optional int64 provisioned_throughput = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates whether this disk is using confidential compute mode. + // Encryption with a Cloud KMS key is required to enable this option. + optional bool enable_confidential_compute = 10 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The storage pool in which the new disk is created. You can + // provide this as a partial or full URL to the resource. + optional string storage_pool = 11 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.resource_reference) = { + type: "compute.googleapis.com/StoragePool" + } + ]; + + // Optional. The access mode of the disk. + optional AccessMode access_mode = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The architecture of the source disk. Valid values are + // ARM64 or X86_64. + optional Architecture architecture = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource policies applied to this disk. + repeated string resource_policy = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Required. URL of the disk type resource describing which disk type to use + // to create the disk. + optional string type = 16 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Labels to apply to this disk. These can be modified later using + // setLabels method. Label values can be empty. + map labels = 17 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Resource manager tags to be bound to the disk. + map resource_manager_tags = 18 + [(google.api.field_behavior) = OPTIONAL]; +} + +// DiskBackupProperties represents the properties of a Disk backup. +message DiskBackupProperties { + // Architecture of the source disk. + enum Architecture { + // Default value. This value is unused. + ARCHITECTURE_UNSPECIFIED = 0; + + // Disks with architecture X86_64 + X86_64 = 1; + + // Disks with architecture ARM64 + ARM64 = 2; + } + + // A description of the source disk. + optional string description = 1; + + // A list of publicly available licenses that are applicable to this backup. + // This is applicable if the original image had licenses attached, e.g. + // Windows image. + repeated string licenses = 2; + + // A list of guest OS features that are applicable to this backup. + repeated GuestOsFeature guest_os_feature = 3; + + // The architecture of the source disk. Valid values are + // ARM64 or X86_64. + optional Architecture architecture = 4; + + // The URL of the type of the disk. + optional string type = 5; + + // Size(in GB) of the source disk. + optional int64 size_gb = 6; + + // Region and zone are mutually exclusive fields. + // The URL of the region of the source disk. + optional string region = 7; + + // The URL of the Zone where the source disk. + optional string zone = 8; + + // The URL of the Zones where the source disk should be replicated. + repeated string replica_zones = 9; + + // The source disk used to create this backup. + optional string source_disk = 10; +} + +// DiskDataSourceProperties represents the properties of a +// Disk resource that are stored in the DataSource. +// . +message DiskDataSourceProperties { + // Name of the disk backed up by the datasource. + string name = 1; + + // The description of the disk. + string description = 2; + + // The type of the disk. + string type = 3; + + // The size of the disk in GB. + int64 size_gb = 4; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto new file mode 100644 index 00000000000..22961a9d788 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto @@ -0,0 +1,957 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "BackupvaultGceProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// ComputeInstanceBackupProperties represents Compute Engine instance backup +// properties. +message ComputeInstanceBackupProperties { + // An optional text description for the instances that are created from these + // properties. + optional string description = 1; + + // A list of tags to apply to the instances that are created from these + // properties. The tags identify valid sources or targets for network + // firewalls. The setTags method can modify this list of tags. Each tag within + // the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). + optional Tags tags = 2; + + // The machine type to use for instances that are created from these + // properties. + optional string machine_type = 3; + + // Enables instances created based on these properties to send packets with + // source IP addresses other than their own and receive packets with + // destination IP addresses other than their own. If these instances will be + // used as an IP gateway or it will be set as the next-hop in a Route + // resource, specify `true`. If unsure, leave this set to `false`. See the + // https://cloud.google.com/vpc/docs/using-routes#canipforward + // documentation for more information. + optional bool can_ip_forward = 4; + + // An array of network access configurations for this interface. + repeated NetworkInterface network_interface = 5; + + // An array of disks that are associated with the instances that are created + // from these properties. + repeated AttachedDisk disk = 6; + + // The metadata key/value pairs to assign to instances that are created from + // these properties. These pairs can consist of custom metadata or predefined + // keys. See https://cloud.google.com/compute/docs/metadata/overview for more + // information. + optional Metadata metadata = 7; + + // A list of service accounts with specified scopes. Access tokens for these + // service accounts are available to the instances that are created from + // these properties. Use metadata queries to obtain the access tokens for + // these instances. + repeated ServiceAccount service_account = 8; + + // Specifies the scheduling options for the instances that are created from + // these properties. + optional Scheduling scheduling = 9; + + // A list of guest accelerator cards' type and count to use for instances + // created from these properties. + repeated AcceleratorConfig guest_accelerator = 10; + + // Minimum cpu/platform to be used by instances. The instance may be + // scheduled on the specified or newer cpu/platform. Applicable values are the + // friendly names of CPU platforms, such as + // `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. + // For more information, read + // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. + optional string min_cpu_platform = 11; + + // KeyRevocationActionType of the instance. Supported options are "STOP" and + // "NONE". The default value is "NONE" if it is not specified. + optional KeyRevocationActionType key_revocation_action_type = 12; + + // The source instance used to create this backup. This can be a partial or + // full URL to the resource. For example, the following are valid values: + // -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance + // -projects/project/zones/zone/instances/instance + optional string source_instance = 13; + + // Labels to apply to instances that are created from these properties. + map labels = 14; +} + +// ComputeInstanceRestoreProperties represents Compute Engine instance +// properties to be overridden during restore. +message ComputeInstanceRestoreProperties { + // The private IPv6 google access type for the VMs. + enum InstancePrivateIpv6GoogleAccess { + // Default value. This value is unused. + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; + + // Each network interface inherits PrivateIpv6GoogleAccess from its + // subnetwork. + INHERIT_FROM_SUBNETWORK = 1; + + // Outbound private IPv6 access from VMs in this subnet to Google services. + // If specified, the subnetwork who is attached to the instance's default + // network interface will be assigned an internal IPv6 prefix if it doesn't + // have before. + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; + + // Bidirectional private IPv6 access to/from Google services. If + // specified, the subnetwork who is attached to the instance's default + // network interface will be assigned an internal IPv6 prefix if it doesn't + // have before. + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; + } + + // Required. Name of the compute instance. + optional string name = 1 [(google.api.field_behavior) = REQUIRED]; + + // Optional. Controls for advanced machine-related behavior features. + optional AdvancedMachineFeatures advanced_machine_features = 2 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Allows this instance to send and receive packets with + // non-matching destination or source IPs. + optional bool can_ip_forward = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Controls Confidential compute options on the instance + optional ConfidentialInstanceConfig confidential_instance_config = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether the resource should be protected against deletion. + optional bool deletion_protection = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An optional description of this resource. Provide this property + // when you create the resource. + optional string description = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Array of disks associated with this instance. Persistent disks + // must be created before you can assign them. Source regional persistent + // disks will be restored with default replica zones if not specified. + repeated AttachedDisk disks = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Enables display device for the instance. + optional DisplayDevice display_device = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of the type and count of accelerator cards attached to the + // instance. + repeated AcceleratorConfig guest_accelerators = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the hostname of the instance. The specified hostname + // must be RFC1035 compliant. If hostname is not specified, the default + // hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global + // DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal + // DNS. + optional string hostname = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts suspended data for an instance with a + // customer-managed encryption key. + optional CustomerEncryptionKey instance_encryption_key = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. KeyRevocationActionType of the instance. + optional KeyRevocationActionType key_revocation_action_type = 12 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Labels to apply to this instance. + map labels = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Full or partial URL of the machine type resource to use for this + // instance. + optional string machine_type = 14 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This includes custom metadata and predefined keys. + optional Metadata metadata = 15 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Minimum CPU platform to use for this instance. + optional string min_cpu_platform = 16 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of network configurations for this instance. These + // specify how interfaces are configured to interact with other network + // services, such as connecting to the internet. Multiple interfaces are + // supported per instance. Required to restore in different project or region. + repeated NetworkInterface network_interfaces = 17 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Configure network performance such as egress bandwidth tier. + optional NetworkPerformanceConfig network_performance_config = 18 + [(google.api.field_behavior) = OPTIONAL]; + + // Input only. Additional params passed with the request, but not persisted + // as part of resource payload. + optional InstanceParams params = 19 + [(google.api.field_behavior) = INPUT_ONLY]; + + // Optional. The private IPv6 google access type for the VM. + // If not specified, use INHERIT_FROM_SUBNETWORK as default. + optional InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the reservations that this instance can consume from. + optional AllocationAffinity allocation_affinity = 21 [ + json_name = "reservationAffinity", + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Resource policies applied to this instance. + // By default, no resource policies will be applied. + repeated string resource_policies = 22 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Sets the scheduling options for this instance. + optional Scheduling scheduling = 23 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of service accounts, with their specified scopes, + // authorized for this instance. Only one service account per VM instance is + // supported. + repeated ServiceAccount service_accounts = 24 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Tags to apply to this instance. Tags are used to identify valid + // sources or targets for network firewalls and are specified by the client + // during instance creation. + optional Tags tags = 26 [(google.api.field_behavior) = OPTIONAL]; +} + +// ComputeInstanceTargetEnvironment represents Compute Engine target +// environment to be used during restore. +message ComputeInstanceTargetEnvironment { + // Required. Target project for the Compute Engine instance. + string project = 1 [(google.api.field_behavior) = REQUIRED]; + + // Required. The zone of the Compute Engine instance. + string zone = 2 [(google.api.field_behavior) = REQUIRED]; +} + +// ComputeInstanceDataSourceProperties represents the properties of a +// ComputeEngine resource that are stored in the DataSource. +message ComputeInstanceDataSourceProperties { + // Name of the compute instance backed up by the datasource. + string name = 1; + + // The description of the Compute Engine instance. + string description = 2; + + // The machine type of the instance. + string machine_type = 3; + + // The total number of disks attached to the Instance. + int64 total_disk_count = 4; + + // The sum of all the disk sizes. + int64 total_disk_size_gb = 5; +} + +// Specifies options for controlling advanced machine features. +message AdvancedMachineFeatures { + // Optional. Whether to enable nested virtualization or not (default is + // false). + optional bool enable_nested_virtualization = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of threads per physical core. To disable simultaneous + // multithreading (SMT) set this to 1. If unset, the maximum number + // of threads supported per core by the underlying processor is + // assumed. + optional int32 threads_per_core = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of physical cores to expose to an instance. Multiply + // by the number of threads per core to compute the total number of virtual + // CPUs to expose to the instance. If unset, the number of cores is + // inferred from the instance's nominal CPU count and the underlying + // platform's SMT width. + optional int32 visible_core_count = 3 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Whether to enable UEFI networking for instance creation. + optional bool enable_uefi_networking = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of Confidential Instance options. +message ConfidentialInstanceConfig { + // Optional. Defines whether the instance should have confidential compute + // enabled. + optional bool enable_confidential_compute = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of Display Device options +message DisplayDevice { + // Optional. Enables display for the Compute Engine VM + optional bool enable_display = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A specification of the type and number of accelerator cards attached to the +// instance. +message AcceleratorConfig { + // Optional. Full or partial URL of the accelerator type resource to attach to + // this instance. + optional string accelerator_type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The number of the guest accelerator cards exposed to this + // instance. + optional int32 accelerator_count = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A customer-supplied encryption key. +message CustomerEncryptionKey { + // The key to use for encryption. + oneof key { + // Optional. Specifies a 256-bit customer-supplied + // encryption key. + string raw_key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. RSA-wrapped 2048-bit + // customer-supplied encryption key to either encrypt or decrypt this + // resource. + string rsa_encrypted_key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of the encryption key that is stored in Google Cloud + // KMS. + string kms_key_name = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Optional. The service account being used for the encryption request for the + // given KMS key. If absent, the Compute Engine default service account is + // used. + optional string kms_key_service_account = 4 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A key/value pair to be used for storing metadata. +message Entry { + // Optional. Key for the metadata entry. + optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Value for the metadata entry. These are free-form strings, and + // only have meaning as interpreted by the image running in the instance. The + // only restriction placed on values is that their size must be less than + // or equal to 262144 bytes (256 KiB). + optional string value = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A metadata key/value entry. +message Metadata { + // Optional. Array of key/value pairs. The total size of all keys and values + // must be less than 512 KB. + repeated Entry items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// A network interface resource attached to an instance. +// s +message NetworkInterface { + // Stack type for this network interface. + enum StackType { + // Default should be STACK_TYPE_UNSPECIFIED. + STACK_TYPE_UNSPECIFIED = 0; + + // The network interface will be assigned IPv4 address. + IPV4_ONLY = 1; + + // The network interface can have both IPv4 and IPv6 addresses. + IPV4_IPV6 = 2; + } + + // IPv6 access type for this network interface. + enum Ipv6AccessType { + // IPv6 access type not set. Means this network interface hasn't been + // turned on IPv6 yet. + UNSPECIFIED_IPV6_ACCESS_TYPE = 0; + + // This network interface can have internal IPv6. + INTERNAL = 1; + + // This network interface can have external IPv6. + EXTERNAL = 2; + } + + // Nic type for this network interface. + enum NicType { + // Default should be NIC_TYPE_UNSPECIFIED. + NIC_TYPE_UNSPECIFIED = 0; + + // VIRTIO + VIRTIO_NET = 1; + + // GVNIC + GVNIC = 2; + } + + // Optional. URL of the VPC network resource for this instance. + optional string network = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URL of the Subnetwork resource for this instance. + optional string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An IPv4 internal IP address to assign to the instance for this + // network interface. If not specified by the user, an unused internal IP is + // assigned by the system. + optional string ip_address = 3 [ + json_name = "networkIP", + (google.api.field_info).format = IPV4, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. An IPv6 internal network address for this network interface. To + // use a static internal IP address, it must be unused and in the same region + // as the instance's zone. If not specified, Google Cloud will automatically + // assign an internal IPv6 address from the instance's subnetwork. + optional string ipv6_address = 4 [ + (google.api.field_info).format = IPV6, + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. The prefix length of the primary internal IPv6 range. + optional int32 internal_ipv6_prefix_length = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Output only. [Output Only] The name of the network interface, which is + // generated by the server. + optional string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Optional. An array of configurations for this interface. Currently, only + // one access config,ONE_TO_ONE_NAT is supported. If there are no + // accessConfigs specified, then this instance will have + // no external internet access. + repeated AccessConfig access_configs = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of IPv6 access configurations for this interface. + // Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there + // is no ipv6AccessConfig specified, then this instance will + // have no external IPv6 Internet access. + repeated AccessConfig ipv6_access_configs = 8 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. An array of alias IP ranges for this network interface. + // You can only specify this field for network interfaces in VPC networks. + repeated AliasIpRange alias_ip_ranges = 9 + [(google.api.field_behavior) = OPTIONAL]; + + // The stack type for this network interface. + optional StackType stack_type = 10; + + // Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the + // IP can be accessed from the Internet. This field is always inherited from + // its subnetwork. + optional Ipv6AccessType ipv6_access_type = 11 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The networking queue count that's specified by users for the + // network interface. Both Rx and Tx queues will be set to this number. It'll + // be empty if not specified by the users. + optional int32 queue_count = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The type of vNIC to be used on this interface. This may be gVNIC + // or VirtioNet. + optional NicType nic_type = 13 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The URL of the network attachment that this interface should + // connect to in the following format: + // projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. + optional string network_attachment = 14 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Network performance configuration. +message NetworkPerformanceConfig { + // Network performance tier. + enum Tier { + // This value is unused. + TIER_UNSPECIFIED = 0; + + // Default network performance config. + DEFAULT = 1; + + // Tier 1 network performance config. + TIER_1 = 2; + } + + // Optional. The tier of the total egress bandwidth. + optional Tier total_egress_bandwidth_tier = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An access configuration attached to an instance's network interface. +// Only one access config per instance is supported. +message AccessConfig { + // The type of configuration. + enum AccessType { + // Default value. This value is unused. + ACCESS_TYPE_UNSPECIFIED = 0; + + // ONE_TO_ONE_NAT + ONE_TO_ONE_NAT = 1; + + // Direct IPv6 access. + DIRECT_IPV6 = 2; + } + + // Network tier property used by addresses, instances and forwarding rules. + enum NetworkTier { + // Default value. This value is unused. + NETWORK_TIER_UNSPECIFIED = 0; + + // High quality, Google-grade network tier, support for all networking + // products. + PREMIUM = 1; + + // Public internet quality, only limited support for other networking + // products. + STANDARD = 2; + } + + // Optional. In accessConfigs (IPv4), the + // default and only option is ONE_TO_ONE_NAT. In + // ipv6AccessConfigs, the default and only option is + // DIRECT_IPV6. + optional AccessType type = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of this access configuration. + optional string name = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The external IP address of this access configuration. + optional string external_ip = 3 + [json_name = "natIP", (google.api.field_behavior) = OPTIONAL]; + + // Optional. The external IPv6 address of this access configuration. + optional string external_ipv6 = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The prefix length of the external IPv6 range. + optional int32 external_ipv6_prefix_length = 5 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether a public DNS 'PTR' record should be created to + // map the external IP address of the instance to a DNS domain name. + optional bool set_public_ptr = 6 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The DNS domain name for the public PTR record. + optional string public_ptr_domain_name = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This signifies the networking tier used for configuring this + // access + optional NetworkTier network_tier = 8 + [(google.api.field_behavior) = OPTIONAL]; +} + +// An alias IP range attached to an instance's network interface. +message AliasIpRange { + // Optional. The IP alias ranges to allocate for this interface. + optional string ip_cidr_range = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The name of a subnetwork secondary IP range from which to + // allocate an IP alias range. If not specified, the primary range of the + // subnetwork is used. + optional string subnetwork_range_name = 2 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Additional instance params. +message InstanceParams { + // Optional. Resource manager tags to be bound to the instance. + map resource_manager_tags = 1 + [(google.api.field_behavior) = OPTIONAL]; +} + +// Specifies the reservations that this instance can consume from. +message AllocationAffinity { + // Indicates whether to consume from a reservation or not. + enum Type { + // Default value. This value is unused. + TYPE_UNSPECIFIED = 0; + + // Do not consume from any allocated capacity. + NO_RESERVATION = 1; + + // Consume any allocation available. + ANY_RESERVATION = 2; + + // Must consume from a specific reservation. Must specify key value fields + // for specifying the reservations. + SPECIFIC_RESERVATION = 3; + } + + // Optional. Specifies the type of reservation from which this instance can + // consume + optional Type consume_allocation_type = 1 [ + json_name = "consumeReservationType", + (google.api.field_behavior) = OPTIONAL + ]; + + // Optional. Corresponds to the label key of a reservation resource. + optional string key = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of a reservation resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; +} + +// Sets the scheduling options for an Instance. +message Scheduling { + // Defines the maintenance behavior for this instance= + enum OnHostMaintenance { + // Default value. This value is unused. + ON_HOST_MAINTENANCE_UNSPECIFIED = 0; + + // Tells Compute Engine to terminate and (optionally) restart the instance + // away from the maintenance activity. + TERMINATE = 1; + + // Default, Allows Compute Engine to automatically migrate instances + // out of the way of maintenance events. + MIGRATE = 1000; + } + + // Node Affinity: the configuration of desired nodes onto which this Instance + // could be scheduled. + message NodeAffinity { + // Defines the type of node selections. + enum Operator { + // Default value. This value is unused. + OPERATOR_UNSPECIFIED = 0; + + // Requires Compute Engine to seek for matched nodes. + IN = 1; + + // Requires Compute Engine to avoid certain nodes. + NOT_IN = 2; + } + + // Optional. Corresponds to the label key of Node resource. + optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines the operation of node selection. + optional Operator operator = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Corresponds to the label values of Node resource. + repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; + } + + // Defines the provisioning model for an instance. + enum ProvisioningModel { + // Default value. This value is not used. + PROVISIONING_MODEL_UNSPECIFIED = 0; + + // Standard provisioning with user controlled runtime, no discounts. + STANDARD = 1; + + // Heavily discounted, no guaranteed runtime. + SPOT = 2; + } + + // Defines the supported termination actions for an instance. + enum InstanceTerminationAction { + // Default value. This value is unused. + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; + + // Delete the VM. + DELETE = 1; + + // Stop the VM without storing in-memory content. default action. + STOP = 2; + } + + // Optional. Defines the maintenance behavior for this instance. + optional OnHostMaintenance on_host_maintenance = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the instance should be automatically restarted + // if it is terminated by Compute Engine (not terminated by a user). + optional bool automatic_restart = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Defines whether the instance is preemptible. + optional bool preemptible = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A set of node affinity and anti-affinity configurations. + // Overrides reservationAffinity. + repeated NodeAffinity node_affinities = 4 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The minimum number of virtual CPUs this instance will consume + // when running on a sole-tenant node. + optional int32 min_node_cpus = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the provisioning model of the instance. + optional ProvisioningModel provisioning_model = 6 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the termination action for the instance. + optional InstanceTerminationAction instance_termination_action = 7 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the maximum amount of time a Local Ssd Vm should wait + // while recovery of the Local Ssd state is attempted. Its value should be in + // between 0 and 168 hours with hour granularity and the default value being 1 + // hour. + optional SchedulingDuration local_ssd_recovery_timeout = 10 + [(google.api.field_behavior) = OPTIONAL]; +} + +// A SchedulingDuration represents a fixed-length span of time represented +// as a count of seconds and fractions of seconds at nanosecond +// resolution. It is independent of any calendar and concepts like "day" +// or "month". Range is approximately 10,000 years. +message SchedulingDuration { + // Optional. Span of time at a resolution of a second. + optional int64 seconds = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Span of time that's a fraction of a second at nanosecond + // resolution. + optional int32 nanos = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A service account. +message ServiceAccount { + // Optional. Email address of the service account. + optional string email = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The list of scopes to be made available for this service account. + repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; +} + +// A set of instance tags. +message Tags { + // Optional. An array of tags. Each tag must be 1-63 characters long, and + // comply with RFC1035. + repeated string items = 1 [(google.api.field_behavior) = OPTIONAL]; +} + +// An instance-attached disk resource. +message AttachedDisk { + // Specifies the parameters to initialize this disk. + message InitializeParams { + // Optional. Specifies the disk name. If not specified, the default is to + // use the name of the instance. + optional string disk_name = 1 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. URL of the zone where the disk should be created. + // Required for each regional disk associated with the instance. + repeated string replica_zones = 2 [(google.api.field_behavior) = OPTIONAL]; + } + + // List of the Disk Types. + enum DiskType { + // Default value, which is unused. + DISK_TYPE_UNSPECIFIED = 0; + + // A scratch disk type. + SCRATCH = 1; + + // A persistent disk type. + PERSISTENT = 2; + } + + // List of the Disk Modes. + enum DiskMode { + // Default value, which is unused. + DISK_MODE_UNSPECIFIED = 0; + + // Attaches this disk in read-write mode. Only one + // virtual machine at a time can be attached to a disk in read-write mode. + READ_WRITE = 1; + + // Attaches this disk in read-only mode. Multiple virtual machines can use + // a disk in read-only mode at a time. + READ_ONLY = 2; + + // The disk is locked for administrative reasons. Nobody else + // can use the disk. This mode is used (for example) when taking + // a snapshot of a disk to prevent mounting the disk while it is + // being snapshotted. + LOCKED = 3; + } + + // List of the Disk Interfaces. + enum DiskInterface { + // Default value, which is unused. + DISK_INTERFACE_UNSPECIFIED = 0; + + // SCSI Disk Interface. + SCSI = 1; + + // NVME Disk Interface. + NVME = 2; + + // NVDIMM Disk Interface. + NVDIMM = 3; + + // ISCSI Disk Interface. + ISCSI = 4; + } + + // List of the states of the Disk. + enum DiskSavedState { + // Default Disk state has not been preserved. + DISK_SAVED_STATE_UNSPECIFIED = 0; + + // Disk state has been preserved. + PRESERVED = 1; + } + + // Optional. Specifies the parameters to initialize this disk. + optional InitializeParams initialize_params = 1 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. This is used as an identifier for the disks. This is the unique + // name has to provided to modify disk parameters like disk_name and + // replica_zones (in case of RePDs) + optional string device_name = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Type of the resource. + optional string kind = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Specifies the type of the disk. + optional DiskType disk_type_deprecated = 6 [deprecated = true]; + + // Optional. The mode in which to attach this disk. + optional DiskMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies a valid partial or full URL to an existing Persistent + // Disk resource. + optional string source = 8 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A zero-based index to this disk, where 0 is reserved for the + // boot disk. + optional int64 index = 9 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Indicates that this is a boot disk. The virtual machine will use + // the first partition of the disk for its root filesystem. + optional bool boot = 10 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies whether the disk will be auto-deleted when the instance + // is deleted (but not when the disk is detached from the instance). + optional bool auto_delete = 11 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Any valid publicly visible licenses. + repeated string license = 12 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Specifies the disk interface to use for attaching this disk. + optional DiskInterface disk_interface = 13 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A list of features to enable on the guest operating system. + // Applicable only for bootable images. + repeated GuestOsFeature guest_os_feature = 14 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Encrypts or decrypts a disk using a customer-supplied + // encryption key. + optional CustomerEncryptionKey disk_encryption_key = 15 + [(google.api.field_behavior) = OPTIONAL]; + + // Optional. The size of the disk in GB. + optional int64 disk_size_gb = 16 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Output only. The state of the disk. + optional DiskSavedState saved_state = 17 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Output only. The URI of the disk type resource. For example: + // projects/project/zones/zone/diskTypes/pd-standard or pd-ssd + optional string disk_type = 18 [ + (google.api.field_behavior) = OPTIONAL, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Optional. Specifies the type of the disk. + optional DiskType type = 19 [(google.api.field_behavior) = OPTIONAL]; +} + +// Feature type of the Guest OS. +message GuestOsFeature { + // List of the Feature Types. + enum FeatureType { + // Default value, which is unused. + FEATURE_TYPE_UNSPECIFIED = 0; + + // VIRTIO_SCSI_MULTIQUEUE feature type. + VIRTIO_SCSI_MULTIQUEUE = 1; + + // WINDOWS feature type. + WINDOWS = 2; + + // MULTI_IP_SUBNET feature type. + MULTI_IP_SUBNET = 3; + + // UEFI_COMPATIBLE feature type. + UEFI_COMPATIBLE = 4; + + // SECURE_BOOT feature type. + SECURE_BOOT = 5; + + // GVNIC feature type. + GVNIC = 6; + + // SEV_CAPABLE feature type. + SEV_CAPABLE = 7; + + // BARE_METAL_LINUX_COMPATIBLE feature type. + BARE_METAL_LINUX_COMPATIBLE = 8; + + // SUSPEND_RESUME_COMPATIBLE feature type. + SUSPEND_RESUME_COMPATIBLE = 9; + + // SEV_LIVE_MIGRATABLE feature type. + SEV_LIVE_MIGRATABLE = 10; + + // SEV_SNP_CAPABLE feature type. + SEV_SNP_CAPABLE = 11; + + // TDX_CAPABLE feature type. + TDX_CAPABLE = 12; + + // IDPF feature type. + IDPF = 13; + + // SEV_LIVE_MIGRATABLE_V2 feature type. + SEV_LIVE_MIGRATABLE_V2 = 14; + } + + // The ID of a supported feature. + optional FeatureType type = 1; +} + +// Specifies whether the virtual machine instance will be shut down on key +// revocation. It is currently used in instance, instance properties and GMI +// protos +enum KeyRevocationActionType { + // Default value. This value is unused. + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; + + // Indicates user chose no operation. + NONE = 1; + + // Indicates user chose to opt for VM shutdown on key revocation. + STOP = 2; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto new file mode 100644 index 00000000000..70626639879 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto @@ -0,0 +1,249 @@ +// 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.backupdr.v1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/backupdr/v1/backupvault.proto"; +import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "DataSourceReferenceProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// DataSourceReference is a reference to a DataSource resource. +message DataSourceReference { + option (google.api.resource) = { + type: "backupdr.googleapis.com/DataSourceReference" + pattern: "projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}" + plural: "dataSourceReferences" + singular: "dataSourceReference" + }; + + // Identifier. The resource name of the DataSourceReference. + // Format: + // projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The resource name of the DataSource. + // Format: + // projects/{project}/locations/{location}/backupVaults/{backupVault}/dataSources/{dataSource} + string data_source = 2 [ + (google.api.field_behavior) = OUTPUT_ONLY, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/DataSource" + } + ]; + + // Output only. The time when the DataSourceReference was created. + google.protobuf.Timestamp create_time = 3 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The backup configuration state of the DataSource. + BackupConfigState data_source_backup_config_state = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Number of backups in the DataSource. + int64 data_source_backup_count = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Information of backup configuration on the DataSource. + DataSourceBackupConfigInfo data_source_backup_config_info = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The GCP resource that the DataSource is associated with. + DataSourceGcpResourceInfo data_source_gcp_resource_info = 7 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Total size of the storage used by all backup resources for the + // referenced datasource. + optional int64 total_stored_bytes = 8 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Information of backup configuration on the DataSource. +message DataSourceBackupConfigInfo { + // Output only. The status of the last backup in this DataSource + BackupConfigInfo.LastBackupState last_backup_state = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the last successful backup to this DataSource. + google.protobuf.Timestamp last_successful_backup_consistency_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// The GCP resource that the DataSource is associated with. +message DataSourceGcpResourceInfo { + // Output only. The resource name of the GCP resource. + // Ex: projects/{project}/zones/{zone}/instances/{instance} + string gcp_resourcename = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the GCP resource. + // Ex: compute.googleapis.com/Instance + string type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The location of the GCP resource. + // Ex: //"global"/"unspecified" + string location = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The properties of the GCP resource. + oneof resource_properties { + // Output only. The properties of the Cloud SQL instance. + CloudSqlInstanceDataSourceReferenceProperties + cloud_sql_instance_properties = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + } +} + +// Request for the GetDataSourceReference method. +message GetDataSourceReferenceRequest { + // Required. The name of the DataSourceReference to retrieve. + // Format: + // projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "backupdr.googleapis.com/DataSourceReference" + } + ]; +} + +// Request for the ListDataSourceReferences method. +message ListDataSourceReferencesRequest { + // Required. The parent resource name. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/DataSourceReference" + } + ]; + + // Optional. The maximum number of DataSourceReferences to return. The service + // may return fewer than this value. If unspecified, at most 50 + // DataSourceReferences will be returned. The maximum value is 100; values + // above 100 will be coerced to 100. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous `ListDataSourceReferences` + // call. Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDataSourceReferences` must match the call that provided the page + // token. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters the results listed in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. + // + // The following field and operator combinations are supported: + // + // * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + // * data_source_gcp_resource_info.type with `=`, `!=` + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. + // + // Supported fields: + // + // * data_source + // * data_source_gcp_resource_info.gcp_resourcename + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the ListDataSourceReferences method. +message ListDataSourceReferencesResponse { + // The DataSourceReferences from the specified parent. + repeated DataSourceReference data_source_references = 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; + + // Locations that could not be reached. + repeated string unreachable = 3; +} + +// Request for the FetchDataSourceReferencesForResourceType method. +message FetchDataSourceReferencesForResourceTypeRequest { + // Required. The parent resource name. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "backupdr.googleapis.com/DataSourceReference" + } + ]; + + // Required. The type of the GCP resource. + // Ex: sql.googleapis.com/Instance + string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; + + // Optional. The maximum number of DataSourceReferences to return. The service + // may return fewer than this value. If unspecified, at most 50 + // DataSourceReferences will be returned. The maximum value is 100; values + // above 100 will be coerced to 100. + int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A page token, received from a previous call of + // `FetchDataSourceReferencesForResourceType`. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `FetchDataSourceReferencesForResourceType` must match + // the call that provided the page token. + string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A filter expression that filters the results fetched in the + // response. The expression must specify the field name, a comparison + // operator, and the value that you want to use for filtering. Supported + // fields: + // * data_source + // * data_source_gcp_resource_info.gcp_resourcename + // * data_source_backup_config_state + // * data_source_backup_count + // * data_source_backup_config_info.last_backup_state + // * data_source_gcp_resource_info.gcp_resourcename + // * data_source_gcp_resource_info.type + // * data_source_gcp_resource_info.location + // * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + string filter = 5 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A comma-separated list of fields to order by, sorted in ascending + // order. Use "desc" after a field name for descending. + // + // Supported fields: + // * name + string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for the FetchDataSourceReferencesForResourceType method. +message FetchDataSourceReferencesForResourceTypeResponse { + // The DataSourceReferences from the specified parent. + repeated DataSourceReference data_source_references = 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; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto new file mode 100644 index 00000000000..7bf36153f34 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto @@ -0,0 +1,322 @@ +// 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.backupdr.v1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/field_info.proto"; +import "google/api/resource.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.BackupDR.V1"; +option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; +option java_multiple_files = true; +option java_outer_classname = "ProtectionSummaryProto"; +option java_package = "com.google.cloud.backupdr.v1"; +option php_namespace = "Google\\Cloud\\BackupDR\\V1"; +option ruby_package = "Google::Cloud::BackupDR::V1"; + +// The Protection Summary service. +service BackupDrProtectionSummary { + option (google.api.default_host) = "backupdr.googleapis.com"; + option (google.api.oauth_scopes) = + "https://www.googleapis.com/auth/cloud-platform"; + + // Lists ResourceBackupConfigs. + rpc ListResourceBackupConfigs(ListResourceBackupConfigsRequest) + returns (ListResourceBackupConfigsResponse) { + option (google.api.http) = { + get: "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs" + }; + option (google.api.method_signature) = "parent"; + } +} + +// Request for ListResourceBackupConfigs. +message ListResourceBackupConfigsRequest { + // Required. The project and location for which to retrieve resource backup + // configs. Format: 'projects/{project_id}/locations/{location}'. In Google + // Cloud Backup and DR, locations map to Google Cloud regions, for example + // **us-central1**. + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Optional. Requested page size. Server may return fewer items than + // requested. If unspecified, server will use 100 as default. Maximum value is + // 500 and values above 500 will be coerced to 500. + int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. A token identifying a page of results the server should return. + string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Filtering results. + string filter = 4 [(google.api.field_behavior) = OPTIONAL]; + + // Optional. Hint for how to order the results. + string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; +} + +// Response for ListResourceBackupConfigs. +message ListResourceBackupConfigsResponse { + // The list of ResourceBackupConfigs for the specified scope. + repeated ResourceBackupConfig resource_backup_configs = 1; + + // A token identifying a page of results the server should return. + string next_page_token = 2; +} + +// ResourceBackupConfig represents a resource along with its backup +// configurations. +message ResourceBackupConfig { + option (google.api.resource) = { + type: "backupdr.googleapis.com/ResourceBackupConfig" + pattern: "projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}" + plural: "resourceBackupConfigs" + singular: "resourceBackupConfig" + }; + + // The type of the cloud resource. + enum ResourceType { + // Resource type not set. + RESOURCE_TYPE_UNSPECIFIED = 0; + + // Cloud SQL instance. + CLOUD_SQL_INSTANCE = 1; + + // Compute Engine VM. + COMPUTE_ENGINE_VM = 2; + + // Compute Engine Disk. + COMPUTE_ENGINE_DISK = 3; + + // Compute Engine Regional Disk. + COMPUTE_ENGINE_REGIONAL_DISK = 4; + } + + // Identifier. The resource name of the ResourceBackupConfig. + // Format: + // projects/{project}/locations/{location}/resourceBackupConfigs/{uid} + string name = 1 [(google.api.field_behavior) = IDENTIFIER]; + + // Output only. The unique identifier of the resource backup config. + string uid = 2 [ + (google.api.field_info).format = UUID4, + (google.api.field_behavior) = OUTPUT_ONLY + ]; + + // Output only. The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the cloud resource that this configuration applies to. Supported + // resource types are + // [ResourceBackupConfig.ResourceType][google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType]. + string target_resource = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The human friendly name of the target resource. + string target_resource_display_name = 4 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the target resource. + ResourceType target_resource_type = 5 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Labels associated with the target resource. + map target_resource_labels = 6; + + // Backup configurations applying to the target resource, including those + // targeting its related/child resources. For example, backup configuration + // applicable to Compute Engine disks will be populated in this field for a + // Compute Engine VM which has the disk associated. + repeated BackupConfigDetails backup_configs_details = 7; + + // Output only. Whether the target resource is configured for backup. This is + // true if the backup_configs_details is not empty. + bool backup_configured = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Whether the target resource is protected by a backup vault. + // This is true if the backup_configs_details is not empty and any of the + // [ResourceBackupConfig.backup_configs_details][google.cloud.backupdr.v1.ResourceBackupConfig.backup_configs_details] + // has a backup configuration with + // [BackupConfigDetails.backup_vault][google.cloud.backupdr.v1.BackupConfigDetails.backup_vault] + // set. set. + bool vaulted = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupConfigDetails has information about how the resource is configured +// for backups and about the most recent backup taken for this configuration. +message BackupConfigDetails { + // Type of the backup configuration. + // This enum may receive new values in the future. + enum Type { + // Backup config type is unspecified. + TYPE_UNSPECIFIED = 0; + + // Backup config is Cloud SQL instance's automated backup config. + CLOUD_SQL_INSTANCE_BACKUP_CONFIG = 1; + + // Backup config is Compute Engine Resource Policy. + COMPUTE_ENGINE_RESOURCE_POLICY = 2; + + // Backup config is Google Cloud Backup and DR's Backup Plan. + BACKUPDR_BACKUP_PLAN = 3; + + // Backup config is Google Cloud Backup and DR's Template. + BACKUPDR_TEMPLATE = 4; + } + + // The state tells whether the backup config is active or not. + enum State { + // Backup config state not set. + STATE_UNSPECIFIED = 0; + + // The config is in an active state protecting the resource + ACTIVE = 1; + + // The config is currently not protecting the resource. Either because it is + // disabled or the owning project has been deleted without cleanup of the + // actual resource. + INACTIVE = 2; + + // The config still exists but because of some error state it is not + // protecting the resource. Like the source project is deleted. For eg. + // PlanAssociation, BackupPlan is deleted. + ERROR = 3; + } + + // Output only. The full resource name of the backup config source resource. + // For example, + // "//backupdr.googleapis.com/v1/projects/{project}/locations/{region}/backupPlans/{backupplanId}" + // or + // "//compute.googleapis.com/projects/{project}/locations/{region}/resourcePolicies/{resourcePolicyId}". + string backup_config_source = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The display name of the backup config source resource. + string backup_config_source_display_name = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The type of the backup config resource. + Type type = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The state of the backup config resource. + State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Point in time recovery settings of the backup configuration + // resource. + PitrSettings pitr_settings = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the latest successful backup created via this + // backup configuration. + google.protobuf.Timestamp latest_successful_backup_time = 6 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the resource that is applicable for the backup configuration. Example: + // "//compute.googleapis.com/projects/{project}/zones/{zone}/instances/{instance}" + string applicable_resource = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The [full resource + // name](https://cloud.google.com/asset-inventory/docs/resource-name-format) + // of the backup vault that will store the backups generated through this + // backup configuration. Example: + // "//backupdr.googleapis.com/v1/projects/{project}/locations/{region}/backupVaults/{backupvaultId}" + string backup_vault = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // The locations where the backups are to be stored. + repeated BackupLocation backup_locations = 12; + + // The plan specific config. This depends on the value of + // [BackupConfigDetails.type][google.cloud.backupdr.v1.BackupConfigDetails.type]. + // For type=BACKUPDR_BACKUP_PLAN, backup_dr_plan_config would be populated to + // capture information related to Google Cloud Backup and DR's Backup Plans. + // For type=BACKUPDR_TEMPLATE, backup_dr_template_config would be populated to + // capture information related to Google Cloud Backup and DR's Template + // details. + oneof plan_specific_config { + // Google Cloud Backup and DR's Backup Plan specific data. + BackupDrPlanConfig backup_dr_plan_config = 10; + + // Google Cloud Backup and DR's Template specific data. + BackupDrTemplateConfig backup_dr_template_config = 11; + } +} + +// Point in time recovery settings of the backup configuration resource. +message PitrSettings { + // Output only. Number of days to retain the backup. + int32 retention_days = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// Provides additional information about Google Cloud Backup +// and DR's Template backup configuration. +message BackupDrTemplateConfig { + // Output only. The URI of the BackupDr template resource for the first party + // identity users. + string first_party_management_uri = 1 + [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The URI of the BackupDr template resource for the third party + // identity users. + string third_party_management_uri = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupDrPlanConfig has additional information about Google Cloud Backup and +// DR's Plan backup configuration. +message BackupDrPlanConfig { + // Backup rules of the backup plan resource. + repeated BackupDrPlanRule backup_dr_plan_rules = 1; +} + +// BackupDrPlanRule has rule specific information of the backup plan resource. +message BackupDrPlanRule { + // Output only. Unique Id of the backup rule. + string rule_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. Timestamp of the latest successful backup created via this + // backup rule. + google.protobuf.Timestamp last_successful_backup_time = 2 + [(google.api.field_behavior) = OUTPUT_ONLY]; +} + +// BackupLocation represents a cloud location where a backup can be stored. +message BackupLocation { + // The type of the location. + enum Type { + // Location type is unspecified. + TYPE_UNSPECIFIED = 0; + + // Location type is zonal. + ZONAL = 1; + + // Location type is regional. + REGIONAL = 2; + + // Location type is multi regional. + MULTI_REGIONAL = 3; + } + + // Output only. The type of the location. + Type type = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Output only. The id of the cloud location. Example: "us-central1" + string location_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts b/owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts new file mode 100644 index 00000000000..30f0900de60 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts @@ -0,0 +1,25533 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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 backupdr. */ + namespace backupdr { + + /** Namespace v1. */ + namespace v1 { + + /** Represents a BackupDR */ + class BackupDR extends $protobuf.rpc.Service { + + /** + * Constructs a new BackupDR 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 BackupDR 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): BackupDR; + + /** + * Calls ListManagementServers. + * @param request ListManagementServersRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListManagementServersResponse + */ + public listManagementServers(request: google.cloud.backupdr.v1.IListManagementServersRequest, callback: google.cloud.backupdr.v1.BackupDR.ListManagementServersCallback): void; + + /** + * Calls ListManagementServers. + * @param request ListManagementServersRequest message or plain object + * @returns Promise + */ + public listManagementServers(request: google.cloud.backupdr.v1.IListManagementServersRequest): Promise; + + /** + * Calls GetManagementServer. + * @param request GetManagementServerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ManagementServer + */ + public getManagementServer(request: google.cloud.backupdr.v1.IGetManagementServerRequest, callback: google.cloud.backupdr.v1.BackupDR.GetManagementServerCallback): void; + + /** + * Calls GetManagementServer. + * @param request GetManagementServerRequest message or plain object + * @returns Promise + */ + public getManagementServer(request: google.cloud.backupdr.v1.IGetManagementServerRequest): Promise; + + /** + * Calls CreateManagementServer. + * @param request CreateManagementServerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createManagementServer(request: google.cloud.backupdr.v1.ICreateManagementServerRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateManagementServerCallback): void; + + /** + * Calls CreateManagementServer. + * @param request CreateManagementServerRequest message or plain object + * @returns Promise + */ + public createManagementServer(request: google.cloud.backupdr.v1.ICreateManagementServerRequest): Promise; + + /** + * Calls DeleteManagementServer. + * @param request DeleteManagementServerRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteManagementServer(request: google.cloud.backupdr.v1.IDeleteManagementServerRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteManagementServerCallback): void; + + /** + * Calls DeleteManagementServer. + * @param request DeleteManagementServerRequest message or plain object + * @returns Promise + */ + public deleteManagementServer(request: google.cloud.backupdr.v1.IDeleteManagementServerRequest): Promise; + + /** + * Calls CreateBackupVault. + * @param request CreateBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback): void; + + /** + * Calls CreateBackupVault. + * @param request CreateBackupVaultRequest message or plain object + * @returns Promise + */ + public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest): Promise; + + /** + * Calls ListBackupVaults. + * @param request ListBackupVaultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupVaultsResponse + */ + public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback): void; + + /** + * Calls ListBackupVaults. + * @param request ListBackupVaultsRequest message or plain object + * @returns Promise + */ + public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest): Promise; + + /** + * Calls FetchUsableBackupVaults. + * @param request FetchUsableBackupVaultsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse + */ + public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback): void; + + /** + * Calls FetchUsableBackupVaults. + * @param request FetchUsableBackupVaultsRequest message or plain object + * @returns Promise + */ + public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): Promise; + + /** + * Calls GetBackupVault. + * @param request GetBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupVault + */ + public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback): void; + + /** + * Calls GetBackupVault. + * @param request GetBackupVaultRequest message or plain object + * @returns Promise + */ + public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest): Promise; + + /** + * Calls UpdateBackupVault. + * @param request UpdateBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback): void; + + /** + * Calls UpdateBackupVault. + * @param request UpdateBackupVaultRequest message or plain object + * @returns Promise + */ + public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): Promise; + + /** + * Calls DeleteBackupVault. + * @param request DeleteBackupVaultRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback): void; + + /** + * Calls DeleteBackupVault. + * @param request DeleteBackupVaultRequest message or plain object + * @returns Promise + */ + public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): Promise; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSourcesResponse + */ + public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest, callback: google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback): void; + + /** + * Calls ListDataSources. + * @param request ListDataSourcesRequest message or plain object + * @returns Promise + */ + public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest): Promise; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSource + */ + public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback): void; + + /** + * Calls GetDataSource. + * @param request GetDataSourceRequest message or plain object + * @returns Promise + */ + public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest): Promise; + + /** + * Calls UpdateDataSource. + * @param request UpdateDataSourceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback): void; + + /** + * Calls UpdateDataSource. + * @param request UpdateDataSourceRequest message or plain object + * @returns Promise + */ + public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest): Promise; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupsResponse + */ + public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupsCallback): void; + + /** + * Calls ListBackups. + * @param request ListBackupsRequest message or plain object + * @returns Promise + */ + public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest): Promise; + + /** + * Calls FetchBackupsForResourceType. + * @param request FetchBackupsForResourceTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchBackupsForResourceTypeResponse + */ + public fetchBackupsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceTypeCallback): void; + + /** + * Calls FetchBackupsForResourceType. + * @param request FetchBackupsForResourceTypeRequest message or plain object + * @returns Promise + */ + public fetchBackupsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest): Promise; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Backup + */ + public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupCallback): void; + + /** + * Calls GetBackup. + * @param request GetBackupRequest message or plain object + * @returns Promise + */ + public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest): Promise; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback): void; + + /** + * Calls UpdateBackup. + * @param request UpdateBackupRequest message or plain object + * @returns Promise + */ + public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest): Promise; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback): void; + + /** + * Calls DeleteBackup. + * @param request DeleteBackupRequest message or plain object + * @returns Promise + */ + public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest): Promise; + + /** + * Calls RestoreBackup. + * @param request RestoreBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback): void; + + /** + * Calls RestoreBackup. + * @param request RestoreBackupRequest message or plain object + * @returns Promise + */ + public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest): Promise; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback): void; + + /** + * Calls CreateBackupPlan. + * @param request CreateBackupPlanRequest message or plain object + * @returns Promise + */ + public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest): Promise; + + /** + * Calls UpdateBackupPlan. + * @param request UpdateBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackupPlan(request: google.cloud.backupdr.v1.IUpdateBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanCallback): void; + + /** + * Calls UpdateBackupPlan. + * @param request UpdateBackupPlanRequest message or plain object + * @returns Promise + */ + public updateBackupPlan(request: google.cloud.backupdr.v1.IUpdateBackupPlanRequest): Promise; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlan + */ + public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback): void; + + /** + * Calls GetBackupPlan. + * @param request GetBackupPlanRequest message or plain object + * @returns Promise + */ + public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest): Promise; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlansResponse + */ + public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback): void; + + /** + * Calls ListBackupPlans. + * @param request ListBackupPlansRequest message or plain object + * @returns Promise + */ + public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest): Promise; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback): void; + + /** + * Calls DeleteBackupPlan. + * @param request DeleteBackupPlanRequest message or plain object + * @returns Promise + */ + public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): Promise; + + /** + * Calls GetBackupPlanRevision. + * @param request GetBackupPlanRevisionRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlanRevision + */ + public getBackupPlanRevision(request: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevisionCallback): void; + + /** + * Calls GetBackupPlanRevision. + * @param request GetBackupPlanRevisionRequest message or plain object + * @returns Promise + */ + public getBackupPlanRevision(request: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest): Promise; + + /** + * Calls ListBackupPlanRevisions. + * @param request ListBackupPlanRevisionsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlanRevisionsResponse + */ + public listBackupPlanRevisions(request: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisionsCallback): void; + + /** + * Calls ListBackupPlanRevisions. + * @param request ListBackupPlanRevisionsRequest message or plain object + * @returns Promise + */ + public listBackupPlanRevisions(request: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest): Promise; + + /** + * Calls CreateBackupPlanAssociation. + * @param request CreateBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback): void; + + /** + * Calls CreateBackupPlanAssociation. + * @param request CreateBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): Promise; + + /** + * Calls UpdateBackupPlanAssociation. + * @param request UpdateBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public updateBackupPlanAssociation(request: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociationCallback): void; + + /** + * Calls UpdateBackupPlanAssociation. + * @param request UpdateBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public updateBackupPlanAssociation(request: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest): Promise; + + /** + * Calls GetBackupPlanAssociation. + * @param request GetBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and BackupPlanAssociation + */ + public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback): void; + + /** + * Calls GetBackupPlanAssociation. + * @param request GetBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): Promise; + + /** + * Calls ListBackupPlanAssociations. + * @param request ListBackupPlanAssociationsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse + */ + public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback): void; + + /** + * Calls ListBackupPlanAssociations. + * @param request ListBackupPlanAssociationsRequest message or plain object + * @returns Promise + */ + public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): Promise; + + /** + * Calls FetchBackupPlanAssociationsForResourceType. + * @param request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchBackupPlanAssociationsForResourceTypeResponse + */ + public fetchBackupPlanAssociationsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceTypeCallback): void; + + /** + * Calls FetchBackupPlanAssociationsForResourceType. + * @param request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object + * @returns Promise + */ + public fetchBackupPlanAssociationsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest): Promise; + + /** + * Calls DeleteBackupPlanAssociation. + * @param request DeleteBackupPlanAssociationRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback): void; + + /** + * Calls DeleteBackupPlanAssociation. + * @param request DeleteBackupPlanAssociationRequest message or plain object + * @returns Promise + */ + public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): Promise; + + /** + * Calls TriggerBackup. + * @param request TriggerBackupRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback): void; + + /** + * Calls TriggerBackup. + * @param request TriggerBackupRequest message or plain object + * @returns Promise + */ + public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest): Promise; + + /** + * Calls GetDataSourceReference. + * @param request GetDataSourceReferenceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and DataSourceReference + */ + public getDataSourceReference(request: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, callback: google.cloud.backupdr.v1.BackupDR.GetDataSourceReferenceCallback): void; + + /** + * Calls GetDataSourceReference. + * @param request GetDataSourceReferenceRequest message or plain object + * @returns Promise + */ + public getDataSourceReference(request: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest): Promise; + + /** + * Calls ListDataSourceReferences. + * @param request ListDataSourceReferencesRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListDataSourceReferencesResponse + */ + public listDataSourceReferences(request: google.cloud.backupdr.v1.IListDataSourceReferencesRequest, callback: google.cloud.backupdr.v1.BackupDR.ListDataSourceReferencesCallback): void; + + /** + * Calls ListDataSourceReferences. + * @param request ListDataSourceReferencesRequest message or plain object + * @returns Promise + */ + public listDataSourceReferences(request: google.cloud.backupdr.v1.IListDataSourceReferencesRequest): Promise; + + /** + * Calls FetchDataSourceReferencesForResourceType. + * @param request FetchDataSourceReferencesForResourceTypeRequest message or plain object + * @param callback Node-style callback called with the error, if any, and FetchDataSourceReferencesForResourceTypeResponse + */ + public fetchDataSourceReferencesForResourceType(request: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceTypeCallback): void; + + /** + * Calls FetchDataSourceReferencesForResourceType. + * @param request FetchDataSourceReferencesForResourceTypeRequest message or plain object + * @returns Promise + */ + public fetchDataSourceReferencesForResourceType(request: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest): Promise; + + /** + * Calls InitializeService. + * @param request InitializeServiceRequest message or plain object + * @param callback Node-style callback called with the error, if any, and Operation + */ + public initializeService(request: google.cloud.backupdr.v1.IInitializeServiceRequest, callback: google.cloud.backupdr.v1.BackupDR.InitializeServiceCallback): void; + + /** + * Calls InitializeService. + * @param request InitializeServiceRequest message or plain object + * @returns Promise + */ + public initializeService(request: google.cloud.backupdr.v1.IInitializeServiceRequest): Promise; + } + + namespace BackupDR { + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. + * @param error Error, if any + * @param [response] ListManagementServersResponse + */ + type ListManagementServersCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListManagementServersResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. + * @param error Error, if any + * @param [response] ManagementServer + */ + type GetManagementServerCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ManagementServer) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. + * @param error Error, if any + * @param [response] ListBackupVaultsResponse + */ + type ListBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupVaultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. + * @param error Error, if any + * @param [response] FetchUsableBackupVaultsResponse + */ + type FetchUsableBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. + * @param error Error, if any + * @param [response] BackupVault + */ + type GetBackupVaultCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupVault) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. + * @param error Error, if any + * @param [response] ListDataSourcesResponse + */ + type ListDataSourcesCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListDataSourcesResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. + * @param error Error, if any + * @param [response] DataSource + */ + type GetDataSourceCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.DataSource) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateDataSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. + * @param error Error, if any + * @param [response] ListBackupsResponse + */ + type ListBackupsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupsForResourceType}. + * @param error Error, if any + * @param [response] FetchBackupsForResourceTypeResponse + */ + type FetchBackupsForResourceTypeCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. + * @param error Error, if any + * @param [response] Backup + */ + type GetBackupCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.Backup) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type RestoreBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. + * @param error Error, if any + * @param [response] BackupPlan + */ + type GetBackupPlanCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlan) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. + * @param error Error, if any + * @param [response] ListBackupPlansResponse + */ + type ListBackupPlansCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlansResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanRevision}. + * @param error Error, if any + * @param [response] BackupPlanRevision + */ + type GetBackupPlanRevisionCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlanRevision) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanRevisions}. + * @param error Error, if any + * @param [response] ListBackupPlanRevisionsResponse + */ + type ListBackupPlanRevisionsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type CreateBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type UpdateBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. + * @param error Error, if any + * @param [response] BackupPlanAssociation + */ + type GetBackupPlanAssociationCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlanAssociation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. + * @param error Error, if any + * @param [response] ListBackupPlanAssociationsResponse + */ + type ListBackupPlanAssociationsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupPlanAssociationsForResourceType}. + * @param error Error, if any + * @param [response] FetchBackupPlanAssociationsForResourceTypeResponse + */ + type FetchBackupPlanAssociationsForResourceTypeCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. + * @param error Error, if any + * @param [response] Operation + */ + type DeleteBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. + * @param error Error, if any + * @param [response] Operation + */ + type TriggerBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSourceReference}. + * @param error Error, if any + * @param [response] DataSourceReference + */ + type GetDataSourceReferenceCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.DataSourceReference) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSourceReferences}. + * @param error Error, if any + * @param [response] ListDataSourceReferencesResponse + */ + type ListDataSourceReferencesCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListDataSourceReferencesResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchDataSourceReferencesForResourceType}. + * @param error Error, if any + * @param [response] FetchDataSourceReferencesForResourceTypeResponse + */ + type FetchDataSourceReferencesForResourceTypeCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse) => void; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|initializeService}. + * @param error Error, if any + * @param [response] Operation + */ + type InitializeServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; + } + + /** Properties of a NetworkConfig. */ + interface INetworkConfig { + + /** NetworkConfig network */ + network?: (string|null); + + /** NetworkConfig peeringMode */ + peeringMode?: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null); + } + + /** Represents a NetworkConfig. */ + class NetworkConfig implements INetworkConfig { + + /** + * Constructs a new NetworkConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkConfig); + + /** NetworkConfig network. */ + public network: string; + + /** NetworkConfig peeringMode. */ + public peeringMode: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode); + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.INetworkConfig): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @param message NetworkConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Verifies a NetworkConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkConfig; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @param message NetworkConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkConfig { + + /** PeeringMode enum. */ + enum PeeringMode { + PEERING_MODE_UNSPECIFIED = 0, + PRIVATE_SERVICE_ACCESS = 1 + } + } + + /** Properties of a ManagementURI. */ + interface IManagementURI { + + /** ManagementURI webUi */ + webUi?: (string|null); + + /** ManagementURI api */ + api?: (string|null); + } + + /** Represents a ManagementURI. */ + class ManagementURI implements IManagementURI { + + /** + * Constructs a new ManagementURI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IManagementURI); + + /** ManagementURI webUi. */ + public webUi: string; + + /** ManagementURI api. */ + public api: string; + + /** + * Creates a new ManagementURI instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagementURI instance + */ + public static create(properties?: google.cloud.backupdr.v1.IManagementURI): google.cloud.backupdr.v1.ManagementURI; + + /** + * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @param message ManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @param message ManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementURI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementURI; + + /** + * Decodes a ManagementURI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementURI; + + /** + * Verifies a ManagementURI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementURI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementURI; + + /** + * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. + * @param message ManagementURI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementURI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementURI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkforceIdentityBasedManagementURI. */ + interface IWorkforceIdentityBasedManagementURI { + + /** WorkforceIdentityBasedManagementURI firstPartyManagementUri */ + firstPartyManagementUri?: (string|null); + + /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri */ + thirdPartyManagementUri?: (string|null); + } + + /** Represents a WorkforceIdentityBasedManagementURI. */ + class WorkforceIdentityBasedManagementURI implements IWorkforceIdentityBasedManagementURI { + + /** + * Constructs a new WorkforceIdentityBasedManagementURI. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI); + + /** WorkforceIdentityBasedManagementURI firstPartyManagementUri. */ + public firstPartyManagementUri: string; + + /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri. */ + public thirdPartyManagementUri: string; + + /** + * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkforceIdentityBasedManagementURI instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @param message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Verifies a WorkforceIdentityBasedManagementURI message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkforceIdentityBasedManagementURI + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; + + /** + * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. + * @param message WorkforceIdentityBasedManagementURI + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkforceIdentityBasedManagementURI to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkforceIdentityBasedManagementURI + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WorkforceIdentityBasedOAuth2ClientID. */ + interface IWorkforceIdentityBasedOAuth2ClientID { + + /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId */ + firstPartyOauth2ClientId?: (string|null); + + /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId */ + thirdPartyOauth2ClientId?: (string|null); + } + + /** Represents a WorkforceIdentityBasedOAuth2ClientID. */ + class WorkforceIdentityBasedOAuth2ClientID implements IWorkforceIdentityBasedOAuth2ClientID { + + /** + * Constructs a new WorkforceIdentityBasedOAuth2ClientID. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID); + + /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. */ + public firstPartyOauth2ClientId: string; + + /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. */ + public thirdPartyOauth2ClientId: string; + + /** + * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. + * @param [properties] Properties to set + * @returns WorkforceIdentityBasedOAuth2ClientID instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Verifies a WorkforceIdentityBasedOAuth2ClientID message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WorkforceIdentityBasedOAuth2ClientID + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; + + /** + * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. + * @param message WorkforceIdentityBasedOAuth2ClientID + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ManagementServer. */ + interface IManagementServer { + + /** ManagementServer name */ + name?: (string|null); + + /** ManagementServer description */ + description?: (string|null); + + /** ManagementServer labels */ + labels?: ({ [k: string]: string }|null); + + /** ManagementServer createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer type */ + type?: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType|null); + + /** ManagementServer managementUri */ + managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); + + /** ManagementServer workforceIdentityBasedManagementUri */ + workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); + + /** ManagementServer state */ + state?: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState|null); + + /** ManagementServer networks */ + networks?: (google.cloud.backupdr.v1.INetworkConfig[]|null); + + /** ManagementServer etag */ + etag?: (string|null); + + /** ManagementServer oauth2ClientId */ + oauth2ClientId?: (string|null); + + /** ManagementServer workforceIdentityBasedOauth2ClientId */ + workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + + /** ManagementServer baProxyUri */ + baProxyUri?: (string[]|null); + + /** ManagementServer satisfiesPzs */ + satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi */ + satisfiesPzi?: (boolean|null); + } + + /** Represents a ManagementServer. */ + class ManagementServer implements IManagementServer { + + /** + * Constructs a new ManagementServer. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IManagementServer); + + /** ManagementServer name. */ + public name: string; + + /** ManagementServer description. */ + public description: string; + + /** ManagementServer labels. */ + public labels: { [k: string]: string }; + + /** ManagementServer createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** ManagementServer type. */ + public type: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType); + + /** ManagementServer managementUri. */ + public managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); + + /** ManagementServer workforceIdentityBasedManagementUri. */ + public workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); + + /** ManagementServer state. */ + public state: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState); + + /** ManagementServer networks. */ + public networks: google.cloud.backupdr.v1.INetworkConfig[]; + + /** ManagementServer etag. */ + public etag: string; + + /** ManagementServer oauth2ClientId. */ + public oauth2ClientId: string; + + /** ManagementServer workforceIdentityBasedOauth2ClientId. */ + public workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); + + /** ManagementServer baProxyUri. */ + public baProxyUri: string[]; + + /** ManagementServer satisfiesPzs. */ + public satisfiesPzs?: (google.protobuf.IBoolValue|null); + + /** ManagementServer satisfiesPzi. */ + public satisfiesPzi: boolean; + + /** + * Creates a new ManagementServer instance using the specified properties. + * @param [properties] Properties to set + * @returns ManagementServer instance + */ + public static create(properties?: google.cloud.backupdr.v1.IManagementServer): google.cloud.backupdr.v1.ManagementServer; + + /** + * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @param message ManagementServer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @param message ManagementServer message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ManagementServer message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementServer; + + /** + * Decodes a ManagementServer message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementServer; + + /** + * Verifies a ManagementServer message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ManagementServer + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementServer; + + /** + * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. + * @param message ManagementServer + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ManagementServer, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ManagementServer to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ManagementServer + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ManagementServer { + + /** InstanceType enum. */ + enum InstanceType { + INSTANCE_TYPE_UNSPECIFIED = 0, + BACKUP_RESTORE = 1 + } + + /** InstanceState enum. */ + enum InstanceState { + INSTANCE_STATE_UNSPECIFIED = 0, + CREATING = 1, + READY = 2, + UPDATING = 3, + DELETING = 4, + REPAIRING = 5, + MAINTENANCE = 6, + ERROR = 7 + } + } + + /** Properties of a ListManagementServersRequest. */ + interface IListManagementServersRequest { + + /** ListManagementServersRequest parent */ + parent?: (string|null); + + /** ListManagementServersRequest pageSize */ + pageSize?: (number|null); + + /** ListManagementServersRequest pageToken */ + pageToken?: (string|null); + + /** ListManagementServersRequest filter */ + filter?: (string|null); + + /** ListManagementServersRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListManagementServersRequest. */ + class ListManagementServersRequest implements IListManagementServersRequest { + + /** + * Constructs a new ListManagementServersRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListManagementServersRequest); + + /** ListManagementServersRequest parent. */ + public parent: string; + + /** ListManagementServersRequest pageSize. */ + public pageSize: number; + + /** ListManagementServersRequest pageToken. */ + public pageToken: string; + + /** ListManagementServersRequest filter. */ + public filter?: (string|null); + + /** ListManagementServersRequest orderBy. */ + public orderBy?: (string|null); + + /** + * Creates a new ListManagementServersRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagementServersRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListManagementServersRequest): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @param message ListManagementServersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @param message ListManagementServersRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Verifies a ListManagementServersRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagementServersRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersRequest; + + /** + * Creates a plain object from a ListManagementServersRequest message. Also converts values to other types if specified. + * @param message ListManagementServersRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListManagementServersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagementServersRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagementServersRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListManagementServersResponse. */ + interface IListManagementServersResponse { + + /** ListManagementServersResponse managementServers */ + managementServers?: (google.cloud.backupdr.v1.IManagementServer[]|null); + + /** ListManagementServersResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListManagementServersResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListManagementServersResponse. */ + class ListManagementServersResponse implements IListManagementServersResponse { + + /** + * Constructs a new ListManagementServersResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListManagementServersResponse); + + /** ListManagementServersResponse managementServers. */ + public managementServers: google.cloud.backupdr.v1.IManagementServer[]; + + /** ListManagementServersResponse nextPageToken. */ + public nextPageToken: string; + + /** ListManagementServersResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListManagementServersResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListManagementServersResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListManagementServersResponse): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @param message ListManagementServersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @param message ListManagementServersResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Verifies a ListManagementServersResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListManagementServersResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersResponse; + + /** + * Creates a plain object from a ListManagementServersResponse message. Also converts values to other types if specified. + * @param message ListManagementServersResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListManagementServersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListManagementServersResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListManagementServersResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetManagementServerRequest. */ + interface IGetManagementServerRequest { + + /** GetManagementServerRequest name */ + name?: (string|null); + } + + /** Represents a GetManagementServerRequest. */ + class GetManagementServerRequest implements IGetManagementServerRequest { + + /** + * Constructs a new GetManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest); + + /** GetManagementServerRequest name. */ + public name: string; + + /** + * Creates a new GetManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @param message GetManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @param message GetManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Verifies a GetManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetManagementServerRequest; + + /** + * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. + * @param message GetManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CreateManagementServerRequest. */ + interface ICreateManagementServerRequest { + + /** CreateManagementServerRequest parent */ + parent?: (string|null); + + /** CreateManagementServerRequest managementServerId */ + managementServerId?: (string|null); + + /** CreateManagementServerRequest managementServer */ + managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + + /** CreateManagementServerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateManagementServerRequest. */ + class CreateManagementServerRequest implements ICreateManagementServerRequest { + + /** + * Constructs a new CreateManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest); + + /** CreateManagementServerRequest parent. */ + public parent: string; + + /** CreateManagementServerRequest managementServerId. */ + public managementServerId: string; + + /** CreateManagementServerRequest managementServer. */ + public managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); + + /** CreateManagementServerRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @param message CreateManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @param message CreateManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Verifies a CreateManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateManagementServerRequest; + + /** + * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. + * @param message CreateManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteManagementServerRequest. */ + interface IDeleteManagementServerRequest { + + /** DeleteManagementServerRequest name */ + name?: (string|null); + + /** DeleteManagementServerRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteManagementServerRequest. */ + class DeleteManagementServerRequest implements IDeleteManagementServerRequest { + + /** + * Constructs a new DeleteManagementServerRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest); + + /** DeleteManagementServerRequest name. */ + public name: string; + + /** DeleteManagementServerRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteManagementServerRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteManagementServerRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @param message DeleteManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @param message DeleteManagementServerRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Verifies a DeleteManagementServerRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteManagementServerRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteManagementServerRequest; + + /** + * Creates a plain object from a DeleteManagementServerRequest message. Also converts values to other types if specified. + * @param message DeleteManagementServerRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteManagementServerRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteManagementServerRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InitializeServiceRequest. */ + interface IInitializeServiceRequest { + + /** InitializeServiceRequest name */ + name?: (string|null); + + /** InitializeServiceRequest resourceType */ + resourceType?: (string|null); + + /** InitializeServiceRequest requestId */ + requestId?: (string|null); + + /** InitializeServiceRequest cloudSqlInstanceInitializationConfig */ + cloudSqlInstanceInitializationConfig?: (google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null); + } + + /** Represents an InitializeServiceRequest. */ + class InitializeServiceRequest implements IInitializeServiceRequest { + + /** + * Constructs a new InitializeServiceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IInitializeServiceRequest); + + /** InitializeServiceRequest name. */ + public name: string; + + /** InitializeServiceRequest resourceType. */ + public resourceType: string; + + /** InitializeServiceRequest requestId. */ + public requestId: string; + + /** InitializeServiceRequest cloudSqlInstanceInitializationConfig. */ + public cloudSqlInstanceInitializationConfig?: (google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null); + + /** InitializeServiceRequest initializationConfig. */ + public initializationConfig?: "cloudSqlInstanceInitializationConfig"; + + /** + * Creates a new InitializeServiceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeServiceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IInitializeServiceRequest): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Encodes the specified InitializeServiceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @param message InitializeServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IInitializeServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeServiceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @param message InitializeServiceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IInitializeServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Verifies an InitializeServiceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeServiceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeServiceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InitializeServiceRequest; + + /** + * Creates a plain object from an InitializeServiceRequest message. Also converts values to other types if specified. + * @param message InitializeServiceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.InitializeServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeServiceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeServiceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InitializeServiceResponse. */ + interface IInitializeServiceResponse { + + /** InitializeServiceResponse backupVaultName */ + backupVaultName?: (string|null); + + /** InitializeServiceResponse backupPlanName */ + backupPlanName?: (string|null); + } + + /** Represents an InitializeServiceResponse. */ + class InitializeServiceResponse implements IInitializeServiceResponse { + + /** + * Constructs a new InitializeServiceResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IInitializeServiceResponse); + + /** InitializeServiceResponse backupVaultName. */ + public backupVaultName: string; + + /** InitializeServiceResponse backupPlanName. */ + public backupPlanName: string; + + /** + * Creates a new InitializeServiceResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeServiceResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IInitializeServiceResponse): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Encodes the specified InitializeServiceResponse message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @param message InitializeServiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IInitializeServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeServiceResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @param message InitializeServiceResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IInitializeServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Verifies an InitializeServiceResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeServiceResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeServiceResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InitializeServiceResponse; + + /** + * Creates a plain object from an InitializeServiceResponse message. Also converts values to other types if specified. + * @param message InitializeServiceResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.InitializeServiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeServiceResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeServiceResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an OperationMetadata. */ + interface IOperationMetadata { + + /** OperationMetadata createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime */ + endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target */ + target?: (string|null); + + /** OperationMetadata verb */ + verb?: (string|null); + + /** OperationMetadata statusMessage */ + statusMessage?: (string|null); + + /** OperationMetadata requestedCancellation */ + requestedCancellation?: (boolean|null); + + /** OperationMetadata apiVersion */ + apiVersion?: (string|null); + + /** OperationMetadata additionalInfo */ + additionalInfo?: ({ [k: string]: string }|null); + } + + /** Represents an OperationMetadata. */ + class OperationMetadata implements IOperationMetadata { + + /** + * Constructs a new OperationMetadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IOperationMetadata); + + /** OperationMetadata createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata endTime. */ + public endTime?: (google.protobuf.ITimestamp|null); + + /** OperationMetadata target. */ + public target: string; + + /** OperationMetadata verb. */ + public verb: string; + + /** OperationMetadata statusMessage. */ + public statusMessage: string; + + /** OperationMetadata requestedCancellation. */ + public requestedCancellation: boolean; + + /** OperationMetadata apiVersion. */ + public apiVersion: string; + + /** OperationMetadata additionalInfo. */ + public additionalInfo: { [k: string]: string }; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @param [properties] Properties to set + * @returns OperationMetadata instance + */ + public static create(properties?: google.cloud.backupdr.v1.IOperationMetadata): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @param message OperationMetadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Verifies an OperationMetadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OperationMetadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.OperationMetadata; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @param message OperationMetadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OperationMetadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OperationMetadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlan. */ + interface IBackupPlan { + + /** BackupPlan name */ + name?: (string|null); + + /** BackupPlan description */ + description?: (string|null); + + /** BackupPlan labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupPlan createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan backupRules */ + backupRules?: (google.cloud.backupdr.v1.IBackupRule[]|null); + + /** BackupPlan state */ + state?: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State|null); + + /** BackupPlan resourceType */ + resourceType?: (string|null); + + /** BackupPlan etag */ + etag?: (string|null); + + /** BackupPlan backupVault */ + backupVault?: (string|null); + + /** BackupPlan backupVaultServiceAccount */ + backupVaultServiceAccount?: (string|null); + + /** BackupPlan logRetentionDays */ + logRetentionDays?: (number|Long|string|null); + + /** BackupPlan supportedResourceTypes */ + supportedResourceTypes?: (string[]|null); + + /** BackupPlan revisionId */ + revisionId?: (string|null); + + /** BackupPlan revisionName */ + revisionName?: (string|null); + } + + /** Represents a BackupPlan. */ + class BackupPlan implements IBackupPlan { + + /** + * Constructs a new BackupPlan. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlan); + + /** BackupPlan name. */ + public name: string; + + /** BackupPlan description. */ + public description: string; + + /** BackupPlan labels. */ + public labels: { [k: string]: string }; + + /** BackupPlan createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlan backupRules. */ + public backupRules: google.cloud.backupdr.v1.IBackupRule[]; + + /** BackupPlan state. */ + public state: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State); + + /** BackupPlan resourceType. */ + public resourceType: string; + + /** BackupPlan etag. */ + public etag: string; + + /** BackupPlan backupVault. */ + public backupVault: string; + + /** BackupPlan backupVaultServiceAccount. */ + public backupVaultServiceAccount: string; + + /** BackupPlan logRetentionDays. */ + public logRetentionDays: (number|Long|string); + + /** BackupPlan supportedResourceTypes. */ + public supportedResourceTypes: string[]; + + /** BackupPlan revisionId. */ + public revisionId: string; + + /** BackupPlan revisionName. */ + public revisionName: string; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlan instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlan): google.cloud.backupdr.v1.BackupPlan; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @param message BackupPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @param message BackupPlan message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlan message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlan; + + /** + * Decodes a BackupPlan message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlan; + + /** + * Verifies a BackupPlan message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlan + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlan; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @param message BackupPlan + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlan to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlan + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlan { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4, + UPDATING = 5 + } + } + + /** Properties of a BackupRule. */ + interface IBackupRule { + + /** BackupRule ruleId */ + ruleId?: (string|null); + + /** BackupRule backupRetentionDays */ + backupRetentionDays?: (number|null); + + /** BackupRule standardSchedule */ + standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); + } + + /** Represents a BackupRule. */ + class BackupRule implements IBackupRule { + + /** + * Constructs a new BackupRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupRule); + + /** BackupRule ruleId. */ + public ruleId: string; + + /** BackupRule backupRetentionDays. */ + public backupRetentionDays: number; + + /** BackupRule standardSchedule. */ + public standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); + + /** BackupRule backupScheduleOneof. */ + public backupScheduleOneof?: "standardSchedule"; + + /** + * Creates a new BackupRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupRule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupRule): google.cloud.backupdr.v1.BackupRule; + + /** + * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @param message BackupRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @param message BackupRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupRule; + + /** + * Decodes a BackupRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupRule; + + /** + * Verifies a BackupRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupRule; + + /** + * Creates a plain object from a BackupRule message. Also converts values to other types if specified. + * @param message BackupRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a StandardSchedule. */ + interface IStandardSchedule { + + /** StandardSchedule recurrenceType */ + recurrenceType?: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null); + + /** StandardSchedule hourlyFrequency */ + hourlyFrequency?: (number|null); + + /** StandardSchedule daysOfWeek */ + daysOfWeek?: (google.type.DayOfWeek[]|null); + + /** StandardSchedule daysOfMonth */ + daysOfMonth?: (number[]|null); + + /** StandardSchedule weekDayOfMonth */ + weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); + + /** StandardSchedule months */ + months?: (google.type.Month[]|null); + + /** StandardSchedule backupWindow */ + backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); + + /** StandardSchedule timeZone */ + timeZone?: (string|null); + } + + /** Represents a StandardSchedule. */ + class StandardSchedule implements IStandardSchedule { + + /** + * Constructs a new StandardSchedule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IStandardSchedule); + + /** StandardSchedule recurrenceType. */ + public recurrenceType: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType); + + /** StandardSchedule hourlyFrequency. */ + public hourlyFrequency: number; + + /** StandardSchedule daysOfWeek. */ + public daysOfWeek: google.type.DayOfWeek[]; + + /** StandardSchedule daysOfMonth. */ + public daysOfMonth: number[]; + + /** StandardSchedule weekDayOfMonth. */ + public weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); + + /** StandardSchedule months. */ + public months: google.type.Month[]; + + /** StandardSchedule backupWindow. */ + public backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); + + /** StandardSchedule timeZone. */ + public timeZone: string; + + /** + * Creates a new StandardSchedule instance using the specified properties. + * @param [properties] Properties to set + * @returns StandardSchedule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IStandardSchedule): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @param message StandardSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @param message StandardSchedule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Verifies a StandardSchedule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns StandardSchedule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.StandardSchedule; + + /** + * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. + * @param message StandardSchedule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.StandardSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this StandardSchedule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for StandardSchedule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace StandardSchedule { + + /** RecurrenceType enum. */ + enum RecurrenceType { + RECURRENCE_TYPE_UNSPECIFIED = 0, + HOURLY = 1, + DAILY = 2, + WEEKLY = 3, + MONTHLY = 4, + YEARLY = 5 + } + } + + /** Properties of a BackupWindow. */ + interface IBackupWindow { + + /** BackupWindow startHourOfDay */ + startHourOfDay?: (number|null); + + /** BackupWindow endHourOfDay */ + endHourOfDay?: (number|null); + } + + /** Represents a BackupWindow. */ + class BackupWindow implements IBackupWindow { + + /** + * Constructs a new BackupWindow. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupWindow); + + /** BackupWindow startHourOfDay. */ + public startHourOfDay: number; + + /** BackupWindow endHourOfDay. */ + public endHourOfDay: number; + + /** + * Creates a new BackupWindow instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupWindow instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupWindow): google.cloud.backupdr.v1.BackupWindow; + + /** + * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @param message BackupWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @param message BackupWindow message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupWindow message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupWindow; + + /** + * Decodes a BackupWindow message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupWindow; + + /** + * Verifies a BackupWindow message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupWindow + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupWindow; + + /** + * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. + * @param message BackupWindow + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupWindow to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupWindow + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a WeekDayOfMonth. */ + interface IWeekDayOfMonth { + + /** WeekDayOfMonth weekOfMonth */ + weekOfMonth?: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null); + + /** WeekDayOfMonth dayOfWeek */ + dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); + } + + /** Represents a WeekDayOfMonth. */ + class WeekDayOfMonth implements IWeekDayOfMonth { + + /** + * Constructs a new WeekDayOfMonth. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth); + + /** WeekDayOfMonth weekOfMonth. */ + public weekOfMonth: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth); + + /** WeekDayOfMonth dayOfWeek. */ + public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @param [properties] Properties to set + * @returns WeekDayOfMonth instance + */ + public static create(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @param message WeekDayOfMonth message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Verifies a WeekDayOfMonth message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns WeekDayOfMonth + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WeekDayOfMonth; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @param message WeekDayOfMonth + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.WeekDayOfMonth, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for WeekDayOfMonth + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace WeekDayOfMonth { + + /** WeekOfMonth enum. */ + enum WeekOfMonth { + WEEK_OF_MONTH_UNSPECIFIED = 0, + FIRST = 1, + SECOND = 2, + THIRD = 3, + FOURTH = 4, + LAST = 5 + } + } + + /** Properties of a CreateBackupPlanRequest. */ + interface ICreateBackupPlanRequest { + + /** CreateBackupPlanRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanRequest backupPlanId */ + backupPlanId?: (string|null); + + /** CreateBackupPlanRequest backupPlan */ + backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBackupPlanRequest. */ + class CreateBackupPlanRequest implements ICreateBackupPlanRequest { + + /** + * Constructs a new CreateBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest); + + /** CreateBackupPlanRequest parent. */ + public parent: string; + + /** CreateBackupPlanRequest backupPlanId. */ + public backupPlanId: string; + + /** CreateBackupPlanRequest backupPlan. */ + public backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** CreateBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @param message CreateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @param message CreateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Verifies a CreateBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanRequest; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @param message CreateBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlansRequest. */ + interface IListBackupPlansRequest { + + /** ListBackupPlansRequest parent */ + parent?: (string|null); + + /** ListBackupPlansRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlansRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupPlansRequest filter */ + filter?: (string|null); + + /** ListBackupPlansRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListBackupPlansRequest. */ + class ListBackupPlansRequest implements IListBackupPlansRequest { + + /** + * Constructs a new ListBackupPlansRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest); + + /** ListBackupPlansRequest parent. */ + public parent: string; + + /** ListBackupPlansRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlansRequest pageToken. */ + public pageToken: string; + + /** ListBackupPlansRequest filter. */ + public filter: string; + + /** ListBackupPlansRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlansRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @param message ListBackupPlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @param message ListBackupPlansRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Verifies a ListBackupPlansRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlansRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansRequest; + + /** + * Creates a plain object from a ListBackupPlansRequest message. Also converts values to other types if specified. + * @param message ListBackupPlansRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlansRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlansRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlansResponse. */ + interface IListBackupPlansResponse { + + /** ListBackupPlansResponse backupPlans */ + backupPlans?: (google.cloud.backupdr.v1.IBackupPlan[]|null); + + /** ListBackupPlansResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlansResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlansResponse. */ + class ListBackupPlansResponse implements IListBackupPlansResponse { + + /** + * Constructs a new ListBackupPlansResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse); + + /** ListBackupPlansResponse backupPlans. */ + public backupPlans: google.cloud.backupdr.v1.IBackupPlan[]; + + /** ListBackupPlansResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlansResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlansResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @param message ListBackupPlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @param message ListBackupPlansResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Verifies a ListBackupPlansResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlansResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansResponse; + + /** + * Creates a plain object from a ListBackupPlansResponse message. Also converts values to other types if specified. + * @param message ListBackupPlansResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlansResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlansResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupPlanRequest. */ + interface IGetBackupPlanRequest { + + /** GetBackupPlanRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanRequest. */ + class GetBackupPlanRequest implements IGetBackupPlanRequest { + + /** + * Constructs a new GetBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest); + + /** GetBackupPlanRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @param message GetBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @param message GetBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Verifies a GetBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanRequest; + + /** + * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupPlanRequest. */ + interface IDeleteBackupPlanRequest { + + /** DeleteBackupPlanRequest name */ + name?: (string|null); + + /** DeleteBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupPlanRequest. */ + class DeleteBackupPlanRequest implements IDeleteBackupPlanRequest { + + /** + * Constructs a new DeleteBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest); + + /** DeleteBackupPlanRequest name. */ + public name: string; + + /** DeleteBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @param message DeleteBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @param message DeleteBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Verifies a DeleteBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanRequest; + + /** + * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @param message DeleteBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupPlanRequest. */ + interface IUpdateBackupPlanRequest { + + /** UpdateBackupPlanRequest backupPlan */ + backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** UpdateBackupPlanRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupPlanRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackupPlanRequest. */ + class UpdateBackupPlanRequest implements IUpdateBackupPlanRequest { + + /** + * Constructs a new UpdateBackupPlanRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanRequest); + + /** UpdateBackupPlanRequest backupPlan. */ + public backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** UpdateBackupPlanRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupPlanRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateBackupPlanRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupPlanRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanRequest): google.cloud.backupdr.v1.UpdateBackupPlanRequest; + + /** + * Encodes the specified UpdateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. + * @param message UpdateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. + * @param message UpdateBackupPlanRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupPlanRequest; + + /** + * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupPlanRequest; + + /** + * Verifies an UpdateBackupPlanRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupPlanRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupPlanRequest; + + /** + * Creates a plain object from an UpdateBackupPlanRequest message. Also converts values to other types if specified. + * @param message UpdateBackupPlanRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupPlanRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupPlanRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlanRevision. */ + interface IBackupPlanRevision { + + /** BackupPlanRevision name */ + name?: (string|null); + + /** BackupPlanRevision revisionId */ + revisionId?: (string|null); + + /** BackupPlanRevision state */ + state?: (google.cloud.backupdr.v1.BackupPlanRevision.State|keyof typeof google.cloud.backupdr.v1.BackupPlanRevision.State|null); + + /** BackupPlanRevision backupPlanSnapshot */ + backupPlanSnapshot?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** BackupPlanRevision createTime */ + createTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupPlanRevision. */ + class BackupPlanRevision implements IBackupPlanRevision { + + /** + * Constructs a new BackupPlanRevision. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlanRevision); + + /** BackupPlanRevision name. */ + public name: string; + + /** BackupPlanRevision revisionId. */ + public revisionId: string; + + /** BackupPlanRevision state. */ + public state: (google.cloud.backupdr.v1.BackupPlanRevision.State|keyof typeof google.cloud.backupdr.v1.BackupPlanRevision.State); + + /** BackupPlanRevision backupPlanSnapshot. */ + public backupPlanSnapshot?: (google.cloud.backupdr.v1.IBackupPlan|null); + + /** BackupPlanRevision createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BackupPlanRevision instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlanRevision instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlanRevision): google.cloud.backupdr.v1.BackupPlanRevision; + + /** + * Encodes the specified BackupPlanRevision message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. + * @param message BackupPlanRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlanRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlanRevision message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. + * @param message BackupPlanRevision message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlanRevision, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlanRevision message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlanRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlanRevision; + + /** + * Decodes a BackupPlanRevision message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlanRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlanRevision; + + /** + * Verifies a BackupPlanRevision message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlanRevision message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlanRevision + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlanRevision; + + /** + * Creates a plain object from a BackupPlanRevision message. Also converts values to other types if specified. + * @param message BackupPlanRevision + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlanRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlanRevision to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlanRevision + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlanRevision { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4 + } + } + + /** Properties of a GetBackupPlanRevisionRequest. */ + interface IGetBackupPlanRevisionRequest { + + /** GetBackupPlanRevisionRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanRevisionRequest. */ + class GetBackupPlanRevisionRequest implements IGetBackupPlanRevisionRequest { + + /** + * Constructs a new GetBackupPlanRevisionRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest); + + /** GetBackupPlanRevisionRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanRevisionRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanRevisionRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; + + /** + * Encodes the specified GetBackupPlanRevisionRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. + * @param message GetBackupPlanRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. + * @param message GetBackupPlanRevisionRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanRevisionRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; + + /** + * Decodes a GetBackupPlanRevisionRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; + + /** + * Verifies a GetBackupPlanRevisionRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanRevisionRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; + + /** + * Creates a plain object from a GetBackupPlanRevisionRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanRevisionRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanRevisionRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanRevisionRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanRevisionsRequest. */ + interface IListBackupPlanRevisionsRequest { + + /** ListBackupPlanRevisionsRequest parent */ + parent?: (string|null); + + /** ListBackupPlanRevisionsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlanRevisionsRequest pageToken */ + pageToken?: (string|null); + } + + /** Represents a ListBackupPlanRevisionsRequest. */ + class ListBackupPlanRevisionsRequest implements IListBackupPlanRevisionsRequest { + + /** + * Constructs a new ListBackupPlanRevisionsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest); + + /** ListBackupPlanRevisionsRequest parent. */ + public parent: string; + + /** ListBackupPlanRevisionsRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlanRevisionsRequest pageToken. */ + public pageToken: string; + + /** + * Creates a new ListBackupPlanRevisionsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanRevisionsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; + + /** + * Encodes the specified ListBackupPlanRevisionsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. + * @param message ListBackupPlanRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. + * @param message ListBackupPlanRevisionsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanRevisionsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; + + /** + * Decodes a ListBackupPlanRevisionsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; + + /** + * Verifies a ListBackupPlanRevisionsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanRevisionsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; + + /** + * Creates a plain object from a ListBackupPlanRevisionsRequest message. Also converts values to other types if specified. + * @param message ListBackupPlanRevisionsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanRevisionsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanRevisionsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanRevisionsResponse. */ + interface IListBackupPlanRevisionsResponse { + + /** ListBackupPlanRevisionsResponse backupPlanRevisions */ + backupPlanRevisions?: (google.cloud.backupdr.v1.IBackupPlanRevision[]|null); + + /** ListBackupPlanRevisionsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlanRevisionsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlanRevisionsResponse. */ + class ListBackupPlanRevisionsResponse implements IListBackupPlanRevisionsResponse { + + /** + * Constructs a new ListBackupPlanRevisionsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse); + + /** ListBackupPlanRevisionsResponse backupPlanRevisions. */ + public backupPlanRevisions: google.cloud.backupdr.v1.IBackupPlanRevision[]; + + /** ListBackupPlanRevisionsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlanRevisionsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlanRevisionsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanRevisionsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; + + /** + * Encodes the specified ListBackupPlanRevisionsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. + * @param message ListBackupPlanRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. + * @param message ListBackupPlanRevisionsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanRevisionsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; + + /** + * Decodes a ListBackupPlanRevisionsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; + + /** + * Verifies a ListBackupPlanRevisionsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanRevisionsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; + + /** + * Creates a plain object from a ListBackupPlanRevisionsResponse message. Also converts values to other types if specified. + * @param message ListBackupPlanRevisionsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanRevisionsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanRevisionsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupPlanAssociation. */ + interface IBackupPlanAssociation { + + /** BackupPlanAssociation name */ + name?: (string|null); + + /** BackupPlanAssociation resourceType */ + resourceType?: (string|null); + + /** BackupPlanAssociation resource */ + resource?: (string|null); + + /** BackupPlanAssociation backupPlan */ + backupPlan?: (string|null); + + /** BackupPlanAssociation createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation state */ + state?: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State|null); + + /** BackupPlanAssociation rulesConfigInfo */ + rulesConfigInfo?: (google.cloud.backupdr.v1.IRuleConfigInfo[]|null); + + /** BackupPlanAssociation dataSource */ + dataSource?: (string|null); + + /** BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties */ + cloudSqlInstanceBackupPlanAssociationProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null); + + /** BackupPlanAssociation backupPlanRevisionId */ + backupPlanRevisionId?: (string|null); + + /** BackupPlanAssociation backupPlanRevisionName */ + backupPlanRevisionName?: (string|null); + } + + /** Represents a BackupPlanAssociation. */ + class BackupPlanAssociation implements IBackupPlanAssociation { + + /** + * Constructs a new BackupPlanAssociation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation); + + /** BackupPlanAssociation name. */ + public name: string; + + /** BackupPlanAssociation resourceType. */ + public resourceType: string; + + /** BackupPlanAssociation resource. */ + public resource: string; + + /** BackupPlanAssociation backupPlan. */ + public backupPlan: string; + + /** BackupPlanAssociation createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupPlanAssociation state. */ + public state: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State); + + /** BackupPlanAssociation rulesConfigInfo. */ + public rulesConfigInfo: google.cloud.backupdr.v1.IRuleConfigInfo[]; + + /** BackupPlanAssociation dataSource. */ + public dataSource: string; + + /** BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties. */ + public cloudSqlInstanceBackupPlanAssociationProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null); + + /** BackupPlanAssociation backupPlanRevisionId. */ + public backupPlanRevisionId: string; + + /** BackupPlanAssociation backupPlanRevisionName. */ + public backupPlanRevisionName: string; + + /** BackupPlanAssociation resourceProperties. */ + public resourceProperties?: "cloudSqlInstanceBackupPlanAssociationProperties"; + + /** + * Creates a new BackupPlanAssociation instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupPlanAssociation instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @param message BackupPlanAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @param message BackupPlanAssociation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Verifies a BackupPlanAssociation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupPlanAssociation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlanAssociation; + + /** + * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. + * @param message BackupPlanAssociation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupPlanAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupPlanAssociation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupPlanAssociation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupPlanAssociation { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + INACTIVE = 4, + UPDATING = 5 + } + } + + /** Properties of a RuleConfigInfo. */ + interface IRuleConfigInfo { + + /** RuleConfigInfo ruleId */ + ruleId?: (string|null); + + /** RuleConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null); + + /** RuleConfigInfo lastBackupError */ + lastBackupError?: (google.rpc.IStatus|null); + + /** RuleConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a RuleConfigInfo. */ + class RuleConfigInfo implements IRuleConfigInfo { + + /** + * Constructs a new RuleConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRuleConfigInfo); + + /** RuleConfigInfo ruleId. */ + public ruleId: string; + + /** RuleConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState); + + /** RuleConfigInfo lastBackupError. */ + public lastBackupError?: (google.rpc.IStatus|null); + + /** RuleConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new RuleConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns RuleConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRuleConfigInfo): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @param message RuleConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @param message RuleConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Verifies a RuleConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RuleConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RuleConfigInfo; + + /** + * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. + * @param message RuleConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RuleConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RuleConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RuleConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace RuleConfigInfo { + + /** LastBackupState enum. */ + enum LastBackupState { + LAST_BACKUP_STATE_UNSPECIFIED = 0, + FIRST_BACKUP_PENDING = 1, + PERMISSION_DENIED = 2, + SUCCEEDED = 3, + FAILED = 4 + } + } + + /** Properties of a CreateBackupPlanAssociationRequest. */ + interface ICreateBackupPlanAssociationRequest { + + /** CreateBackupPlanAssociationRequest parent */ + parent?: (string|null); + + /** CreateBackupPlanAssociationRequest backupPlanAssociationId */ + backupPlanAssociationId?: (string|null); + + /** CreateBackupPlanAssociationRequest backupPlanAssociation */ + backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** CreateBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a CreateBackupPlanAssociationRequest. */ + class CreateBackupPlanAssociationRequest implements ICreateBackupPlanAssociationRequest { + + /** + * Constructs a new CreateBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest); + + /** CreateBackupPlanAssociationRequest parent. */ + public parent: string; + + /** CreateBackupPlanAssociationRequest backupPlanAssociationId. */ + public backupPlanAssociationId: string; + + /** CreateBackupPlanAssociationRequest backupPlanAssociation. */ + public backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** CreateBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @param message CreateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @param message CreateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Verifies a CreateBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; + + /** + * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message CreateBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanAssociationsRequest. */ + interface IListBackupPlanAssociationsRequest { + + /** ListBackupPlanAssociationsRequest parent */ + parent?: (string|null); + + /** ListBackupPlanAssociationsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupPlanAssociationsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupPlanAssociationsRequest filter */ + filter?: (string|null); + } + + /** Represents a ListBackupPlanAssociationsRequest. */ + class ListBackupPlanAssociationsRequest implements IListBackupPlanAssociationsRequest { + + /** + * Constructs a new ListBackupPlanAssociationsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest); + + /** ListBackupPlanAssociationsRequest parent. */ + public parent: string; + + /** ListBackupPlanAssociationsRequest pageSize. */ + public pageSize: number; + + /** ListBackupPlanAssociationsRequest pageToken. */ + public pageToken: string; + + /** ListBackupPlanAssociationsRequest filter. */ + public filter: string; + + /** + * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanAssociationsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @param message ListBackupPlanAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @param message ListBackupPlanAssociationsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Verifies a ListBackupPlanAssociationsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanAssociationsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; + + /** + * Creates a plain object from a ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. + * @param message ListBackupPlanAssociationsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanAssociationsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanAssociationsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupPlanAssociationsResponse. */ + interface IListBackupPlanAssociationsResponse { + + /** ListBackupPlanAssociationsResponse backupPlanAssociations */ + backupPlanAssociations?: (google.cloud.backupdr.v1.IBackupPlanAssociation[]|null); + + /** ListBackupPlanAssociationsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupPlanAssociationsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupPlanAssociationsResponse. */ + class ListBackupPlanAssociationsResponse implements IListBackupPlanAssociationsResponse { + + /** + * Constructs a new ListBackupPlanAssociationsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse); + + /** ListBackupPlanAssociationsResponse backupPlanAssociations. */ + public backupPlanAssociations: google.cloud.backupdr.v1.IBackupPlanAssociation[]; + + /** ListBackupPlanAssociationsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupPlanAssociationsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupPlanAssociationsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @param message ListBackupPlanAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @param message ListBackupPlanAssociationsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Verifies a ListBackupPlanAssociationsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupPlanAssociationsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; + + /** + * Creates a plain object from a ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. + * @param message ListBackupPlanAssociationsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupPlanAssociationsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupPlanAssociationsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchBackupPlanAssociationsForResourceTypeRequest. */ + interface IFetchBackupPlanAssociationsForResourceTypeRequest { + + /** FetchBackupPlanAssociationsForResourceTypeRequest parent */ + parent?: (string|null); + + /** FetchBackupPlanAssociationsForResourceTypeRequest resourceType */ + resourceType?: (string|null); + + /** FetchBackupPlanAssociationsForResourceTypeRequest pageSize */ + pageSize?: (number|null); + + /** FetchBackupPlanAssociationsForResourceTypeRequest pageToken */ + pageToken?: (string|null); + + /** FetchBackupPlanAssociationsForResourceTypeRequest filter */ + filter?: (string|null); + + /** FetchBackupPlanAssociationsForResourceTypeRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a FetchBackupPlanAssociationsForResourceTypeRequest. */ + class FetchBackupPlanAssociationsForResourceTypeRequest implements IFetchBackupPlanAssociationsForResourceTypeRequest { + + /** + * Constructs a new FetchBackupPlanAssociationsForResourceTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest); + + /** FetchBackupPlanAssociationsForResourceTypeRequest parent. */ + public parent: string; + + /** FetchBackupPlanAssociationsForResourceTypeRequest resourceType. */ + public resourceType: string; + + /** FetchBackupPlanAssociationsForResourceTypeRequest pageSize. */ + public pageSize: number; + + /** FetchBackupPlanAssociationsForResourceTypeRequest pageToken. */ + public pageToken: string; + + /** FetchBackupPlanAssociationsForResourceTypeRequest filter. */ + public filter: string; + + /** FetchBackupPlanAssociationsForResourceTypeRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new FetchBackupPlanAssociationsForResourceTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchBackupPlanAssociationsForResourceTypeRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. + * @param message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. + * @param message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchBackupPlanAssociationsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchBackupPlanAssociationsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; + + /** + * Verifies a FetchBackupPlanAssociationsForResourceTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchBackupPlanAssociationsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchBackupPlanAssociationsForResourceTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; + + /** + * Creates a plain object from a FetchBackupPlanAssociationsForResourceTypeRequest message. Also converts values to other types if specified. + * @param message FetchBackupPlanAssociationsForResourceTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchBackupPlanAssociationsForResourceTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchBackupPlanAssociationsForResourceTypeResponse. */ + interface IFetchBackupPlanAssociationsForResourceTypeResponse { + + /** FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations */ + backupPlanAssociations?: (google.cloud.backupdr.v1.IBackupPlanAssociation[]|null); + + /** FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a FetchBackupPlanAssociationsForResourceTypeResponse. */ + class FetchBackupPlanAssociationsForResourceTypeResponse implements IFetchBackupPlanAssociationsForResourceTypeResponse { + + /** + * Constructs a new FetchBackupPlanAssociationsForResourceTypeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse); + + /** FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations. */ + public backupPlanAssociations: google.cloud.backupdr.v1.IBackupPlanAssociation[]; + + /** FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new FetchBackupPlanAssociationsForResourceTypeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchBackupPlanAssociationsForResourceTypeResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. + * @param message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. + * @param message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchBackupPlanAssociationsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchBackupPlanAssociationsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; + + /** + * Verifies a FetchBackupPlanAssociationsForResourceTypeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchBackupPlanAssociationsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchBackupPlanAssociationsForResourceTypeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; + + /** + * Creates a plain object from a FetchBackupPlanAssociationsForResourceTypeResponse message. Also converts values to other types if specified. + * @param message FetchBackupPlanAssociationsForResourceTypeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchBackupPlanAssociationsForResourceTypeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupPlanAssociationRequest. */ + interface IGetBackupPlanAssociationRequest { + + /** GetBackupPlanAssociationRequest name */ + name?: (string|null); + } + + /** Represents a GetBackupPlanAssociationRequest. */ + class GetBackupPlanAssociationRequest implements IGetBackupPlanAssociationRequest { + + /** + * Constructs a new GetBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest); + + /** GetBackupPlanAssociationRequest name. */ + public name: string; + + /** + * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @param message GetBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @param message GetBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Verifies a GetBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; + + /** + * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message GetBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupPlanAssociationRequest. */ + interface IDeleteBackupPlanAssociationRequest { + + /** DeleteBackupPlanAssociationRequest name */ + name?: (string|null); + + /** DeleteBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupPlanAssociationRequest. */ + class DeleteBackupPlanAssociationRequest implements IDeleteBackupPlanAssociationRequest { + + /** + * Constructs a new DeleteBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest); + + /** DeleteBackupPlanAssociationRequest name. */ + public name: string; + + /** DeleteBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @param message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @param message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Verifies a DeleteBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; + + /** + * Creates a plain object from a DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message DeleteBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupPlanAssociationRequest. */ + interface IUpdateBackupPlanAssociationRequest { + + /** UpdateBackupPlanAssociationRequest backupPlanAssociation */ + backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** UpdateBackupPlanAssociationRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupPlanAssociationRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackupPlanAssociationRequest. */ + class UpdateBackupPlanAssociationRequest implements IUpdateBackupPlanAssociationRequest { + + /** + * Constructs a new UpdateBackupPlanAssociationRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest); + + /** UpdateBackupPlanAssociationRequest backupPlanAssociation. */ + public backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); + + /** UpdateBackupPlanAssociationRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupPlanAssociationRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateBackupPlanAssociationRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupPlanAssociationRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; + + /** + * Encodes the specified UpdateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. + * @param message UpdateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. + * @param message UpdateBackupPlanAssociationRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; + + /** + * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; + + /** + * Verifies an UpdateBackupPlanAssociationRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupPlanAssociationRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; + + /** + * Creates a plain object from an UpdateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @param message UpdateBackupPlanAssociationRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupPlanAssociationRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupPlanAssociationRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TriggerBackupRequest. */ + interface ITriggerBackupRequest { + + /** TriggerBackupRequest name */ + name?: (string|null); + + /** TriggerBackupRequest ruleId */ + ruleId?: (string|null); + + /** TriggerBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a TriggerBackupRequest. */ + class TriggerBackupRequest implements ITriggerBackupRequest { + + /** + * Constructs a new TriggerBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest); + + /** TriggerBackupRequest name. */ + public name: string; + + /** TriggerBackupRequest ruleId. */ + public ruleId: string; + + /** TriggerBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new TriggerBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns TriggerBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @param message TriggerBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @param message TriggerBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Verifies a TriggerBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TriggerBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TriggerBackupRequest; + + /** + * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. + * @param message TriggerBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.TriggerBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TriggerBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TriggerBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlInstanceDataSourceProperties. */ + interface ICloudSqlInstanceDataSourceProperties { + + /** CloudSqlInstanceDataSourceProperties name */ + name?: (string|null); + + /** CloudSqlInstanceDataSourceProperties databaseInstalledVersion */ + databaseInstalledVersion?: (string|null); + + /** CloudSqlInstanceDataSourceProperties instanceCreateTime */ + instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudSqlInstanceDataSourceProperties instanceTier */ + instanceTier?: (string|null); + } + + /** Represents a CloudSqlInstanceDataSourceProperties. */ + class CloudSqlInstanceDataSourceProperties implements ICloudSqlInstanceDataSourceProperties { + + /** + * Constructs a new CloudSqlInstanceDataSourceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties); + + /** CloudSqlInstanceDataSourceProperties name. */ + public name: string; + + /** CloudSqlInstanceDataSourceProperties databaseInstalledVersion. */ + public databaseInstalledVersion: string; + + /** CloudSqlInstanceDataSourceProperties instanceCreateTime. */ + public instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudSqlInstanceDataSourceProperties instanceTier. */ + public instanceTier: string; + + /** + * Creates a new CloudSqlInstanceDataSourceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlInstanceDataSourceProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; + + /** + * Encodes the specified CloudSqlInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. + * @param message CloudSqlInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. + * @param message CloudSqlInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; + + /** + * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; + + /** + * Verifies a CloudSqlInstanceDataSourceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlInstanceDataSourceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; + + /** + * Creates a plain object from a CloudSqlInstanceDataSourceProperties message. Also converts values to other types if specified. + * @param message CloudSqlInstanceDataSourceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlInstanceDataSourceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlInstanceDataSourceProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlInstanceBackupProperties. */ + interface ICloudSqlInstanceBackupProperties { + + /** CloudSqlInstanceBackupProperties databaseInstalledVersion */ + databaseInstalledVersion?: (string|null); + + /** CloudSqlInstanceBackupProperties finalBackup */ + finalBackup?: (boolean|null); + + /** CloudSqlInstanceBackupProperties sourceInstance */ + sourceInstance?: (string|null); + + /** CloudSqlInstanceBackupProperties instanceCreateTime */ + instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudSqlInstanceBackupProperties instanceTier */ + instanceTier?: (string|null); + + /** CloudSqlInstanceBackupProperties instanceDeleteTime */ + instanceDeleteTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CloudSqlInstanceBackupProperties. */ + class CloudSqlInstanceBackupProperties implements ICloudSqlInstanceBackupProperties { + + /** + * Constructs a new CloudSqlInstanceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties); + + /** CloudSqlInstanceBackupProperties databaseInstalledVersion. */ + public databaseInstalledVersion: string; + + /** CloudSqlInstanceBackupProperties finalBackup. */ + public finalBackup: boolean; + + /** CloudSqlInstanceBackupProperties sourceInstance. */ + public sourceInstance: string; + + /** CloudSqlInstanceBackupProperties instanceCreateTime. */ + public instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudSqlInstanceBackupProperties instanceTier. */ + public instanceTier: string; + + /** CloudSqlInstanceBackupProperties instanceDeleteTime. */ + public instanceDeleteTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CloudSqlInstanceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlInstanceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; + + /** + * Encodes the specified CloudSqlInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. + * @param message CloudSqlInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. + * @param message CloudSqlInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; + + /** + * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; + + /** + * Verifies a CloudSqlInstanceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlInstanceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; + + /** + * Creates a plain object from a CloudSqlInstanceBackupProperties message. Also converts values to other types if specified. + * @param message CloudSqlInstanceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlInstanceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlInstanceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlInstanceDataSourceReferenceProperties. */ + interface ICloudSqlInstanceDataSourceReferenceProperties { + + /** CloudSqlInstanceDataSourceReferenceProperties name */ + name?: (string|null); + + /** CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion */ + databaseInstalledVersion?: (string|null); + + /** CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime */ + instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudSqlInstanceDataSourceReferenceProperties instanceTier */ + instanceTier?: (string|null); + } + + /** Represents a CloudSqlInstanceDataSourceReferenceProperties. */ + class CloudSqlInstanceDataSourceReferenceProperties implements ICloudSqlInstanceDataSourceReferenceProperties { + + /** + * Constructs a new CloudSqlInstanceDataSourceReferenceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties); + + /** CloudSqlInstanceDataSourceReferenceProperties name. */ + public name: string; + + /** CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion. */ + public databaseInstalledVersion: string; + + /** CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime. */ + public instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** CloudSqlInstanceDataSourceReferenceProperties instanceTier. */ + public instanceTier: string; + + /** + * Creates a new CloudSqlInstanceDataSourceReferenceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlInstanceDataSourceReferenceProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; + + /** + * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. + * @param message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. + * @param message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlInstanceDataSourceReferenceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; + + /** + * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlInstanceDataSourceReferenceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; + + /** + * Verifies a CloudSqlInstanceDataSourceReferenceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlInstanceDataSourceReferenceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlInstanceDataSourceReferenceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; + + /** + * Creates a plain object from a CloudSqlInstanceDataSourceReferenceProperties message. Also converts values to other types if specified. + * @param message CloudSqlInstanceDataSourceReferenceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlInstanceDataSourceReferenceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlInstanceDataSourceReferenceProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CloudSqlInstanceInitializationConfig. */ + interface ICloudSqlInstanceInitializationConfig { + + /** CloudSqlInstanceInitializationConfig edition */ + edition?: (google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|keyof typeof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|null); + } + + /** Represents a CloudSqlInstanceInitializationConfig. */ + class CloudSqlInstanceInitializationConfig implements ICloudSqlInstanceInitializationConfig { + + /** + * Constructs a new CloudSqlInstanceInitializationConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig); + + /** CloudSqlInstanceInitializationConfig edition. */ + public edition: (google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|keyof typeof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition); + + /** + * Creates a new CloudSqlInstanceInitializationConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlInstanceInitializationConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; + + /** + * Encodes the specified CloudSqlInstanceInitializationConfig message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. + * @param message CloudSqlInstanceInitializationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlInstanceInitializationConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. + * @param message CloudSqlInstanceInitializationConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlInstanceInitializationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; + + /** + * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlInstanceInitializationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; + + /** + * Verifies a CloudSqlInstanceInitializationConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlInstanceInitializationConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlInstanceInitializationConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; + + /** + * Creates a plain object from a CloudSqlInstanceInitializationConfig message. Also converts values to other types if specified. + * @param message CloudSqlInstanceInitializationConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlInstanceInitializationConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlInstanceInitializationConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace CloudSqlInstanceInitializationConfig { + + /** Edition enum. */ + enum Edition { + EDITION_UNSPECIFIED = 0, + ENTERPRISE = 1, + ENTERPRISE_PLUS = 2 + } + } + + /** Properties of a CloudSqlInstanceBackupPlanAssociationProperties. */ + interface ICloudSqlInstanceBackupPlanAssociationProperties { + + /** CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime */ + instanceCreateTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a CloudSqlInstanceBackupPlanAssociationProperties. */ + class CloudSqlInstanceBackupPlanAssociationProperties implements ICloudSqlInstanceBackupPlanAssociationProperties { + + /** + * Constructs a new CloudSqlInstanceBackupPlanAssociationProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties); + + /** CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime. */ + public instanceCreateTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new CloudSqlInstanceBackupPlanAssociationProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns CloudSqlInstanceBackupPlanAssociationProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; + + /** + * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. + * @param message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. + * @param message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CloudSqlInstanceBackupPlanAssociationProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; + + /** + * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CloudSqlInstanceBackupPlanAssociationProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; + + /** + * Verifies a CloudSqlInstanceBackupPlanAssociationProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CloudSqlInstanceBackupPlanAssociationProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CloudSqlInstanceBackupPlanAssociationProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; + + /** + * Creates a plain object from a CloudSqlInstanceBackupPlanAssociationProperties message. Also converts values to other types if specified. + * @param message CloudSqlInstanceBackupPlanAssociationProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CloudSqlInstanceBackupPlanAssociationProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CloudSqlInstanceBackupPlanAssociationProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupVault. */ + interface IBackupVault { + + /** BackupVault name */ + name?: (string|null); + + /** BackupVault description */ + description?: (string|null); + + /** BackupVault labels */ + labels?: ({ [k: string]: string }|null); + + /** BackupVault createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupMinimumEnforcedRetentionDuration */ + backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); + + /** BackupVault backupRetentionInheritance */ + backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); + + /** BackupVault deletable */ + deletable?: (boolean|null); + + /** BackupVault etag */ + etag?: (string|null); + + /** BackupVault state */ + state?: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State|null); + + /** BackupVault effectiveTime */ + effectiveTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupCount */ + backupCount?: (number|Long|string|null); + + /** BackupVault serviceAccount */ + serviceAccount?: (string|null); + + /** BackupVault totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + + /** BackupVault uid */ + uid?: (string|null); + + /** BackupVault annotations */ + annotations?: ({ [k: string]: string }|null); + + /** BackupVault accessRestriction */ + accessRestriction?: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction|null); + + /** BackupVault encryptionConfig */ + encryptionConfig?: (google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null); + } + + /** Represents a BackupVault. */ + class BackupVault implements IBackupVault { + + /** + * Constructs a new BackupVault. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupVault); + + /** BackupVault name. */ + public name: string; + + /** BackupVault description. */ + public description?: (string|null); + + /** BackupVault labels. */ + public labels: { [k: string]: string }; + + /** BackupVault createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupMinimumEnforcedRetentionDuration. */ + public backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); + + /** BackupVault backupRetentionInheritance. */ + public backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); + + /** BackupVault deletable. */ + public deletable?: (boolean|null); + + /** BackupVault etag. */ + public etag?: (string|null); + + /** BackupVault state. */ + public state: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State); + + /** BackupVault effectiveTime. */ + public effectiveTime?: (google.protobuf.ITimestamp|null); + + /** BackupVault backupCount. */ + public backupCount: (number|Long|string); + + /** BackupVault serviceAccount. */ + public serviceAccount: string; + + /** BackupVault totalStoredBytes. */ + public totalStoredBytes: (number|Long|string); + + /** BackupVault uid. */ + public uid: string; + + /** BackupVault annotations. */ + public annotations: { [k: string]: string }; + + /** BackupVault accessRestriction. */ + public accessRestriction: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction); + + /** BackupVault encryptionConfig. */ + public encryptionConfig?: (google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null); + + /** + * Creates a new BackupVault instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupVault instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupVault): google.cloud.backupdr.v1.BackupVault; + + /** + * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @param message BackupVault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @param message BackupVault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupVault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupVault; + + /** + * Decodes a BackupVault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupVault; + + /** + * Verifies a BackupVault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupVault + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupVault; + + /** + * Creates a plain object from a BackupVault message. Also converts values to other types if specified. + * @param message BackupVault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupVault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupVault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupVault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupVault { + + /** BackupRetentionInheritance enum. */ + enum BackupRetentionInheritance { + BACKUP_RETENTION_INHERITANCE_UNSPECIFIED = 0, + INHERIT_VAULT_RETENTION = 1, + MATCH_BACKUP_EXPIRE_TIME = 2 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4, + UPDATING = 5 + } + + /** AccessRestriction enum. */ + enum AccessRestriction { + ACCESS_RESTRICTION_UNSPECIFIED = 0, + WITHIN_PROJECT = 1, + WITHIN_ORGANIZATION = 2, + UNRESTRICTED = 3, + WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4 + } + + /** Properties of an EncryptionConfig. */ + interface IEncryptionConfig { + + /** EncryptionConfig kmsKeyName */ + kmsKeyName?: (string|null); + } + + /** Represents an EncryptionConfig. */ + class EncryptionConfig implements IEncryptionConfig { + + /** + * Constructs a new EncryptionConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.BackupVault.IEncryptionConfig); + + /** EncryptionConfig kmsKeyName. */ + public kmsKeyName?: (string|null); + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns EncryptionConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.BackupVault.IEncryptionConfig): google.cloud.backupdr.v1.BackupVault.EncryptionConfig; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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 DataSource. */ + interface IDataSource { + + /** DataSource name */ + name?: (string|null); + + /** DataSource state */ + state?: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State|null); + + /** DataSource labels */ + labels?: ({ [k: string]: string }|null); + + /** DataSource createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataSource updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** DataSource backupCount */ + backupCount?: (number|Long|string|null); + + /** DataSource etag */ + etag?: (string|null); + + /** DataSource totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + + /** DataSource configState */ + configState?: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState|null); + + /** DataSource backupConfigInfo */ + backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); + + /** DataSource dataSourceGcpResource */ + dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); + + /** DataSource dataSourceBackupApplianceApplication */ + dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); + + /** DataSource backupBlockedByVaultAccessRestriction */ + backupBlockedByVaultAccessRestriction?: (boolean|null); + } + + /** Represents a DataSource. */ + class DataSource implements IDataSource { + + /** + * Constructs a new DataSource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSource); + + /** DataSource name. */ + public name: string; + + /** DataSource state. */ + public state: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State); + + /** DataSource labels. */ + public labels: { [k: string]: string }; + + /** DataSource createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataSource updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** DataSource backupCount. */ + public backupCount?: (number|Long|string|null); + + /** DataSource etag. */ + public etag?: (string|null); + + /** DataSource totalStoredBytes. */ + public totalStoredBytes?: (number|Long|string|null); + + /** DataSource configState. */ + public configState: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState); + + /** DataSource backupConfigInfo. */ + public backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); + + /** DataSource dataSourceGcpResource. */ + public dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); + + /** DataSource dataSourceBackupApplianceApplication. */ + public dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); + + /** DataSource backupBlockedByVaultAccessRestriction. */ + public backupBlockedByVaultAccessRestriction: boolean; + + /** DataSource sourceResource. */ + public sourceResource?: ("dataSourceGcpResource"|"dataSourceBackupApplianceApplication"); + + /** + * Creates a new DataSource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSource): google.cloud.backupdr.v1.DataSource; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @param message DataSource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSource; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSource; + + /** + * Verifies a DataSource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSource; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @param message DataSource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DataSource { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4 + } + } + + /** Properties of a BackupConfigInfo. */ + interface IBackupConfigInfo { + + /** BackupConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null); + + /** BackupConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigInfo lastBackupError */ + lastBackupError?: (google.rpc.IStatus|null); + + /** BackupConfigInfo gcpBackupConfig */ + gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); + + /** BackupConfigInfo backupApplianceBackupConfig */ + backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); + } + + /** Represents a BackupConfigInfo. */ + class BackupConfigInfo implements IBackupConfigInfo { + + /** + * Constructs a new BackupConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupConfigInfo); + + /** BackupConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState); + + /** BackupConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigInfo lastBackupError. */ + public lastBackupError?: (google.rpc.IStatus|null); + + /** BackupConfigInfo gcpBackupConfig. */ + public gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); + + /** BackupConfigInfo backupApplianceBackupConfig. */ + public backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); + + /** BackupConfigInfo backupConfig. */ + public backupConfig?: ("gcpBackupConfig"|"backupApplianceBackupConfig"); + + /** + * Creates a new BackupConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupConfigInfo): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @param message BackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @param message BackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Verifies a BackupConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigInfo; + + /** + * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. + * @param message BackupConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupConfigInfo { + + /** LastBackupState enum. */ + enum LastBackupState { + LAST_BACKUP_STATE_UNSPECIFIED = 0, + FIRST_BACKUP_PENDING = 1, + SUCCEEDED = 2, + FAILED = 3, + PERMISSION_DENIED = 4 + } + } + + /** Properties of a GcpBackupConfig. */ + interface IGcpBackupConfig { + + /** GcpBackupConfig backupPlan */ + backupPlan?: (string|null); + + /** GcpBackupConfig backupPlanDescription */ + backupPlanDescription?: (string|null); + + /** GcpBackupConfig backupPlanAssociation */ + backupPlanAssociation?: (string|null); + + /** GcpBackupConfig backupPlanRules */ + backupPlanRules?: (string[]|null); + + /** GcpBackupConfig backupPlanRevisionName */ + backupPlanRevisionName?: (string|null); + + /** GcpBackupConfig backupPlanRevisionId */ + backupPlanRevisionId?: (string|null); + } + + /** Represents a GcpBackupConfig. */ + class GcpBackupConfig implements IGcpBackupConfig { + + /** + * Constructs a new GcpBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGcpBackupConfig); + + /** GcpBackupConfig backupPlan. */ + public backupPlan: string; + + /** GcpBackupConfig backupPlanDescription. */ + public backupPlanDescription: string; + + /** GcpBackupConfig backupPlanAssociation. */ + public backupPlanAssociation: string; + + /** GcpBackupConfig backupPlanRules. */ + public backupPlanRules: string[]; + + /** GcpBackupConfig backupPlanRevisionName. */ + public backupPlanRevisionName: string; + + /** GcpBackupConfig backupPlanRevisionId. */ + public backupPlanRevisionId: string; + + /** + * Creates a new GcpBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGcpBackupConfig): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @param message GcpBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @param message GcpBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Verifies a GcpBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpBackupConfig; + + /** + * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. + * @param message GcpBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GcpBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupApplianceBackupConfig. */ + interface IBackupApplianceBackupConfig { + + /** BackupApplianceBackupConfig backupApplianceName */ + backupApplianceName?: (string|null); + + /** BackupApplianceBackupConfig backupApplianceId */ + backupApplianceId?: (number|Long|string|null); + + /** BackupApplianceBackupConfig slaId */ + slaId?: (number|Long|string|null); + + /** BackupApplianceBackupConfig applicationName */ + applicationName?: (string|null); + + /** BackupApplianceBackupConfig hostName */ + hostName?: (string|null); + + /** BackupApplianceBackupConfig sltName */ + sltName?: (string|null); + + /** BackupApplianceBackupConfig slpName */ + slpName?: (string|null); + } + + /** Represents a BackupApplianceBackupConfig. */ + class BackupApplianceBackupConfig implements IBackupApplianceBackupConfig { + + /** + * Constructs a new BackupApplianceBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig); + + /** BackupApplianceBackupConfig backupApplianceName. */ + public backupApplianceName: string; + + /** BackupApplianceBackupConfig backupApplianceId. */ + public backupApplianceId: (number|Long|string); + + /** BackupApplianceBackupConfig slaId. */ + public slaId: (number|Long|string); + + /** BackupApplianceBackupConfig applicationName. */ + public applicationName: string; + + /** BackupApplianceBackupConfig hostName. */ + public hostName: string; + + /** BackupApplianceBackupConfig sltName. */ + public sltName: string; + + /** BackupApplianceBackupConfig slpName. */ + public slpName: string; + + /** + * Creates a new BackupApplianceBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @param message BackupApplianceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @param message BackupApplianceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Verifies a BackupApplianceBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupConfig; + + /** + * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. + * @param message BackupApplianceBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceGcpResource. */ + interface IDataSourceGcpResource { + + /** DataSourceGcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** DataSourceGcpResource location */ + location?: (string|null); + + /** DataSourceGcpResource type */ + type?: (string|null); + + /** DataSourceGcpResource computeInstanceDatasourceProperties */ + computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); + + /** DataSourceGcpResource cloudSqlInstanceDatasourceProperties */ + cloudSqlInstanceDatasourceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null); + + /** DataSourceGcpResource diskDatasourceProperties */ + diskDatasourceProperties?: (google.cloud.backupdr.v1.IDiskDataSourceProperties|null); + } + + /** Represents a DataSourceGcpResource. */ + class DataSourceGcpResource implements IDataSourceGcpResource { + + /** + * Constructs a new DataSourceGcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource); + + /** DataSourceGcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** DataSourceGcpResource location. */ + public location: string; + + /** DataSourceGcpResource type. */ + public type: string; + + /** DataSourceGcpResource computeInstanceDatasourceProperties. */ + public computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); + + /** DataSourceGcpResource cloudSqlInstanceDatasourceProperties. */ + public cloudSqlInstanceDatasourceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null); + + /** DataSourceGcpResource diskDatasourceProperties. */ + public diskDatasourceProperties?: (google.cloud.backupdr.v1.IDiskDataSourceProperties|null); + + /** DataSourceGcpResource gcpResourceProperties. */ + public gcpResourceProperties?: ("computeInstanceDatasourceProperties"|"cloudSqlInstanceDatasourceProperties"|"diskDatasourceProperties"); + + /** + * Creates a new DataSourceGcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceGcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @param message DataSourceGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @param message DataSourceGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Verifies a DataSourceGcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceGcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceGcpResource; + + /** + * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. + * @param message DataSourceGcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceGcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceGcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceGcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceBackupApplianceApplication. */ + interface IDataSourceBackupApplianceApplication { + + /** DataSourceBackupApplianceApplication applicationName */ + applicationName?: (string|null); + + /** DataSourceBackupApplianceApplication backupAppliance */ + backupAppliance?: (string|null); + + /** DataSourceBackupApplianceApplication applianceId */ + applianceId?: (number|Long|string|null); + + /** DataSourceBackupApplianceApplication type */ + type?: (string|null); + + /** DataSourceBackupApplianceApplication applicationId */ + applicationId?: (number|Long|string|null); + + /** DataSourceBackupApplianceApplication hostname */ + hostname?: (string|null); + + /** DataSourceBackupApplianceApplication hostId */ + hostId?: (number|Long|string|null); + } + + /** Represents a DataSourceBackupApplianceApplication. */ + class DataSourceBackupApplianceApplication implements IDataSourceBackupApplianceApplication { + + /** + * Constructs a new DataSourceBackupApplianceApplication. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication); + + /** DataSourceBackupApplianceApplication applicationName. */ + public applicationName: string; + + /** DataSourceBackupApplianceApplication backupAppliance. */ + public backupAppliance: string; + + /** DataSourceBackupApplianceApplication applianceId. */ + public applianceId: (number|Long|string); + + /** DataSourceBackupApplianceApplication type. */ + public type: string; + + /** DataSourceBackupApplianceApplication applicationId. */ + public applicationId: (number|Long|string); + + /** DataSourceBackupApplianceApplication hostname. */ + public hostname: string; + + /** DataSourceBackupApplianceApplication hostId. */ + public hostId: (number|Long|string); + + /** + * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceBackupApplianceApplication instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @param message DataSourceBackupApplianceApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @param message DataSourceBackupApplianceApplication message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Verifies a DataSourceBackupApplianceApplication message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceBackupApplianceApplication + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; + + /** + * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. + * @param message DataSourceBackupApplianceApplication + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceBackupApplianceApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceBackupApplianceApplication to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceBackupApplianceApplication + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceLockInfo. */ + interface IServiceLockInfo { + + /** ServiceLockInfo operation */ + operation?: (string|null); + } + + /** Represents a ServiceLockInfo. */ + class ServiceLockInfo implements IServiceLockInfo { + + /** + * Constructs a new ServiceLockInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IServiceLockInfo); + + /** ServiceLockInfo operation. */ + public operation: string; + + /** + * Creates a new ServiceLockInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceLockInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IServiceLockInfo): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @param message ServiceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @param message ServiceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Verifies a ServiceLockInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceLockInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceLockInfo; + + /** + * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. + * @param message ServiceLockInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ServiceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceLockInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceLockInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupApplianceLockInfo. */ + interface IBackupApplianceLockInfo { + + /** BackupApplianceLockInfo backupApplianceId */ + backupApplianceId?: (number|Long|string|null); + + /** BackupApplianceLockInfo backupApplianceName */ + backupApplianceName?: (string|null); + + /** BackupApplianceLockInfo lockReason */ + lockReason?: (string|null); + + /** BackupApplianceLockInfo jobName */ + jobName?: (string|null); + + /** BackupApplianceLockInfo backupImage */ + backupImage?: (string|null); + + /** BackupApplianceLockInfo slaId */ + slaId?: (number|Long|string|null); + } + + /** Represents a BackupApplianceLockInfo. */ + class BackupApplianceLockInfo implements IBackupApplianceLockInfo { + + /** + * Constructs a new BackupApplianceLockInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo); + + /** BackupApplianceLockInfo backupApplianceId. */ + public backupApplianceId: (number|Long|string); + + /** BackupApplianceLockInfo backupApplianceName. */ + public backupApplianceName: string; + + /** BackupApplianceLockInfo lockReason. */ + public lockReason: string; + + /** BackupApplianceLockInfo jobName. */ + public jobName?: (string|null); + + /** BackupApplianceLockInfo backupImage. */ + public backupImage?: (string|null); + + /** BackupApplianceLockInfo slaId. */ + public slaId?: (number|Long|string|null); + + /** BackupApplianceLockInfo lockSource. */ + public lockSource?: ("jobName"|"backupImage"|"slaId"); + + /** + * Creates a new BackupApplianceLockInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceLockInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @param message BackupApplianceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @param message BackupApplianceLockInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Verifies a BackupApplianceLockInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceLockInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceLockInfo; + + /** + * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. + * @param message BackupApplianceLockInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceLockInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceLockInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupLock. */ + interface IBackupLock { + + /** BackupLock lockUntilTime */ + lockUntilTime?: (google.protobuf.ITimestamp|null); + + /** BackupLock backupApplianceLockInfo */ + backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); + + /** BackupLock serviceLockInfo */ + serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); + } + + /** Represents a BackupLock. */ + class BackupLock implements IBackupLock { + + /** + * Constructs a new BackupLock. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupLock); + + /** BackupLock lockUntilTime. */ + public lockUntilTime?: (google.protobuf.ITimestamp|null); + + /** BackupLock backupApplianceLockInfo. */ + public backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); + + /** BackupLock serviceLockInfo. */ + public serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); + + /** BackupLock ClientLockInfo. */ + public ClientLockInfo?: ("backupApplianceLockInfo"|"serviceLockInfo"); + + /** + * Creates a new BackupLock instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupLock instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupLock): google.cloud.backupdr.v1.BackupLock; + + /** + * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @param message BackupLock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @param message BackupLock message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupLock message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLock; + + /** + * Decodes a BackupLock message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLock; + + /** + * Verifies a BackupLock message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupLock + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLock; + + /** + * Creates a plain object from a BackupLock message. Also converts values to other types if specified. + * @param message BackupLock + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupLock, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupLock to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupLock + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Backup. */ + interface IBackup { + + /** Backup name */ + name?: (string|null); + + /** Backup description */ + description?: (string|null); + + /** Backup createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime */ + updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels */ + labels?: ({ [k: string]: string }|null); + + /** Backup enforcedRetentionEndTime */ + enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); + + /** Backup backupRetentionInheritance */ + backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); + + /** Backup expireTime */ + expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup consistencyTime */ + consistencyTime?: (google.protobuf.ITimestamp|null); + + /** Backup etag */ + etag?: (string|null); + + /** Backup state */ + state?: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State|null); + + /** Backup serviceLocks */ + serviceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); + + /** Backup backupApplianceLocks */ + backupApplianceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); + + /** Backup computeInstanceBackupProperties */ + computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); + + /** Backup cloudSqlInstanceBackupProperties */ + cloudSqlInstanceBackupProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null); + + /** Backup backupApplianceBackupProperties */ + backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); + + /** Backup diskBackupProperties */ + diskBackupProperties?: (google.cloud.backupdr.v1.IDiskBackupProperties|null); + + /** Backup backupType */ + backupType?: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType|null); + + /** Backup gcpBackupPlanInfo */ + gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); + + /** Backup resourceSizeBytes */ + resourceSizeBytes?: (number|Long|string|null); + + /** Backup satisfiesPzs */ + satisfiesPzs?: (boolean|null); + + /** Backup satisfiesPzi */ + satisfiesPzi?: (boolean|null); + + /** Backup gcpResource */ + gcpResource?: (google.cloud.backupdr.v1.IBackupGcpResource|null); + + /** Backup kmsKeyVersions */ + kmsKeyVersions?: (string[]|null); + } + + /** Represents a Backup. */ + class Backup implements IBackup { + + /** + * Constructs a new Backup. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackup); + + /** Backup name. */ + public name: string; + + /** Backup description. */ + public description?: (string|null); + + /** Backup createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** Backup updateTime. */ + public updateTime?: (google.protobuf.ITimestamp|null); + + /** Backup labels. */ + public labels: { [k: string]: string }; + + /** Backup enforcedRetentionEndTime. */ + public enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); + + /** Backup backupRetentionInheritance. */ + public backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); + + /** Backup expireTime. */ + public expireTime?: (google.protobuf.ITimestamp|null); + + /** Backup consistencyTime. */ + public consistencyTime?: (google.protobuf.ITimestamp|null); + + /** Backup etag. */ + public etag?: (string|null); + + /** Backup state. */ + public state: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State); + + /** Backup serviceLocks. */ + public serviceLocks: google.cloud.backupdr.v1.IBackupLock[]; + + /** Backup backupApplianceLocks. */ + public backupApplianceLocks: google.cloud.backupdr.v1.IBackupLock[]; + + /** Backup computeInstanceBackupProperties. */ + public computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); + + /** Backup cloudSqlInstanceBackupProperties. */ + public cloudSqlInstanceBackupProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null); + + /** Backup backupApplianceBackupProperties. */ + public backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); + + /** Backup diskBackupProperties. */ + public diskBackupProperties?: (google.cloud.backupdr.v1.IDiskBackupProperties|null); + + /** Backup backupType. */ + public backupType: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType); + + /** Backup gcpBackupPlanInfo. */ + public gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); + + /** Backup resourceSizeBytes. */ + public resourceSizeBytes: (number|Long|string); + + /** Backup satisfiesPzs. */ + public satisfiesPzs?: (boolean|null); + + /** Backup satisfiesPzi. */ + public satisfiesPzi?: (boolean|null); + + /** Backup gcpResource. */ + public gcpResource?: (google.cloud.backupdr.v1.IBackupGcpResource|null); + + /** Backup kmsKeyVersions. */ + public kmsKeyVersions: string[]; + + /** Backup backupProperties. */ + public backupProperties?: ("computeInstanceBackupProperties"|"cloudSqlInstanceBackupProperties"|"backupApplianceBackupProperties"|"diskBackupProperties"); + + /** Backup planInfo. */ + public planInfo?: "gcpBackupPlanInfo"; + + /** Backup sourceResource. */ + public sourceResource?: "gcpResource"; + + /** + * Creates a new Backup instance using the specified properties. + * @param [properties] Properties to set + * @returns Backup instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackup): google.cloud.backupdr.v1.Backup; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @param message Backup message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup; + + /** + * Verifies a Backup message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Backup + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @param message Backup + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Backup to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Backup + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Backup { + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + CREATING = 1, + ACTIVE = 2, + DELETING = 3, + ERROR = 4, + UPLOADING = 5 + } + + /** BackupType enum. */ + enum BackupType { + BACKUP_TYPE_UNSPECIFIED = 0, + SCHEDULED = 1, + ON_DEMAND = 2, + ON_DEMAND_OPERATIONAL = 3 + } + + /** Properties of a GCPBackupPlanInfo. */ + interface IGCPBackupPlanInfo { + + /** GCPBackupPlanInfo backupPlan */ + backupPlan?: (string|null); + + /** GCPBackupPlanInfo backupPlanRuleId */ + backupPlanRuleId?: (string|null); + + /** GCPBackupPlanInfo backupPlanRevisionName */ + backupPlanRevisionName?: (string|null); + + /** GCPBackupPlanInfo backupPlanRevisionId */ + backupPlanRevisionId?: (string|null); + } + + /** Represents a GCPBackupPlanInfo. */ + class GCPBackupPlanInfo implements IGCPBackupPlanInfo { + + /** + * Constructs a new GCPBackupPlanInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo); + + /** GCPBackupPlanInfo backupPlan. */ + public backupPlan: string; + + /** GCPBackupPlanInfo backupPlanRuleId. */ + public backupPlanRuleId: string; + + /** GCPBackupPlanInfo backupPlanRevisionName. */ + public backupPlanRevisionName: string; + + /** GCPBackupPlanInfo backupPlanRevisionId. */ + public backupPlanRevisionId: string; + + /** + * Creates a new GCPBackupPlanInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GCPBackupPlanInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @param message GCPBackupPlanInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @param message GCPBackupPlanInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Verifies a GCPBackupPlanInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GCPBackupPlanInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; + + /** + * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. + * @param message GCPBackupPlanInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GCPBackupPlanInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GCPBackupPlanInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of a CreateBackupVaultRequest. */ + interface ICreateBackupVaultRequest { + + /** CreateBackupVaultRequest parent */ + parent?: (string|null); + + /** CreateBackupVaultRequest backupVaultId */ + backupVaultId?: (string|null); + + /** CreateBackupVaultRequest backupVault */ + backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** CreateBackupVaultRequest requestId */ + requestId?: (string|null); + + /** CreateBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + } + + /** Represents a CreateBackupVaultRequest. */ + class CreateBackupVaultRequest implements ICreateBackupVaultRequest { + + /** + * Constructs a new CreateBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest); + + /** CreateBackupVaultRequest parent. */ + public parent: string; + + /** CreateBackupVaultRequest backupVaultId. */ + public backupVaultId: string; + + /** CreateBackupVaultRequest backupVault. */ + public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** CreateBackupVaultRequest requestId. */ + public requestId: string; + + /** CreateBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** + * Creates a new CreateBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns CreateBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @param message CreateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @param message CreateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Verifies a CreateBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CreateBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupVaultRequest; + + /** + * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. + * @param message CreateBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CreateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CreateBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CreateBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupVaultsRequest. */ + interface IListBackupVaultsRequest { + + /** ListBackupVaultsRequest parent */ + parent?: (string|null); + + /** ListBackupVaultsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupVaultsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupVaultsRequest filter */ + filter?: (string|null); + + /** ListBackupVaultsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupVaultsRequest view */ + view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); + } + + /** Represents a ListBackupVaultsRequest. */ + class ListBackupVaultsRequest implements IListBackupVaultsRequest { + + /** + * Constructs a new ListBackupVaultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest); + + /** ListBackupVaultsRequest parent. */ + public parent: string; + + /** ListBackupVaultsRequest pageSize. */ + public pageSize: number; + + /** ListBackupVaultsRequest pageToken. */ + public pageToken: string; + + /** ListBackupVaultsRequest filter. */ + public filter: string; + + /** ListBackupVaultsRequest orderBy. */ + public orderBy: string; + + /** ListBackupVaultsRequest view. */ + public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); + + /** + * Creates a new ListBackupVaultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupVaultsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @param message ListBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @param message ListBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Verifies a ListBackupVaultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupVaultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsRequest; + + /** + * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. + * @param message ListBackupVaultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupVaultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupVaultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupVaultsResponse. */ + interface IListBackupVaultsResponse { + + /** ListBackupVaultsResponse backupVaults */ + backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); + + /** ListBackupVaultsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupVaultsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupVaultsResponse. */ + class ListBackupVaultsResponse implements IListBackupVaultsResponse { + + /** + * Constructs a new ListBackupVaultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse); + + /** ListBackupVaultsResponse backupVaults. */ + public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; + + /** ListBackupVaultsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupVaultsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupVaultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupVaultsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @param message ListBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @param message ListBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Verifies a ListBackupVaultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupVaultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsResponse; + + /** + * Creates a plain object from a ListBackupVaultsResponse message. Also converts values to other types if specified. + * @param message ListBackupVaultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupVaultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupVaultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchUsableBackupVaultsRequest. */ + interface IFetchUsableBackupVaultsRequest { + + /** FetchUsableBackupVaultsRequest parent */ + parent?: (string|null); + + /** FetchUsableBackupVaultsRequest pageSize */ + pageSize?: (number|null); + + /** FetchUsableBackupVaultsRequest pageToken */ + pageToken?: (string|null); + + /** FetchUsableBackupVaultsRequest filter */ + filter?: (string|null); + + /** FetchUsableBackupVaultsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a FetchUsableBackupVaultsRequest. */ + class FetchUsableBackupVaultsRequest implements IFetchUsableBackupVaultsRequest { + + /** + * Constructs a new FetchUsableBackupVaultsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest); + + /** FetchUsableBackupVaultsRequest parent. */ + public parent: string; + + /** FetchUsableBackupVaultsRequest pageSize. */ + public pageSize: number; + + /** FetchUsableBackupVaultsRequest pageToken. */ + public pageToken: string; + + /** FetchUsableBackupVaultsRequest filter. */ + public filter: string; + + /** FetchUsableBackupVaultsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchUsableBackupVaultsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @param message FetchUsableBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @param message FetchUsableBackupVaultsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Verifies a FetchUsableBackupVaultsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchUsableBackupVaultsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; + + /** + * Creates a plain object from a FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. + * @param message FetchUsableBackupVaultsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchUsableBackupVaultsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchUsableBackupVaultsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchUsableBackupVaultsResponse. */ + interface IFetchUsableBackupVaultsResponse { + + /** FetchUsableBackupVaultsResponse backupVaults */ + backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); + + /** FetchUsableBackupVaultsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** FetchUsableBackupVaultsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a FetchUsableBackupVaultsResponse. */ + class FetchUsableBackupVaultsResponse implements IFetchUsableBackupVaultsResponse { + + /** + * Constructs a new FetchUsableBackupVaultsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse); + + /** FetchUsableBackupVaultsResponse backupVaults. */ + public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; + + /** FetchUsableBackupVaultsResponse nextPageToken. */ + public nextPageToken: string; + + /** FetchUsableBackupVaultsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchUsableBackupVaultsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @param message FetchUsableBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @param message FetchUsableBackupVaultsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Verifies a FetchUsableBackupVaultsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchUsableBackupVaultsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; + + /** + * Creates a plain object from a FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. + * @param message FetchUsableBackupVaultsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchUsableBackupVaultsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchUsableBackupVaultsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchBackupsForResourceTypeRequest. */ + interface IFetchBackupsForResourceTypeRequest { + + /** FetchBackupsForResourceTypeRequest parent */ + parent?: (string|null); + + /** FetchBackupsForResourceTypeRequest resourceType */ + resourceType?: (string|null); + + /** FetchBackupsForResourceTypeRequest pageSize */ + pageSize?: (number|null); + + /** FetchBackupsForResourceTypeRequest pageToken */ + pageToken?: (string|null); + + /** FetchBackupsForResourceTypeRequest filter */ + filter?: (string|null); + + /** FetchBackupsForResourceTypeRequest orderBy */ + orderBy?: (string|null); + + /** FetchBackupsForResourceTypeRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a FetchBackupsForResourceTypeRequest. */ + class FetchBackupsForResourceTypeRequest implements IFetchBackupsForResourceTypeRequest { + + /** + * Constructs a new FetchBackupsForResourceTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest); + + /** FetchBackupsForResourceTypeRequest parent. */ + public parent: string; + + /** FetchBackupsForResourceTypeRequest resourceType. */ + public resourceType: string; + + /** FetchBackupsForResourceTypeRequest pageSize. */ + public pageSize: number; + + /** FetchBackupsForResourceTypeRequest pageToken. */ + public pageToken: string; + + /** FetchBackupsForResourceTypeRequest filter. */ + public filter: string; + + /** FetchBackupsForResourceTypeRequest orderBy. */ + public orderBy: string; + + /** FetchBackupsForResourceTypeRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new FetchBackupsForResourceTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchBackupsForResourceTypeRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; + + /** + * Encodes the specified FetchBackupsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. + * @param message FetchBackupsForResourceTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchBackupsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. + * @param message FetchBackupsForResourceTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchBackupsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; + + /** + * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchBackupsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; + + /** + * Verifies a FetchBackupsForResourceTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchBackupsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchBackupsForResourceTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; + + /** + * Creates a plain object from a FetchBackupsForResourceTypeRequest message. Also converts values to other types if specified. + * @param message FetchBackupsForResourceTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchBackupsForResourceTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchBackupsForResourceTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchBackupsForResourceTypeResponse. */ + interface IFetchBackupsForResourceTypeResponse { + + /** FetchBackupsForResourceTypeResponse backups */ + backups?: (google.cloud.backupdr.v1.IBackup[]|null); + + /** FetchBackupsForResourceTypeResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a FetchBackupsForResourceTypeResponse. */ + class FetchBackupsForResourceTypeResponse implements IFetchBackupsForResourceTypeResponse { + + /** + * Constructs a new FetchBackupsForResourceTypeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse); + + /** FetchBackupsForResourceTypeResponse backups. */ + public backups: google.cloud.backupdr.v1.IBackup[]; + + /** FetchBackupsForResourceTypeResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new FetchBackupsForResourceTypeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchBackupsForResourceTypeResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; + + /** + * Encodes the specified FetchBackupsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. + * @param message FetchBackupsForResourceTypeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchBackupsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. + * @param message FetchBackupsForResourceTypeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchBackupsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; + + /** + * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchBackupsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; + + /** + * Verifies a FetchBackupsForResourceTypeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchBackupsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchBackupsForResourceTypeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; + + /** + * Creates a plain object from a FetchBackupsForResourceTypeResponse message. Also converts values to other types if specified. + * @param message FetchBackupsForResourceTypeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchBackupsForResourceTypeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchBackupsForResourceTypeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupVaultRequest. */ + interface IGetBackupVaultRequest { + + /** GetBackupVaultRequest name */ + name?: (string|null); + + /** GetBackupVaultRequest view */ + view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); + } + + /** Represents a GetBackupVaultRequest. */ + class GetBackupVaultRequest implements IGetBackupVaultRequest { + + /** + * Constructs a new GetBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest); + + /** GetBackupVaultRequest name. */ + public name: string; + + /** GetBackupVaultRequest view. */ + public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); + + /** + * Creates a new GetBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @param message GetBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @param message GetBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Verifies a GetBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupVaultRequest; + + /** + * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. + * @param message GetBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupVaultRequest. */ + interface IUpdateBackupVaultRequest { + + /** UpdateBackupVaultRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupVaultRequest backupVault */ + backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** UpdateBackupVaultRequest requestId */ + requestId?: (string|null); + + /** UpdateBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + + /** UpdateBackupVaultRequest force */ + force?: (boolean|null); + + /** UpdateBackupVaultRequest forceUpdateAccessRestriction */ + forceUpdateAccessRestriction?: (boolean|null); + } + + /** Represents an UpdateBackupVaultRequest. */ + class UpdateBackupVaultRequest implements IUpdateBackupVaultRequest { + + /** + * Constructs a new UpdateBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest); + + /** UpdateBackupVaultRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupVaultRequest backupVault. */ + public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); + + /** UpdateBackupVaultRequest requestId. */ + public requestId: string; + + /** UpdateBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** UpdateBackupVaultRequest force. */ + public force: boolean; + + /** UpdateBackupVaultRequest forceUpdateAccessRestriction. */ + public forceUpdateAccessRestriction: boolean; + + /** + * Creates a new UpdateBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @param message UpdateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @param message UpdateBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Verifies an UpdateBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupVaultRequest; + + /** + * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. + * @param message UpdateBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupVaultRequest. */ + interface IDeleteBackupVaultRequest { + + /** DeleteBackupVaultRequest name */ + name?: (string|null); + + /** DeleteBackupVaultRequest requestId */ + requestId?: (string|null); + + /** DeleteBackupVaultRequest force */ + force?: (boolean|null); + + /** DeleteBackupVaultRequest etag */ + etag?: (string|null); + + /** DeleteBackupVaultRequest validateOnly */ + validateOnly?: (boolean|null); + + /** DeleteBackupVaultRequest allowMissing */ + allowMissing?: (boolean|null); + + /** DeleteBackupVaultRequest ignoreBackupPlanReferences */ + ignoreBackupPlanReferences?: (boolean|null); + } + + /** Represents a DeleteBackupVaultRequest. */ + class DeleteBackupVaultRequest implements IDeleteBackupVaultRequest { + + /** + * Constructs a new DeleteBackupVaultRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest); + + /** DeleteBackupVaultRequest name. */ + public name: string; + + /** DeleteBackupVaultRequest requestId. */ + public requestId: string; + + /** DeleteBackupVaultRequest force. */ + public force: boolean; + + /** DeleteBackupVaultRequest etag. */ + public etag: string; + + /** DeleteBackupVaultRequest validateOnly. */ + public validateOnly: boolean; + + /** DeleteBackupVaultRequest allowMissing. */ + public allowMissing: boolean; + + /** DeleteBackupVaultRequest ignoreBackupPlanReferences. */ + public ignoreBackupPlanReferences: boolean; + + /** + * Creates a new DeleteBackupVaultRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupVaultRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @param message DeleteBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @param message DeleteBackupVaultRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Verifies a DeleteBackupVaultRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupVaultRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupVaultRequest; + + /** + * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. + * @param message DeleteBackupVaultRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupVaultRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupVaultRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesRequest. */ + interface IListDataSourcesRequest { + + /** ListDataSourcesRequest parent */ + parent?: (string|null); + + /** ListDataSourcesRequest pageSize */ + pageSize?: (number|null); + + /** ListDataSourcesRequest pageToken */ + pageToken?: (string|null); + + /** ListDataSourcesRequest filter */ + filter?: (string|null); + + /** ListDataSourcesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDataSourcesRequest. */ + class ListDataSourcesRequest implements IListDataSourcesRequest { + + /** + * Constructs a new ListDataSourcesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest); + + /** ListDataSourcesRequest parent. */ + public parent: string; + + /** ListDataSourcesRequest pageSize. */ + public pageSize: number; + + /** ListDataSourcesRequest pageToken. */ + public pageToken: string; + + /** ListDataSourcesRequest filter. */ + public filter: string; + + /** ListDataSourcesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @param message ListDataSourcesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Verifies a ListDataSourcesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesRequest; + + /** + * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. + * @param message ListDataSourcesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourcesResponse. */ + interface IListDataSourcesResponse { + + /** ListDataSourcesResponse dataSources */ + dataSources?: (google.cloud.backupdr.v1.IDataSource[]|null); + + /** ListDataSourcesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDataSourcesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDataSourcesResponse. */ + class ListDataSourcesResponse implements IListDataSourcesResponse { + + /** + * Constructs a new ListDataSourcesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse); + + /** ListDataSourcesResponse dataSources. */ + public dataSources: google.cloud.backupdr.v1.IDataSource[]; + + /** ListDataSourcesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDataSourcesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourcesResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @param message ListDataSourcesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Verifies a ListDataSourcesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourcesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesResponse; + + /** + * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. + * @param message ListDataSourcesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourcesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataSourceRequest. */ + interface IGetDataSourceRequest { + + /** GetDataSourceRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSourceRequest. */ + class GetDataSourceRequest implements IGetDataSourceRequest { + + /** + * Constructs a new GetDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest); + + /** GetDataSourceRequest name. */ + public name: string; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSourceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @param message GetDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Verifies a GetDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetDataSourceRequest; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @param message GetDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateDataSourceRequest. */ + interface IUpdateDataSourceRequest { + + /** UpdateDataSourceRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataSourceRequest dataSource */ + dataSource?: (google.cloud.backupdr.v1.IDataSource|null); + + /** UpdateDataSourceRequest requestId */ + requestId?: (string|null); + + /** UpdateDataSourceRequest allowMissing */ + allowMissing?: (boolean|null); + } + + /** Represents an UpdateDataSourceRequest. */ + class UpdateDataSourceRequest implements IUpdateDataSourceRequest { + + /** + * Constructs a new UpdateDataSourceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest); + + /** UpdateDataSourceRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateDataSourceRequest dataSource. */ + public dataSource?: (google.cloud.backupdr.v1.IDataSource|null); + + /** UpdateDataSourceRequest requestId. */ + public requestId: string; + + /** UpdateDataSourceRequest allowMissing. */ + public allowMissing: boolean; + + /** + * Creates a new UpdateDataSourceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateDataSourceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @param message UpdateDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @param message UpdateDataSourceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Verifies an UpdateDataSourceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateDataSourceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateDataSourceRequest; + + /** + * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. + * @param message UpdateDataSourceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateDataSourceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateDataSourceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsRequest. */ + interface IListBackupsRequest { + + /** ListBackupsRequest parent */ + parent?: (string|null); + + /** ListBackupsRequest pageSize */ + pageSize?: (number|null); + + /** ListBackupsRequest pageToken */ + pageToken?: (string|null); + + /** ListBackupsRequest filter */ + filter?: (string|null); + + /** ListBackupsRequest orderBy */ + orderBy?: (string|null); + + /** ListBackupsRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a ListBackupsRequest. */ + class ListBackupsRequest implements IListBackupsRequest { + + /** + * Constructs a new ListBackupsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupsRequest); + + /** ListBackupsRequest parent. */ + public parent: string; + + /** ListBackupsRequest pageSize. */ + public pageSize: number; + + /** ListBackupsRequest pageToken. */ + public pageToken: string; + + /** ListBackupsRequest filter. */ + public filter: string; + + /** ListBackupsRequest orderBy. */ + public orderBy: string; + + /** ListBackupsRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupsRequest): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @param message ListBackupsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Verifies a ListBackupsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupsRequest; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @param message ListBackupsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListBackupsResponse. */ + interface IListBackupsResponse { + + /** ListBackupsResponse backups */ + backups?: (google.cloud.backupdr.v1.IBackup[]|null); + + /** ListBackupsResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListBackupsResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListBackupsResponse. */ + class ListBackupsResponse implements IListBackupsResponse { + + /** + * Constructs a new ListBackupsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListBackupsResponse); + + /** ListBackupsResponse backups. */ + public backups: google.cloud.backupdr.v1.IBackup[]; + + /** ListBackupsResponse nextPageToken. */ + public nextPageToken: string; + + /** ListBackupsResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListBackupsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListBackupsResponse): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @param message ListBackupsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Verifies a ListBackupsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListBackupsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupsResponse; + + /** + * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. + * @param message ListBackupsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListBackupsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListBackupsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetBackupRequest. */ + interface IGetBackupRequest { + + /** GetBackupRequest name */ + name?: (string|null); + + /** GetBackupRequest view */ + view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); + } + + /** Represents a GetBackupRequest. */ + class GetBackupRequest implements IGetBackupRequest { + + /** + * Constructs a new GetBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetBackupRequest); + + /** GetBackupRequest name. */ + public name: string; + + /** GetBackupRequest view. */ + public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetBackupRequest): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @param message GetBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Verifies a GetBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupRequest; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @param message GetBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an UpdateBackupRequest. */ + interface IUpdateBackupRequest { + + /** UpdateBackupRequest updateMask */ + updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup */ + backup?: (google.cloud.backupdr.v1.IBackup|null); + + /** UpdateBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents an UpdateBackupRequest. */ + class UpdateBackupRequest implements IUpdateBackupRequest { + + /** + * Constructs a new UpdateBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest); + + /** UpdateBackupRequest updateMask. */ + public updateMask?: (google.protobuf.IFieldMask|null); + + /** UpdateBackupRequest backup. */ + public backup?: (google.cloud.backupdr.v1.IBackup|null); + + /** UpdateBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns UpdateBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @param message UpdateBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Verifies an UpdateBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UpdateBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupRequest; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @param message UpdateBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for UpdateBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DeleteBackupRequest. */ + interface IDeleteBackupRequest { + + /** DeleteBackupRequest name */ + name?: (string|null); + + /** DeleteBackupRequest requestId */ + requestId?: (string|null); + } + + /** Represents a DeleteBackupRequest. */ + class DeleteBackupRequest implements IDeleteBackupRequest { + + /** + * Constructs a new DeleteBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest); + + /** DeleteBackupRequest name. */ + public name: string; + + /** DeleteBackupRequest requestId. */ + public requestId: string; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns DeleteBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @param message DeleteBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Verifies a DeleteBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DeleteBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupRequest; + + /** + * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. + * @param message DeleteBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DeleteBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DeleteBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreBackupRequest. */ + interface IRestoreBackupRequest { + + /** RestoreBackupRequest name */ + name?: (string|null); + + /** RestoreBackupRequest requestId */ + requestId?: (string|null); + + /** RestoreBackupRequest computeInstanceTargetEnvironment */ + computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); + + /** RestoreBackupRequest diskTargetEnvironment */ + diskTargetEnvironment?: (google.cloud.backupdr.v1.IDiskTargetEnvironment|null); + + /** RestoreBackupRequest regionDiskTargetEnvironment */ + regionDiskTargetEnvironment?: (google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null); + + /** RestoreBackupRequest computeInstanceRestoreProperties */ + computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); + + /** RestoreBackupRequest diskRestoreProperties */ + diskRestoreProperties?: (google.cloud.backupdr.v1.IDiskRestoreProperties|null); + + /** RestoreBackupRequest clearOverridesFieldMask */ + clearOverridesFieldMask?: (google.protobuf.IFieldMask|null); + } + + /** Represents a RestoreBackupRequest. */ + class RestoreBackupRequest implements IRestoreBackupRequest { + + /** + * Constructs a new RestoreBackupRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest); + + /** RestoreBackupRequest name. */ + public name: string; + + /** RestoreBackupRequest requestId. */ + public requestId: string; + + /** RestoreBackupRequest computeInstanceTargetEnvironment. */ + public computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); + + /** RestoreBackupRequest diskTargetEnvironment. */ + public diskTargetEnvironment?: (google.cloud.backupdr.v1.IDiskTargetEnvironment|null); + + /** RestoreBackupRequest regionDiskTargetEnvironment. */ + public regionDiskTargetEnvironment?: (google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null); + + /** RestoreBackupRequest computeInstanceRestoreProperties. */ + public computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); + + /** RestoreBackupRequest diskRestoreProperties. */ + public diskRestoreProperties?: (google.cloud.backupdr.v1.IDiskRestoreProperties|null); + + /** RestoreBackupRequest clearOverridesFieldMask. */ + public clearOverridesFieldMask?: (google.protobuf.IFieldMask|null); + + /** RestoreBackupRequest targetEnvironment. */ + public targetEnvironment?: ("computeInstanceTargetEnvironment"|"diskTargetEnvironment"|"regionDiskTargetEnvironment"); + + /** RestoreBackupRequest instanceProperties. */ + public instanceProperties?: ("computeInstanceRestoreProperties"|"diskRestoreProperties"); + + /** + * Creates a new RestoreBackupRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreBackupRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @param message RestoreBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @param message RestoreBackupRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Verifies a RestoreBackupRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreBackupRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupRequest; + + /** + * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. + * @param message RestoreBackupRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RestoreBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreBackupRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreBackupRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RestoreBackupResponse. */ + interface IRestoreBackupResponse { + + /** RestoreBackupResponse targetResource */ + targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); + } + + /** Represents a RestoreBackupResponse. */ + class RestoreBackupResponse implements IRestoreBackupResponse { + + /** + * Constructs a new RestoreBackupResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse); + + /** RestoreBackupResponse targetResource. */ + public targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); + + /** + * Creates a new RestoreBackupResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns RestoreBackupResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @param message RestoreBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @param message RestoreBackupResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Verifies a RestoreBackupResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RestoreBackupResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupResponse; + + /** + * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. + * @param message RestoreBackupResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RestoreBackupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RestoreBackupResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RestoreBackupResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a TargetResource. */ + interface ITargetResource { + + /** TargetResource gcpResource */ + gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); + } + + /** Represents a TargetResource. */ + class TargetResource implements ITargetResource { + + /** + * Constructs a new TargetResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITargetResource); + + /** TargetResource gcpResource. */ + public gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); + + /** TargetResource targetResourceInfo. */ + public targetResourceInfo?: "gcpResource"; + + /** + * Creates a new TargetResource instance using the specified properties. + * @param [properties] Properties to set + * @returns TargetResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITargetResource): google.cloud.backupdr.v1.TargetResource; + + /** + * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @param message TargetResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @param message TargetResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a TargetResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TargetResource; + + /** + * Decodes a TargetResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TargetResource; + + /** + * Verifies a TargetResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns TargetResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TargetResource; + + /** + * Creates a plain object from a TargetResource message. Also converts values to other types if specified. + * @param message TargetResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.TargetResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this TargetResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for TargetResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GcpResource. */ + interface IGcpResource { + + /** GcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** GcpResource location */ + location?: (string|null); + + /** GcpResource type */ + type?: (string|null); + } + + /** Represents a GcpResource. */ + class GcpResource implements IGcpResource { + + /** + * Constructs a new GcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGcpResource); + + /** GcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** GcpResource location. */ + public location: string; + + /** GcpResource type. */ + public type: string; + + /** + * Creates a new GcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns GcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGcpResource): google.cloud.backupdr.v1.GcpResource; + + /** + * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @param message GcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @param message GcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpResource; + + /** + * Decodes a GcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpResource; + + /** + * Verifies a GcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpResource; + + /** + * Creates a plain object from a GcpResource message. Also converts values to other types if specified. + * @param message GcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupGcpResource. */ + interface IBackupGcpResource { + + /** BackupGcpResource gcpResourcename */ + gcpResourcename?: (string|null); + + /** BackupGcpResource location */ + location?: (string|null); + + /** BackupGcpResource type */ + type?: (string|null); + } + + /** Represents a BackupGcpResource. */ + class BackupGcpResource implements IBackupGcpResource { + + /** + * Constructs a new BackupGcpResource. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupGcpResource); + + /** BackupGcpResource gcpResourcename. */ + public gcpResourcename: string; + + /** BackupGcpResource location. */ + public location: string; + + /** BackupGcpResource type. */ + public type: string; + + /** + * Creates a new BackupGcpResource instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupGcpResource instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupGcpResource): google.cloud.backupdr.v1.BackupGcpResource; + + /** + * Encodes the specified BackupGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. + * @param message BackupGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. + * @param message BackupGcpResource message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupGcpResource message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupGcpResource; + + /** + * Decodes a BackupGcpResource message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupGcpResource; + + /** + * Verifies a BackupGcpResource message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupGcpResource message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupGcpResource + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupGcpResource; + + /** + * Creates a plain object from a BackupGcpResource message. Also converts values to other types if specified. + * @param message BackupGcpResource + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupGcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupGcpResource to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupGcpResource + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** BackupConfigState enum. */ + enum BackupConfigState { + BACKUP_CONFIG_STATE_UNSPECIFIED = 0, + ACTIVE = 1, + PASSIVE = 2 + } + + /** BackupView enum. */ + enum BackupView { + BACKUP_VIEW_UNSPECIFIED = 0, + BACKUP_VIEW_BASIC = 1, + BACKUP_VIEW_FULL = 2 + } + + /** BackupVaultView enum. */ + enum BackupVaultView { + BACKUP_VAULT_VIEW_UNSPECIFIED = 0, + BACKUP_VAULT_VIEW_BASIC = 1, + BACKUP_VAULT_VIEW_FULL = 2 + } + + /** Properties of a BackupApplianceBackupProperties. */ + interface IBackupApplianceBackupProperties { + + /** BackupApplianceBackupProperties generationId */ + generationId?: (number|null); + + /** BackupApplianceBackupProperties finalizeTime */ + finalizeTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeStartTime */ + recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeEndTime */ + recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupApplianceBackupProperties. */ + class BackupApplianceBackupProperties implements IBackupApplianceBackupProperties { + + /** + * Constructs a new BackupApplianceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties); + + /** BackupApplianceBackupProperties generationId. */ + public generationId?: (number|null); + + /** BackupApplianceBackupProperties finalizeTime. */ + public finalizeTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeStartTime. */ + public recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); + + /** BackupApplianceBackupProperties recoveryRangeEndTime. */ + public recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BackupApplianceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupApplianceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @param message BackupApplianceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @param message BackupApplianceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Verifies a BackupApplianceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupApplianceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupProperties; + + /** + * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. + * @param message BackupApplianceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupApplianceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupApplianceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DiskTargetEnvironment. */ + interface IDiskTargetEnvironment { + + /** DiskTargetEnvironment project */ + project?: (string|null); + + /** DiskTargetEnvironment zone */ + zone?: (string|null); + } + + /** Represents a DiskTargetEnvironment. */ + class DiskTargetEnvironment implements IDiskTargetEnvironment { + + /** + * Constructs a new DiskTargetEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDiskTargetEnvironment); + + /** DiskTargetEnvironment project. */ + public project: string; + + /** DiskTargetEnvironment zone. */ + public zone: string; + + /** + * Creates a new DiskTargetEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskTargetEnvironment instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDiskTargetEnvironment): google.cloud.backupdr.v1.DiskTargetEnvironment; + + /** + * Encodes the specified DiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. + * @param message DiskTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. + * @param message DiskTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskTargetEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskTargetEnvironment; + + /** + * Decodes a DiskTargetEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskTargetEnvironment; + + /** + * Verifies a DiskTargetEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskTargetEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskTargetEnvironment; + + /** + * Creates a plain object from a DiskTargetEnvironment message. Also converts values to other types if specified. + * @param message DiskTargetEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DiskTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskTargetEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskTargetEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RegionDiskTargetEnvironment. */ + interface IRegionDiskTargetEnvironment { + + /** RegionDiskTargetEnvironment project */ + project?: (string|null); + + /** RegionDiskTargetEnvironment region */ + region?: (string|null); + + /** RegionDiskTargetEnvironment replicaZones */ + replicaZones?: (string[]|null); + } + + /** Represents a RegionDiskTargetEnvironment. */ + class RegionDiskTargetEnvironment implements IRegionDiskTargetEnvironment { + + /** + * Constructs a new RegionDiskTargetEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment); + + /** RegionDiskTargetEnvironment project. */ + public project: string; + + /** RegionDiskTargetEnvironment region. */ + public region: string; + + /** RegionDiskTargetEnvironment replicaZones. */ + public replicaZones: string[]; + + /** + * Creates a new RegionDiskTargetEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns RegionDiskTargetEnvironment instance + */ + public static create(properties?: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; + + /** + * Encodes the specified RegionDiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. + * @param message RegionDiskTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RegionDiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. + * @param message RegionDiskTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RegionDiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; + + /** + * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RegionDiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; + + /** + * Verifies a RegionDiskTargetEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RegionDiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RegionDiskTargetEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; + + /** + * Creates a plain object from a RegionDiskTargetEnvironment message. Also converts values to other types if specified. + * @param message RegionDiskTargetEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.RegionDiskTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RegionDiskTargetEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RegionDiskTargetEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DiskRestoreProperties. */ + interface IDiskRestoreProperties { + + /** DiskRestoreProperties name */ + name?: (string|null); + + /** DiskRestoreProperties description */ + description?: (string|null); + + /** DiskRestoreProperties sizeGb */ + sizeGb?: (number|Long|string|null); + + /** DiskRestoreProperties licenses */ + licenses?: (string[]|null); + + /** DiskRestoreProperties guestOsFeature */ + guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); + + /** DiskRestoreProperties diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** DiskRestoreProperties physicalBlockSizeBytes */ + physicalBlockSizeBytes?: (number|Long|string|null); + + /** DiskRestoreProperties provisionedIops */ + provisionedIops?: (number|Long|string|null); + + /** DiskRestoreProperties provisionedThroughput */ + provisionedThroughput?: (number|Long|string|null); + + /** DiskRestoreProperties enableConfidentialCompute */ + enableConfidentialCompute?: (boolean|null); + + /** DiskRestoreProperties storagePool */ + storagePool?: (string|null); + + /** DiskRestoreProperties accessMode */ + accessMode?: (google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null); + + /** DiskRestoreProperties architecture */ + architecture?: (google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null); + + /** DiskRestoreProperties resourcePolicy */ + resourcePolicy?: (string[]|null); + + /** DiskRestoreProperties type */ + type?: (string|null); + + /** DiskRestoreProperties labels */ + labels?: ({ [k: string]: string }|null); + + /** DiskRestoreProperties resourceManagerTags */ + resourceManagerTags?: ({ [k: string]: string }|null); + } + + /** Represents a DiskRestoreProperties. */ + class DiskRestoreProperties implements IDiskRestoreProperties { + + /** + * Constructs a new DiskRestoreProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDiskRestoreProperties); + + /** DiskRestoreProperties name. */ + public name?: (string|null); + + /** DiskRestoreProperties description. */ + public description?: (string|null); + + /** DiskRestoreProperties sizeGb. */ + public sizeGb?: (number|Long|string|null); + + /** DiskRestoreProperties licenses. */ + public licenses: string[]; + + /** DiskRestoreProperties guestOsFeature. */ + public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; + + /** DiskRestoreProperties diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** DiskRestoreProperties physicalBlockSizeBytes. */ + public physicalBlockSizeBytes?: (number|Long|string|null); + + /** DiskRestoreProperties provisionedIops. */ + public provisionedIops?: (number|Long|string|null); + + /** DiskRestoreProperties provisionedThroughput. */ + public provisionedThroughput?: (number|Long|string|null); + + /** DiskRestoreProperties enableConfidentialCompute. */ + public enableConfidentialCompute?: (boolean|null); + + /** DiskRestoreProperties storagePool. */ + public storagePool?: (string|null); + + /** DiskRestoreProperties accessMode. */ + public accessMode?: (google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null); + + /** DiskRestoreProperties architecture. */ + public architecture?: (google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null); + + /** DiskRestoreProperties resourcePolicy. */ + public resourcePolicy: string[]; + + /** DiskRestoreProperties type. */ + public type?: (string|null); + + /** DiskRestoreProperties labels. */ + public labels: { [k: string]: string }; + + /** DiskRestoreProperties resourceManagerTags. */ + public resourceManagerTags: { [k: string]: string }; + + /** + * Creates a new DiskRestoreProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskRestoreProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDiskRestoreProperties): google.cloud.backupdr.v1.DiskRestoreProperties; + + /** + * Encodes the specified DiskRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. + * @param message DiskRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDiskRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. + * @param message DiskRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskRestoreProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskRestoreProperties; + + /** + * Decodes a DiskRestoreProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskRestoreProperties; + + /** + * Verifies a DiskRestoreProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskRestoreProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskRestoreProperties; + + /** + * Creates a plain object from a DiskRestoreProperties message. Also converts values to other types if specified. + * @param message DiskRestoreProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DiskRestoreProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskRestoreProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskRestoreProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiskRestoreProperties { + + /** AccessMode enum. */ + enum AccessMode { + READ_WRITE_SINGLE = 0, + READ_WRITE_MANY = 1, + READ_ONLY_MANY = 2 + } + + /** Architecture enum. */ + enum Architecture { + ARCHITECTURE_UNSPECIFIED = 0, + X86_64 = 1, + ARM64 = 2 + } + } + + /** Properties of a DiskBackupProperties. */ + interface IDiskBackupProperties { + + /** DiskBackupProperties description */ + description?: (string|null); + + /** DiskBackupProperties licenses */ + licenses?: (string[]|null); + + /** DiskBackupProperties guestOsFeature */ + guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); + + /** DiskBackupProperties architecture */ + architecture?: (google.cloud.backupdr.v1.DiskBackupProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null); + + /** DiskBackupProperties type */ + type?: (string|null); + + /** DiskBackupProperties sizeGb */ + sizeGb?: (number|Long|string|null); + + /** DiskBackupProperties region */ + region?: (string|null); + + /** DiskBackupProperties zone */ + zone?: (string|null); + + /** DiskBackupProperties replicaZones */ + replicaZones?: (string[]|null); + + /** DiskBackupProperties sourceDisk */ + sourceDisk?: (string|null); + } + + /** Represents a DiskBackupProperties. */ + class DiskBackupProperties implements IDiskBackupProperties { + + /** + * Constructs a new DiskBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDiskBackupProperties); + + /** DiskBackupProperties description. */ + public description?: (string|null); + + /** DiskBackupProperties licenses. */ + public licenses: string[]; + + /** DiskBackupProperties guestOsFeature. */ + public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; + + /** DiskBackupProperties architecture. */ + public architecture?: (google.cloud.backupdr.v1.DiskBackupProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null); + + /** DiskBackupProperties type. */ + public type?: (string|null); + + /** DiskBackupProperties sizeGb. */ + public sizeGb?: (number|Long|string|null); + + /** DiskBackupProperties region. */ + public region?: (string|null); + + /** DiskBackupProperties zone. */ + public zone?: (string|null); + + /** DiskBackupProperties replicaZones. */ + public replicaZones: string[]; + + /** DiskBackupProperties sourceDisk. */ + public sourceDisk?: (string|null); + + /** + * Creates a new DiskBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDiskBackupProperties): google.cloud.backupdr.v1.DiskBackupProperties; + + /** + * Encodes the specified DiskBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. + * @param message DiskBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDiskBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. + * @param message DiskBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskBackupProperties; + + /** + * Decodes a DiskBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskBackupProperties; + + /** + * Verifies a DiskBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskBackupProperties; + + /** + * Creates a plain object from a DiskBackupProperties message. Also converts values to other types if specified. + * @param message DiskBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DiskBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DiskBackupProperties { + + /** Architecture enum. */ + enum Architecture { + ARCHITECTURE_UNSPECIFIED = 0, + X86_64 = 1, + ARM64 = 2 + } + } + + /** Properties of a DiskDataSourceProperties. */ + interface IDiskDataSourceProperties { + + /** DiskDataSourceProperties name */ + name?: (string|null); + + /** DiskDataSourceProperties description */ + description?: (string|null); + + /** DiskDataSourceProperties type */ + type?: (string|null); + + /** DiskDataSourceProperties sizeGb */ + sizeGb?: (number|Long|string|null); + } + + /** Represents a DiskDataSourceProperties. */ + class DiskDataSourceProperties implements IDiskDataSourceProperties { + + /** + * Constructs a new DiskDataSourceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDiskDataSourceProperties); + + /** DiskDataSourceProperties name. */ + public name: string; + + /** DiskDataSourceProperties description. */ + public description: string; + + /** DiskDataSourceProperties type. */ + public type: string; + + /** DiskDataSourceProperties sizeGb. */ + public sizeGb: (number|Long|string); + + /** + * Creates a new DiskDataSourceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns DiskDataSourceProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDiskDataSourceProperties): google.cloud.backupdr.v1.DiskDataSourceProperties; + + /** + * Encodes the specified DiskDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. + * @param message DiskDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDiskDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DiskDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. + * @param message DiskDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DiskDataSourceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DiskDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskDataSourceProperties; + + /** + * Decodes a DiskDataSourceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DiskDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskDataSourceProperties; + + /** + * Verifies a DiskDataSourceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DiskDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DiskDataSourceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskDataSourceProperties; + + /** + * Creates a plain object from a DiskDataSourceProperties message. Also converts values to other types if specified. + * @param message DiskDataSourceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DiskDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DiskDataSourceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DiskDataSourceProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceBackupProperties. */ + interface IComputeInstanceBackupProperties { + + /** ComputeInstanceBackupProperties description */ + description?: (string|null); + + /** ComputeInstanceBackupProperties tags */ + tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceBackupProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceBackupProperties canIpForward */ + canIpForward?: (boolean|null); + + /** ComputeInstanceBackupProperties networkInterface */ + networkInterface?: (google.cloud.backupdr.v1.INetworkInterface[]|null); + + /** ComputeInstanceBackupProperties disk */ + disk?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); + + /** ComputeInstanceBackupProperties metadata */ + metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceBackupProperties serviceAccount */ + serviceAccount?: (google.cloud.backupdr.v1.IServiceAccount[]|null); + + /** ComputeInstanceBackupProperties scheduling */ + scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceBackupProperties guestAccelerator */ + guestAccelerator?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); + + /** ComputeInstanceBackupProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** ComputeInstanceBackupProperties keyRevocationActionType */ + keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceBackupProperties sourceInstance */ + sourceInstance?: (string|null); + + /** ComputeInstanceBackupProperties labels */ + labels?: ({ [k: string]: string }|null); + } + + /** Represents a ComputeInstanceBackupProperties. */ + class ComputeInstanceBackupProperties implements IComputeInstanceBackupProperties { + + /** + * Constructs a new ComputeInstanceBackupProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties); + + /** ComputeInstanceBackupProperties description. */ + public description?: (string|null); + + /** ComputeInstanceBackupProperties tags. */ + public tags?: (google.cloud.backupdr.v1.ITags|null); + + /** ComputeInstanceBackupProperties machineType. */ + public machineType?: (string|null); + + /** ComputeInstanceBackupProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** ComputeInstanceBackupProperties networkInterface. */ + public networkInterface: google.cloud.backupdr.v1.INetworkInterface[]; + + /** ComputeInstanceBackupProperties disk. */ + public disk: google.cloud.backupdr.v1.IAttachedDisk[]; + + /** ComputeInstanceBackupProperties metadata. */ + public metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceBackupProperties serviceAccount. */ + public serviceAccount: google.cloud.backupdr.v1.IServiceAccount[]; + + /** ComputeInstanceBackupProperties scheduling. */ + public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceBackupProperties guestAccelerator. */ + public guestAccelerator: google.cloud.backupdr.v1.IAcceleratorConfig[]; + + /** ComputeInstanceBackupProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** ComputeInstanceBackupProperties keyRevocationActionType. */ + public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceBackupProperties sourceInstance. */ + public sourceInstance?: (string|null); + + /** ComputeInstanceBackupProperties labels. */ + public labels: { [k: string]: string }; + + /** + * Creates a new ComputeInstanceBackupProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceBackupProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @param message ComputeInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @param message ComputeInstanceBackupProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Verifies a ComputeInstanceBackupProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceBackupProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; + + /** + * Creates a plain object from a ComputeInstanceBackupProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceBackupProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceBackupProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceBackupProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceRestoreProperties. */ + interface IComputeInstanceRestoreProperties { + + /** ComputeInstanceRestoreProperties name */ + name?: (string|null); + + /** ComputeInstanceRestoreProperties advancedMachineFeatures */ + advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); + + /** ComputeInstanceRestoreProperties canIpForward */ + canIpForward?: (boolean|null); + + /** ComputeInstanceRestoreProperties confidentialInstanceConfig */ + confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); + + /** ComputeInstanceRestoreProperties deletionProtection */ + deletionProtection?: (boolean|null); + + /** ComputeInstanceRestoreProperties description */ + description?: (string|null); + + /** ComputeInstanceRestoreProperties disks */ + disks?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); + + /** ComputeInstanceRestoreProperties displayDevice */ + displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); + + /** ComputeInstanceRestoreProperties guestAccelerators */ + guestAccelerators?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); + + /** ComputeInstanceRestoreProperties hostname */ + hostname?: (string|null); + + /** ComputeInstanceRestoreProperties instanceEncryptionKey */ + instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** ComputeInstanceRestoreProperties keyRevocationActionType */ + keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceRestoreProperties labels */ + labels?: ({ [k: string]: string }|null); + + /** ComputeInstanceRestoreProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceRestoreProperties metadata */ + metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceRestoreProperties minCpuPlatform */ + minCpuPlatform?: (string|null); + + /** ComputeInstanceRestoreProperties networkInterfaces */ + networkInterfaces?: (google.cloud.backupdr.v1.INetworkInterface[]|null); + + /** ComputeInstanceRestoreProperties networkPerformanceConfig */ + networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); + + /** ComputeInstanceRestoreProperties params */ + params?: (google.cloud.backupdr.v1.IInstanceParams|null); + + /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess */ + privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); + + /** ComputeInstanceRestoreProperties allocationAffinity */ + allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); + + /** ComputeInstanceRestoreProperties resourcePolicies */ + resourcePolicies?: (string[]|null); + + /** ComputeInstanceRestoreProperties scheduling */ + scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceRestoreProperties serviceAccounts */ + serviceAccounts?: (google.cloud.backupdr.v1.IServiceAccount[]|null); + + /** ComputeInstanceRestoreProperties tags */ + tags?: (google.cloud.backupdr.v1.ITags|null); + } + + /** Represents a ComputeInstanceRestoreProperties. */ + class ComputeInstanceRestoreProperties implements IComputeInstanceRestoreProperties { + + /** + * Constructs a new ComputeInstanceRestoreProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties); + + /** ComputeInstanceRestoreProperties name. */ + public name?: (string|null); + + /** ComputeInstanceRestoreProperties advancedMachineFeatures. */ + public advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); + + /** ComputeInstanceRestoreProperties canIpForward. */ + public canIpForward?: (boolean|null); + + /** ComputeInstanceRestoreProperties confidentialInstanceConfig. */ + public confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); + + /** ComputeInstanceRestoreProperties deletionProtection. */ + public deletionProtection?: (boolean|null); + + /** ComputeInstanceRestoreProperties description. */ + public description?: (string|null); + + /** ComputeInstanceRestoreProperties disks. */ + public disks: google.cloud.backupdr.v1.IAttachedDisk[]; + + /** ComputeInstanceRestoreProperties displayDevice. */ + public displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); + + /** ComputeInstanceRestoreProperties guestAccelerators. */ + public guestAccelerators: google.cloud.backupdr.v1.IAcceleratorConfig[]; + + /** ComputeInstanceRestoreProperties hostname. */ + public hostname?: (string|null); + + /** ComputeInstanceRestoreProperties instanceEncryptionKey. */ + public instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** ComputeInstanceRestoreProperties keyRevocationActionType. */ + public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); + + /** ComputeInstanceRestoreProperties labels. */ + public labels: { [k: string]: string }; + + /** ComputeInstanceRestoreProperties machineType. */ + public machineType?: (string|null); + + /** ComputeInstanceRestoreProperties metadata. */ + public metadata?: (google.cloud.backupdr.v1.IMetadata|null); + + /** ComputeInstanceRestoreProperties minCpuPlatform. */ + public minCpuPlatform?: (string|null); + + /** ComputeInstanceRestoreProperties networkInterfaces. */ + public networkInterfaces: google.cloud.backupdr.v1.INetworkInterface[]; + + /** ComputeInstanceRestoreProperties networkPerformanceConfig. */ + public networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); + + /** ComputeInstanceRestoreProperties params. */ + public params?: (google.cloud.backupdr.v1.IInstanceParams|null); + + /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess. */ + public privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); + + /** ComputeInstanceRestoreProperties allocationAffinity. */ + public allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); + + /** ComputeInstanceRestoreProperties resourcePolicies. */ + public resourcePolicies: string[]; + + /** ComputeInstanceRestoreProperties scheduling. */ + public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); + + /** ComputeInstanceRestoreProperties serviceAccounts. */ + public serviceAccounts: google.cloud.backupdr.v1.IServiceAccount[]; + + /** ComputeInstanceRestoreProperties tags. */ + public tags?: (google.cloud.backupdr.v1.ITags|null); + + /** + * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceRestoreProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @param message ComputeInstanceRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @param message ComputeInstanceRestoreProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Verifies a ComputeInstanceRestoreProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceRestoreProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; + + /** + * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceRestoreProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceRestoreProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceRestoreProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceRestoreProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ComputeInstanceRestoreProperties { + + /** InstancePrivateIpv6GoogleAccess enum. */ + enum InstancePrivateIpv6GoogleAccess { + INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0, + INHERIT_FROM_SUBNETWORK = 1, + ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2, + ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3 + } + } + + /** Properties of a ComputeInstanceTargetEnvironment. */ + interface IComputeInstanceTargetEnvironment { + + /** ComputeInstanceTargetEnvironment project */ + project?: (string|null); + + /** ComputeInstanceTargetEnvironment zone */ + zone?: (string|null); + } + + /** Represents a ComputeInstanceTargetEnvironment. */ + class ComputeInstanceTargetEnvironment implements IComputeInstanceTargetEnvironment { + + /** + * Constructs a new ComputeInstanceTargetEnvironment. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment); + + /** ComputeInstanceTargetEnvironment project. */ + public project: string; + + /** ComputeInstanceTargetEnvironment zone. */ + public zone: string; + + /** + * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceTargetEnvironment instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @param message ComputeInstanceTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @param message ComputeInstanceTargetEnvironment message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Verifies a ComputeInstanceTargetEnvironment message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceTargetEnvironment + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; + + /** + * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. + * @param message ComputeInstanceTargetEnvironment + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceTargetEnvironment to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceTargetEnvironment + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ComputeInstanceDataSourceProperties. */ + interface IComputeInstanceDataSourceProperties { + + /** ComputeInstanceDataSourceProperties name */ + name?: (string|null); + + /** ComputeInstanceDataSourceProperties description */ + description?: (string|null); + + /** ComputeInstanceDataSourceProperties machineType */ + machineType?: (string|null); + + /** ComputeInstanceDataSourceProperties totalDiskCount */ + totalDiskCount?: (number|Long|string|null); + + /** ComputeInstanceDataSourceProperties totalDiskSizeGb */ + totalDiskSizeGb?: (number|Long|string|null); + } + + /** Represents a ComputeInstanceDataSourceProperties. */ + class ComputeInstanceDataSourceProperties implements IComputeInstanceDataSourceProperties { + + /** + * Constructs a new ComputeInstanceDataSourceProperties. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties); + + /** ComputeInstanceDataSourceProperties name. */ + public name: string; + + /** ComputeInstanceDataSourceProperties description. */ + public description: string; + + /** ComputeInstanceDataSourceProperties machineType. */ + public machineType: string; + + /** ComputeInstanceDataSourceProperties totalDiskCount. */ + public totalDiskCount: (number|Long|string); + + /** ComputeInstanceDataSourceProperties totalDiskSizeGb. */ + public totalDiskSizeGb: (number|Long|string); + + /** + * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. + * @param [properties] Properties to set + * @returns ComputeInstanceDataSourceProperties instance + */ + public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @param message ComputeInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @param message ComputeInstanceDataSourceProperties message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Verifies a ComputeInstanceDataSourceProperties message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ComputeInstanceDataSourceProperties + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; + + /** + * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. + * @param message ComputeInstanceDataSourceProperties + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ComputeInstanceDataSourceProperties to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ComputeInstanceDataSourceProperties + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AdvancedMachineFeatures. */ + interface IAdvancedMachineFeatures { + + /** AdvancedMachineFeatures enableNestedVirtualization */ + enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore */ + threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures visibleCoreCount */ + visibleCoreCount?: (number|null); + + /** AdvancedMachineFeatures enableUefiNetworking */ + enableUefiNetworking?: (boolean|null); + } + + /** Represents an AdvancedMachineFeatures. */ + class AdvancedMachineFeatures implements IAdvancedMachineFeatures { + + /** + * Constructs a new AdvancedMachineFeatures. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures); + + /** AdvancedMachineFeatures enableNestedVirtualization. */ + public enableNestedVirtualization?: (boolean|null); + + /** AdvancedMachineFeatures threadsPerCore. */ + public threadsPerCore?: (number|null); + + /** AdvancedMachineFeatures visibleCoreCount. */ + public visibleCoreCount?: (number|null); + + /** AdvancedMachineFeatures enableUefiNetworking. */ + public enableUefiNetworking?: (boolean|null); + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @param [properties] Properties to set + * @returns AdvancedMachineFeatures instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @param message AdvancedMachineFeatures message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Verifies an AdvancedMachineFeatures message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AdvancedMachineFeatures + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AdvancedMachineFeatures; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @param message AdvancedMachineFeatures + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AdvancedMachineFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AdvancedMachineFeatures + * @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.backupdr.v1.IConfidentialInstanceConfig); + + /** ConfidentialInstanceConfig enableConfidentialCompute. */ + public enableConfidentialCompute?: (boolean|null); + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ConfidentialInstanceConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IConfidentialInstanceConfig): google.cloud.backupdr.v1.ConfidentialInstanceConfig; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.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.backupdr.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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 a DisplayDevice. */ + interface IDisplayDevice { + + /** DisplayDevice enableDisplay */ + enableDisplay?: (boolean|null); + } + + /** Represents a DisplayDevice. */ + class DisplayDevice implements IDisplayDevice { + + /** + * Constructs a new DisplayDevice. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDisplayDevice); + + /** DisplayDevice enableDisplay. */ + public enableDisplay?: (boolean|null); + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @param [properties] Properties to set + * @returns DisplayDevice instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDisplayDevice): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @param message DisplayDevice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Verifies a DisplayDevice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DisplayDevice + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DisplayDevice; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @param message DisplayDevice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DisplayDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DisplayDevice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DisplayDevice + * @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 acceleratorType */ + acceleratorType?: (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.backupdr.v1.IAcceleratorConfig); + + /** AcceleratorConfig acceleratorType. */ + public acceleratorType?: (string|null); + + /** AcceleratorConfig acceleratorCount. */ + public acceleratorCount?: (number|null); + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AcceleratorConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAcceleratorConfig): google.cloud.backupdr.v1.AcceleratorConfig; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.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.backupdr.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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 CustomerEncryptionKey. */ + interface ICustomerEncryptionKey { + + /** CustomerEncryptionKey rawKey */ + rawKey?: (string|null); + + /** CustomerEncryptionKey rsaEncryptedKey */ + rsaEncryptedKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyName */ + kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount */ + kmsKeyServiceAccount?: (string|null); + } + + /** Represents a CustomerEncryptionKey. */ + class CustomerEncryptionKey implements ICustomerEncryptionKey { + + /** + * Constructs a new CustomerEncryptionKey. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey); + + /** CustomerEncryptionKey rawKey. */ + public rawKey?: (string|null); + + /** CustomerEncryptionKey rsaEncryptedKey. */ + public rsaEncryptedKey?: (string|null); + + /** CustomerEncryptionKey kmsKeyName. */ + public kmsKeyName?: (string|null); + + /** CustomerEncryptionKey kmsKeyServiceAccount. */ + public kmsKeyServiceAccount?: (string|null); + + /** CustomerEncryptionKey key. */ + public key?: ("rawKey"|"rsaEncryptedKey"|"kmsKeyName"); + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomerEncryptionKey instance + */ + public static create(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @param message CustomerEncryptionKey message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Verifies a CustomerEncryptionKey message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomerEncryptionKey + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CustomerEncryptionKey; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @param message CustomerEncryptionKey + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.CustomerEncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an Entry. */ + interface IEntry { + + /** Entry key */ + key?: (string|null); + + /** Entry value */ + value?: (string|null); + } + + /** Represents an Entry. */ + class Entry implements IEntry { + + /** + * Constructs a new Entry. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IEntry); + + /** Entry key. */ + public key?: (string|null); + + /** Entry value. */ + public value?: (string|null); + + /** + * Creates a new Entry instance using the specified properties. + * @param [properties] Properties to set + * @returns Entry instance + */ + public static create(properties?: google.cloud.backupdr.v1.IEntry): google.cloud.backupdr.v1.Entry; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @param message Entry message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Entry; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Entry; + + /** + * Verifies an Entry message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Entry + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Entry; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @param message Entry + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Entry to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Entry + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Metadata. */ + interface IMetadata { + + /** Metadata items */ + items?: (google.cloud.backupdr.v1.IEntry[]|null); + } + + /** Represents a Metadata. */ + class Metadata implements IMetadata { + + /** + * Constructs a new Metadata. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IMetadata); + + /** Metadata items. */ + public items: google.cloud.backupdr.v1.IEntry[]; + + /** + * Creates a new Metadata instance using the specified properties. + * @param [properties] Properties to set + * @returns Metadata instance + */ + public static create(properties?: google.cloud.backupdr.v1.IMetadata): google.cloud.backupdr.v1.Metadata; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @param message Metadata message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Metadata; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Metadata; + + /** + * Verifies a Metadata message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Metadata + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Metadata; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @param message Metadata + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Metadata to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Metadata + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NetworkInterface. */ + interface INetworkInterface { + + /** NetworkInterface network */ + network?: (string|null); + + /** NetworkInterface subnetwork */ + subnetwork?: (string|null); + + /** NetworkInterface ipAddress */ + ipAddress?: (string|null); + + /** NetworkInterface ipv6Address */ + ipv6Address?: (string|null); + + /** NetworkInterface internalIpv6PrefixLength */ + internalIpv6PrefixLength?: (number|null); + + /** NetworkInterface name */ + name?: (string|null); + + /** NetworkInterface accessConfigs */ + accessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); + + /** NetworkInterface ipv6AccessConfigs */ + ipv6AccessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); + + /** NetworkInterface aliasIpRanges */ + aliasIpRanges?: (google.cloud.backupdr.v1.IAliasIpRange[]|null); + + /** NetworkInterface stackType */ + stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); + + /** NetworkInterface ipv6AccessType */ + ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); + + /** NetworkInterface queueCount */ + queueCount?: (number|null); + + /** NetworkInterface nicType */ + nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); + + /** NetworkInterface networkAttachment */ + networkAttachment?: (string|null); + } + + /** Represents a NetworkInterface. */ + class NetworkInterface implements INetworkInterface { + + /** + * Constructs a new NetworkInterface. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkInterface); + + /** NetworkInterface network. */ + public network?: (string|null); + + /** NetworkInterface subnetwork. */ + public subnetwork?: (string|null); + + /** NetworkInterface ipAddress. */ + public ipAddress?: (string|null); + + /** NetworkInterface ipv6Address. */ + public ipv6Address?: (string|null); + + /** NetworkInterface internalIpv6PrefixLength. */ + public internalIpv6PrefixLength?: (number|null); + + /** NetworkInterface name. */ + public name?: (string|null); + + /** NetworkInterface accessConfigs. */ + public accessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; + + /** NetworkInterface ipv6AccessConfigs. */ + public ipv6AccessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; + + /** NetworkInterface aliasIpRanges. */ + public aliasIpRanges: google.cloud.backupdr.v1.IAliasIpRange[]; + + /** NetworkInterface stackType. */ + public stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); + + /** NetworkInterface ipv6AccessType. */ + public ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); + + /** NetworkInterface queueCount. */ + public queueCount?: (number|null); + + /** NetworkInterface nicType. */ + public nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); + + /** NetworkInterface networkAttachment. */ + public networkAttachment?: (string|null); + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkInterface instance + */ + public static create(properties?: google.cloud.backupdr.v1.INetworkInterface): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @param message NetworkInterface message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Verifies a NetworkInterface message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkInterface + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkInterface; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @param message NetworkInterface + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkInterface to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkInterface + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkInterface { + + /** StackType enum. */ + enum StackType { + STACK_TYPE_UNSPECIFIED = 0, + IPV4_ONLY = 1, + IPV4_IPV6 = 2 + } + + /** Ipv6AccessType enum. */ + enum Ipv6AccessType { + UNSPECIFIED_IPV6_ACCESS_TYPE = 0, + INTERNAL = 1, + EXTERNAL = 2 + } + + /** NicType enum. */ + enum NicType { + NIC_TYPE_UNSPECIFIED = 0, + VIRTIO_NET = 1, + GVNIC = 2 + } + } + + /** Properties of a NetworkPerformanceConfig. */ + interface INetworkPerformanceConfig { + + /** NetworkPerformanceConfig totalEgressBandwidthTier */ + totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); + } + + /** Represents a NetworkPerformanceConfig. */ + class NetworkPerformanceConfig implements INetworkPerformanceConfig { + + /** + * Constructs a new NetworkPerformanceConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig); + + /** NetworkPerformanceConfig totalEgressBandwidthTier. */ + public totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); + + /** + * Creates a new NetworkPerformanceConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkPerformanceConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig): google.cloud.backupdr.v1.NetworkPerformanceConfig; + + /** + * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @param message NetworkPerformanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @param message NetworkPerformanceConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkPerformanceConfig; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkPerformanceConfig; + + /** + * Verifies a NetworkPerformanceConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkPerformanceConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkPerformanceConfig; + + /** + * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. + * @param message NetworkPerformanceConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.NetworkPerformanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkPerformanceConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NetworkPerformanceConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NetworkPerformanceConfig { + + /** Tier enum. */ + enum Tier { + TIER_UNSPECIFIED = 0, + DEFAULT = 1, + TIER_1 = 2 + } + } + + /** Properties of an AccessConfig. */ + interface IAccessConfig { + + /** AccessConfig type */ + type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); + + /** AccessConfig name */ + name?: (string|null); + + /** AccessConfig externalIp */ + externalIp?: (string|null); + + /** AccessConfig externalIpv6 */ + externalIpv6?: (string|null); + + /** AccessConfig externalIpv6PrefixLength */ + externalIpv6PrefixLength?: (number|null); + + /** AccessConfig setPublicPtr */ + setPublicPtr?: (boolean|null); + + /** AccessConfig publicPtrDomainName */ + publicPtrDomainName?: (string|null); + + /** AccessConfig networkTier */ + networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); + } + + /** Represents an AccessConfig. */ + class AccessConfig implements IAccessConfig { + + /** + * Constructs a new AccessConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAccessConfig); + + /** AccessConfig type. */ + public type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); + + /** AccessConfig name. */ + public name?: (string|null); + + /** AccessConfig externalIp. */ + public externalIp?: (string|null); + + /** AccessConfig externalIpv6. */ + public externalIpv6?: (string|null); + + /** AccessConfig externalIpv6PrefixLength. */ + public externalIpv6PrefixLength?: (number|null); + + /** AccessConfig setPublicPtr. */ + public setPublicPtr?: (boolean|null); + + /** AccessConfig publicPtrDomainName. */ + public publicPtrDomainName?: (string|null); + + /** AccessConfig networkTier. */ + public networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); + + /** + * Creates a new AccessConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns AccessConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAccessConfig): google.cloud.backupdr.v1.AccessConfig; + + /** + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @param message AccessConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AccessConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AccessConfig; + + /** + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AccessConfig; + + /** + * Verifies an AccessConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AccessConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AccessConfig; + + /** + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @param message AccessConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AccessConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AccessConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AccessConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AccessConfig { + + /** AccessType enum. */ + enum AccessType { + ACCESS_TYPE_UNSPECIFIED = 0, + ONE_TO_ONE_NAT = 1, + DIRECT_IPV6 = 2 + } + + /** NetworkTier enum. */ + enum NetworkTier { + NETWORK_TIER_UNSPECIFIED = 0, + PREMIUM = 1, + STANDARD = 2 + } + } + + /** Properties of an AliasIpRange. */ + interface IAliasIpRange { + + /** AliasIpRange ipCidrRange */ + ipCidrRange?: (string|null); + + /** AliasIpRange subnetworkRangeName */ + subnetworkRangeName?: (string|null); + } + + /** Represents an AliasIpRange. */ + class AliasIpRange implements IAliasIpRange { + + /** + * Constructs a new AliasIpRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAliasIpRange); + + /** AliasIpRange ipCidrRange. */ + public ipCidrRange?: (string|null); + + /** AliasIpRange subnetworkRangeName. */ + public subnetworkRangeName?: (string|null); + + /** + * Creates a new AliasIpRange instance using the specified properties. + * @param [properties] Properties to set + * @returns AliasIpRange instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAliasIpRange): google.cloud.backupdr.v1.AliasIpRange; + + /** + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @param message AliasIpRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AliasIpRange; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AliasIpRange; + + /** + * Verifies an AliasIpRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AliasIpRange + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AliasIpRange; + + /** + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @param message AliasIpRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AliasIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AliasIpRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AliasIpRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an InstanceParams. */ + interface IInstanceParams { + + /** InstanceParams resourceManagerTags */ + resourceManagerTags?: ({ [k: string]: string }|null); + } + + /** Represents an InstanceParams. */ + class InstanceParams implements IInstanceParams { + + /** + * Constructs a new InstanceParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IInstanceParams); + + /** InstanceParams resourceManagerTags. */ + public resourceManagerTags: { [k: string]: string }; + + /** + * Creates a new InstanceParams instance using the specified properties. + * @param [properties] Properties to set + * @returns InstanceParams instance + */ + public static create(properties?: google.cloud.backupdr.v1.IInstanceParams): google.cloud.backupdr.v1.InstanceParams; + + /** + * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @param message InstanceParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @param message InstanceParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InstanceParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InstanceParams; + + /** + * Decodes an InstanceParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InstanceParams; + + /** + * Verifies an InstanceParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InstanceParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InstanceParams; + + /** + * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. + * @param message InstanceParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.InstanceParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InstanceParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InstanceParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AllocationAffinity. */ + interface IAllocationAffinity { + + /** AllocationAffinity consumeAllocationType */ + consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); + + /** AllocationAffinity key */ + key?: (string|null); + + /** AllocationAffinity values */ + values?: (string[]|null); + } + + /** Represents an AllocationAffinity. */ + class AllocationAffinity implements IAllocationAffinity { + + /** + * Constructs a new AllocationAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAllocationAffinity); + + /** AllocationAffinity consumeAllocationType. */ + public consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); + + /** AllocationAffinity key. */ + public key?: (string|null); + + /** AllocationAffinity values. */ + public values: string[]; + + /** + * Creates a new AllocationAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns AllocationAffinity instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAllocationAffinity): google.cloud.backupdr.v1.AllocationAffinity; + + /** + * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @param message AllocationAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @param message AllocationAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AllocationAffinity; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AllocationAffinity; + + /** + * Verifies an AllocationAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AllocationAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AllocationAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AllocationAffinity; + + /** + * Creates a plain object from an AllocationAffinity message. Also converts values to other types if specified. + * @param message AllocationAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AllocationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AllocationAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AllocationAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AllocationAffinity { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + NO_RESERVATION = 1, + ANY_RESERVATION = 2, + SPECIFIC_RESERVATION = 3 + } + } + + /** Properties of a Scheduling. */ + interface IScheduling { + + /** Scheduling onHostMaintenance */ + onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); + + /** Scheduling automaticRestart */ + automaticRestart?: (boolean|null); + + /** Scheduling preemptible */ + preemptible?: (boolean|null); + + /** Scheduling nodeAffinities */ + nodeAffinities?: (google.cloud.backupdr.v1.Scheduling.INodeAffinity[]|null); + + /** Scheduling minNodeCpus */ + minNodeCpus?: (number|null); + + /** Scheduling provisioningModel */ + provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); + + /** Scheduling instanceTerminationAction */ + instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); + + /** Scheduling localSsdRecoveryTimeout */ + localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); + } + + /** Represents a Scheduling. */ + class Scheduling implements IScheduling { + + /** + * Constructs a new Scheduling. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IScheduling); + + /** Scheduling onHostMaintenance. */ + public onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); + + /** Scheduling automaticRestart. */ + public automaticRestart?: (boolean|null); + + /** Scheduling preemptible. */ + public preemptible?: (boolean|null); + + /** Scheduling nodeAffinities. */ + public nodeAffinities: google.cloud.backupdr.v1.Scheduling.INodeAffinity[]; + + /** Scheduling minNodeCpus. */ + public minNodeCpus?: (number|null); + + /** Scheduling provisioningModel. */ + public provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); + + /** Scheduling instanceTerminationAction. */ + public instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); + + /** Scheduling localSsdRecoveryTimeout. */ + public localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); + + /** + * Creates a new Scheduling instance using the specified properties. + * @param [properties] Properties to set + * @returns Scheduling instance + */ + public static create(properties?: google.cloud.backupdr.v1.IScheduling): google.cloud.backupdr.v1.Scheduling; + + /** + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @param message Scheduling message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Scheduling message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling; + + /** + * Decodes a Scheduling message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling; + + /** + * Verifies a Scheduling message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Scheduling + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling; + + /** + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @param message Scheduling + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Scheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Scheduling to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Scheduling + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace Scheduling { + + /** OnHostMaintenance enum. */ + enum OnHostMaintenance { + ON_HOST_MAINTENANCE_UNSPECIFIED = 0, + TERMINATE = 1, + MIGRATE = 1000 + } + + /** Properties of a NodeAffinity. */ + interface INodeAffinity { + + /** NodeAffinity key */ + key?: (string|null); + + /** NodeAffinity operator */ + operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); + + /** NodeAffinity values */ + values?: (string[]|null); + } + + /** Represents a NodeAffinity. */ + class NodeAffinity implements INodeAffinity { + + /** + * Constructs a new NodeAffinity. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity); + + /** NodeAffinity key. */ + public key?: (string|null); + + /** NodeAffinity operator. */ + public operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); + + /** NodeAffinity values. */ + public values: string[]; + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeAffinity instance + */ + public static create(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @param message NodeAffinity message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Verifies a NodeAffinity message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeAffinity + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling.NodeAffinity; + + /** + * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. + * @param message NodeAffinity + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Scheduling.NodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeAffinity to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeAffinity + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace NodeAffinity { + + /** Operator enum. */ + enum Operator { + OPERATOR_UNSPECIFIED = 0, + IN = 1, + NOT_IN = 2 + } + } + + /** ProvisioningModel enum. */ + enum ProvisioningModel { + PROVISIONING_MODEL_UNSPECIFIED = 0, + STANDARD = 1, + SPOT = 2 + } + + /** InstanceTerminationAction enum. */ + enum InstanceTerminationAction { + INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0, + DELETE = 1, + STOP = 2 + } + } + + /** Properties of a SchedulingDuration. */ + interface ISchedulingDuration { + + /** SchedulingDuration seconds */ + seconds?: (number|Long|string|null); + + /** SchedulingDuration nanos */ + nanos?: (number|null); + } + + /** Represents a SchedulingDuration. */ + class SchedulingDuration implements ISchedulingDuration { + + /** + * Constructs a new SchedulingDuration. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ISchedulingDuration); + + /** SchedulingDuration seconds. */ + public seconds?: (number|Long|string|null); + + /** SchedulingDuration nanos. */ + public nanos?: (number|null); + + /** + * Creates a new SchedulingDuration instance using the specified properties. + * @param [properties] Properties to set + * @returns SchedulingDuration instance + */ + public static create(properties?: google.cloud.backupdr.v1.ISchedulingDuration): google.cloud.backupdr.v1.SchedulingDuration; + + /** + * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @param message SchedulingDuration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @param message SchedulingDuration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.SchedulingDuration; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.SchedulingDuration; + + /** + * Verifies a SchedulingDuration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SchedulingDuration + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.SchedulingDuration; + + /** + * Creates a plain object from a SchedulingDuration message. Also converts values to other types if specified. + * @param message SchedulingDuration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.SchedulingDuration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SchedulingDuration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for SchedulingDuration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceAccount. */ + interface IServiceAccount { + + /** ServiceAccount email */ + email?: (string|null); + + /** ServiceAccount scopes */ + scopes?: (string[]|null); + } + + /** Represents a ServiceAccount. */ + class ServiceAccount implements IServiceAccount { + + /** + * Constructs a new ServiceAccount. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IServiceAccount); + + /** ServiceAccount email. */ + public email?: (string|null); + + /** ServiceAccount scopes. */ + public scopes: string[]; + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceAccount instance + */ + public static create(properties?: google.cloud.backupdr.v1.IServiceAccount): google.cloud.backupdr.v1.ServiceAccount; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @param message ServiceAccount message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceAccount; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceAccount; + + /** + * Verifies a ServiceAccount message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceAccount + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceAccount; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @param message ServiceAccount + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceAccount to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceAccount + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Tags. */ + interface ITags { + + /** Tags items */ + items?: (string[]|null); + } + + /** Represents a Tags. */ + class Tags implements ITags { + + /** + * Constructs a new Tags. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.ITags); + + /** Tags items. */ + public items: string[]; + + /** + * Creates a new Tags instance using the specified properties. + * @param [properties] Properties to set + * @returns Tags instance + */ + public static create(properties?: google.cloud.backupdr.v1.ITags): google.cloud.backupdr.v1.Tags; + + /** + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @param message Tags message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tags message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Tags; + + /** + * Decodes a Tags message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Tags; + + /** + * Verifies a Tags message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tags message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tags + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Tags; + + /** + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @param message Tags + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.Tags, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tags to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Tags + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an AttachedDisk. */ + interface IAttachedDisk { + + /** AttachedDisk initializeParams */ + initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); + + /** AttachedDisk deviceName */ + deviceName?: (string|null); + + /** AttachedDisk kind */ + kind?: (string|null); + + /** AttachedDisk diskTypeDeprecated */ + diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk mode */ + mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); + + /** AttachedDisk source */ + source?: (string|null); + + /** AttachedDisk index */ + index?: (number|Long|string|null); + + /** AttachedDisk boot */ + boot?: (boolean|null); + + /** AttachedDisk autoDelete */ + autoDelete?: (boolean|null); + + /** AttachedDisk license */ + license?: (string[]|null); + + /** AttachedDisk diskInterface */ + diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); + + /** AttachedDisk guestOsFeature */ + guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); + + /** AttachedDisk diskEncryptionKey */ + diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb */ + diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk savedState */ + savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); + + /** AttachedDisk diskType */ + diskType?: (string|null); + + /** AttachedDisk type */ + type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + } + + /** Represents an AttachedDisk. */ + class AttachedDisk implements IAttachedDisk { + + /** + * Constructs a new AttachedDisk. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IAttachedDisk); + + /** AttachedDisk initializeParams. */ + public initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); + + /** AttachedDisk deviceName. */ + public deviceName?: (string|null); + + /** AttachedDisk kind. */ + public kind?: (string|null); + + /** AttachedDisk diskTypeDeprecated. */ + public diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** AttachedDisk mode. */ + public mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); + + /** AttachedDisk source. */ + public source?: (string|null); + + /** AttachedDisk index. */ + public index?: (number|Long|string|null); + + /** AttachedDisk boot. */ + public boot?: (boolean|null); + + /** AttachedDisk autoDelete. */ + public autoDelete?: (boolean|null); + + /** AttachedDisk license. */ + public license: string[]; + + /** AttachedDisk diskInterface. */ + public diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); + + /** AttachedDisk guestOsFeature. */ + public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; + + /** AttachedDisk diskEncryptionKey. */ + public diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); + + /** AttachedDisk diskSizeGb. */ + public diskSizeGb?: (number|Long|string|null); + + /** AttachedDisk savedState. */ + public savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); + + /** AttachedDisk diskType. */ + public diskType?: (string|null); + + /** AttachedDisk type. */ + public type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @param [properties] Properties to set + * @returns AttachedDisk instance + */ + public static create(properties?: google.cloud.backupdr.v1.IAttachedDisk): google.cloud.backupdr.v1.AttachedDisk; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @param message AttachedDisk message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk; + + /** + * Verifies an AttachedDisk message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttachedDisk + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @param message AttachedDisk + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttachedDisk to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for AttachedDisk + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace AttachedDisk { + + /** Properties of an InitializeParams. */ + interface IInitializeParams { + + /** InitializeParams diskName */ + diskName?: (string|null); + + /** InitializeParams replicaZones */ + replicaZones?: (string[]|null); + } + + /** Represents an InitializeParams. */ + class InitializeParams implements IInitializeParams { + + /** + * Constructs a new InitializeParams. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams); + + /** InitializeParams diskName. */ + public diskName?: (string|null); + + /** InitializeParams replicaZones. */ + public replicaZones: string[]; + + /** + * Creates a new InitializeParams instance using the specified properties. + * @param [properties] Properties to set + * @returns InitializeParams instance + */ + public static create(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @param message InitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @param message InitializeParams message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an InitializeParams message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Decodes an InitializeParams message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Verifies an InitializeParams message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns InitializeParams + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; + + /** + * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. + * @param message InitializeParams + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.AttachedDisk.InitializeParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this InitializeParams to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for InitializeParams + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** DiskType enum. */ + enum DiskType { + DISK_TYPE_UNSPECIFIED = 0, + SCRATCH = 1, + PERSISTENT = 2 + } + + /** DiskMode enum. */ + enum DiskMode { + DISK_MODE_UNSPECIFIED = 0, + READ_WRITE = 1, + READ_ONLY = 2, + LOCKED = 3 + } + + /** DiskInterface enum. */ + enum DiskInterface { + DISK_INTERFACE_UNSPECIFIED = 0, + SCSI = 1, + NVME = 2, + NVDIMM = 3, + ISCSI = 4 + } + + /** DiskSavedState enum. */ + enum DiskSavedState { + DISK_SAVED_STATE_UNSPECIFIED = 0, + PRESERVED = 1 + } + } + + /** Properties of a GuestOsFeature. */ + interface IGuestOsFeature { + + /** GuestOsFeature type */ + type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); + } + + /** Represents a GuestOsFeature. */ + class GuestOsFeature implements IGuestOsFeature { + + /** + * Constructs a new GuestOsFeature. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGuestOsFeature); + + /** GuestOsFeature type. */ + public type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); + + /** + * Creates a new GuestOsFeature instance using the specified properties. + * @param [properties] Properties to set + * @returns GuestOsFeature instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGuestOsFeature): google.cloud.backupdr.v1.GuestOsFeature; + + /** + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @param message GuestOsFeature message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GuestOsFeature; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GuestOsFeature; + + /** + * Verifies a GuestOsFeature message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GuestOsFeature + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GuestOsFeature; + + /** + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @param message GuestOsFeature + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GuestOsFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GuestOsFeature to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GuestOsFeature + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace GuestOsFeature { + + /** FeatureType enum. */ + enum FeatureType { + FEATURE_TYPE_UNSPECIFIED = 0, + VIRTIO_SCSI_MULTIQUEUE = 1, + WINDOWS = 2, + MULTI_IP_SUBNET = 3, + UEFI_COMPATIBLE = 4, + SECURE_BOOT = 5, + GVNIC = 6, + SEV_CAPABLE = 7, + BARE_METAL_LINUX_COMPATIBLE = 8, + SUSPEND_RESUME_COMPATIBLE = 9, + SEV_LIVE_MIGRATABLE = 10, + SEV_SNP_CAPABLE = 11, + TDX_CAPABLE = 12, + IDPF = 13, + SEV_LIVE_MIGRATABLE_V2 = 14 + } + } + + /** KeyRevocationActionType enum. */ + enum KeyRevocationActionType { + KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0, + NONE = 1, + STOP = 2 + } + + /** Properties of a DataSourceReference. */ + interface IDataSourceReference { + + /** DataSourceReference name */ + name?: (string|null); + + /** DataSourceReference dataSource */ + dataSource?: (string|null); + + /** DataSourceReference createTime */ + createTime?: (google.protobuf.ITimestamp|null); + + /** DataSourceReference dataSourceBackupConfigState */ + dataSourceBackupConfigState?: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState|null); + + /** DataSourceReference dataSourceBackupCount */ + dataSourceBackupCount?: (number|Long|string|null); + + /** DataSourceReference dataSourceBackupConfigInfo */ + dataSourceBackupConfigInfo?: (google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null); + + /** DataSourceReference dataSourceGcpResourceInfo */ + dataSourceGcpResourceInfo?: (google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null); + + /** DataSourceReference totalStoredBytes */ + totalStoredBytes?: (number|Long|string|null); + } + + /** Represents a DataSourceReference. */ + class DataSourceReference implements IDataSourceReference { + + /** + * Constructs a new DataSourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceReference); + + /** DataSourceReference name. */ + public name: string; + + /** DataSourceReference dataSource. */ + public dataSource: string; + + /** DataSourceReference createTime. */ + public createTime?: (google.protobuf.ITimestamp|null); + + /** DataSourceReference dataSourceBackupConfigState. */ + public dataSourceBackupConfigState: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState); + + /** DataSourceReference dataSourceBackupCount. */ + public dataSourceBackupCount: (number|Long|string); + + /** DataSourceReference dataSourceBackupConfigInfo. */ + public dataSourceBackupConfigInfo?: (google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null); + + /** DataSourceReference dataSourceGcpResourceInfo. */ + public dataSourceGcpResourceInfo?: (google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null); + + /** DataSourceReference totalStoredBytes. */ + public totalStoredBytes?: (number|Long|string|null); + + /** + * Creates a new DataSourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceReference instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceReference): google.cloud.backupdr.v1.DataSourceReference; + + /** + * Encodes the specified DataSourceReference message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. + * @param message DataSourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceReference message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. + * @param message DataSourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceReference; + + /** + * Decodes a DataSourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceReference; + + /** + * Verifies a DataSourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceReference + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceReference; + + /** + * Creates a plain object from a DataSourceReference message. Also converts values to other types if specified. + * @param message DataSourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceBackupConfigInfo. */ + interface IDataSourceBackupConfigInfo { + + /** DataSourceBackupConfigInfo lastBackupState */ + lastBackupState?: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null); + + /** DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime */ + lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a DataSourceBackupConfigInfo. */ + class DataSourceBackupConfigInfo implements IDataSourceBackupConfigInfo { + + /** + * Constructs a new DataSourceBackupConfigInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo); + + /** DataSourceBackupConfigInfo lastBackupState. */ + public lastBackupState: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState); + + /** DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime. */ + public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new DataSourceBackupConfigInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceBackupConfigInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; + + /** + * Encodes the specified DataSourceBackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. + * @param message DataSourceBackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceBackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. + * @param message DataSourceBackupConfigInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceBackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; + + /** + * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceBackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; + + /** + * Verifies a DataSourceBackupConfigInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceBackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceBackupConfigInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; + + /** + * Creates a plain object from a DataSourceBackupConfigInfo message. Also converts values to other types if specified. + * @param message DataSourceBackupConfigInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceBackupConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceBackupConfigInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceBackupConfigInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DataSourceGcpResourceInfo. */ + interface IDataSourceGcpResourceInfo { + + /** DataSourceGcpResourceInfo gcpResourcename */ + gcpResourcename?: (string|null); + + /** DataSourceGcpResourceInfo type */ + type?: (string|null); + + /** DataSourceGcpResourceInfo location */ + location?: (string|null); + + /** DataSourceGcpResourceInfo cloudSqlInstanceProperties */ + cloudSqlInstanceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null); + } + + /** Represents a DataSourceGcpResourceInfo. */ + class DataSourceGcpResourceInfo implements IDataSourceGcpResourceInfo { + + /** + * Constructs a new DataSourceGcpResourceInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo); + + /** DataSourceGcpResourceInfo gcpResourcename. */ + public gcpResourcename: string; + + /** DataSourceGcpResourceInfo type. */ + public type: string; + + /** DataSourceGcpResourceInfo location. */ + public location: string; + + /** DataSourceGcpResourceInfo cloudSqlInstanceProperties. */ + public cloudSqlInstanceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null); + + /** DataSourceGcpResourceInfo resourceProperties. */ + public resourceProperties?: "cloudSqlInstanceProperties"; + + /** + * Creates a new DataSourceGcpResourceInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns DataSourceGcpResourceInfo instance + */ + public static create(properties?: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; + + /** + * Encodes the specified DataSourceGcpResourceInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. + * @param message DataSourceGcpResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DataSourceGcpResourceInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. + * @param message DataSourceGcpResourceInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DataSourceGcpResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; + + /** + * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DataSourceGcpResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; + + /** + * Verifies a DataSourceGcpResourceInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DataSourceGcpResourceInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DataSourceGcpResourceInfo + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; + + /** + * Creates a plain object from a DataSourceGcpResourceInfo message. Also converts values to other types if specified. + * @param message DataSourceGcpResourceInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.DataSourceGcpResourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DataSourceGcpResourceInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DataSourceGcpResourceInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GetDataSourceReferenceRequest. */ + interface IGetDataSourceReferenceRequest { + + /** GetDataSourceReferenceRequest name */ + name?: (string|null); + } + + /** Represents a GetDataSourceReferenceRequest. */ + class GetDataSourceReferenceRequest implements IGetDataSourceReferenceRequest { + + /** + * Constructs a new GetDataSourceReferenceRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest); + + /** GetDataSourceReferenceRequest name. */ + public name: string; + + /** + * Creates a new GetDataSourceReferenceRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns GetDataSourceReferenceRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; + + /** + * Encodes the specified GetDataSourceReferenceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. + * @param message GetDataSourceReferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GetDataSourceReferenceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. + * @param message GetDataSourceReferenceRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GetDataSourceReferenceRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GetDataSourceReferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; + + /** + * Decodes a GetDataSourceReferenceRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GetDataSourceReferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; + + /** + * Verifies a GetDataSourceReferenceRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GetDataSourceReferenceRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GetDataSourceReferenceRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; + + /** + * Creates a plain object from a GetDataSourceReferenceRequest message. Also converts values to other types if specified. + * @param message GetDataSourceReferenceRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.GetDataSourceReferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GetDataSourceReferenceRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GetDataSourceReferenceRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourceReferencesRequest. */ + interface IListDataSourceReferencesRequest { + + /** ListDataSourceReferencesRequest parent */ + parent?: (string|null); + + /** ListDataSourceReferencesRequest pageSize */ + pageSize?: (number|null); + + /** ListDataSourceReferencesRequest pageToken */ + pageToken?: (string|null); + + /** ListDataSourceReferencesRequest filter */ + filter?: (string|null); + + /** ListDataSourceReferencesRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListDataSourceReferencesRequest. */ + class ListDataSourceReferencesRequest implements IListDataSourceReferencesRequest { + + /** + * Constructs a new ListDataSourceReferencesRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesRequest); + + /** ListDataSourceReferencesRequest parent. */ + public parent: string; + + /** ListDataSourceReferencesRequest pageSize. */ + public pageSize: number; + + /** ListDataSourceReferencesRequest pageToken. */ + public pageToken: string; + + /** ListDataSourceReferencesRequest filter. */ + public filter: string; + + /** ListDataSourceReferencesRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListDataSourceReferencesRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourceReferencesRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesRequest): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; + + /** + * Encodes the specified ListDataSourceReferencesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. + * @param message ListDataSourceReferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourceReferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourceReferencesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. + * @param message ListDataSourceReferencesRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourceReferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourceReferencesRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourceReferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; + + /** + * Decodes a ListDataSourceReferencesRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourceReferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; + + /** + * Verifies a ListDataSourceReferencesRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourceReferencesRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourceReferencesRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; + + /** + * Creates a plain object from a ListDataSourceReferencesRequest message. Also converts values to other types if specified. + * @param message ListDataSourceReferencesRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourceReferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourceReferencesRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourceReferencesRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListDataSourceReferencesResponse. */ + interface IListDataSourceReferencesResponse { + + /** ListDataSourceReferencesResponse dataSourceReferences */ + dataSourceReferences?: (google.cloud.backupdr.v1.IDataSourceReference[]|null); + + /** ListDataSourceReferencesResponse nextPageToken */ + nextPageToken?: (string|null); + + /** ListDataSourceReferencesResponse unreachable */ + unreachable?: (string[]|null); + } + + /** Represents a ListDataSourceReferencesResponse. */ + class ListDataSourceReferencesResponse implements IListDataSourceReferencesResponse { + + /** + * Constructs a new ListDataSourceReferencesResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesResponse); + + /** ListDataSourceReferencesResponse dataSourceReferences. */ + public dataSourceReferences: google.cloud.backupdr.v1.IDataSourceReference[]; + + /** ListDataSourceReferencesResponse nextPageToken. */ + public nextPageToken: string; + + /** ListDataSourceReferencesResponse unreachable. */ + public unreachable: string[]; + + /** + * Creates a new ListDataSourceReferencesResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListDataSourceReferencesResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesResponse): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; + + /** + * Encodes the specified ListDataSourceReferencesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. + * @param message ListDataSourceReferencesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListDataSourceReferencesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListDataSourceReferencesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. + * @param message ListDataSourceReferencesResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourceReferencesResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListDataSourceReferencesResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListDataSourceReferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; + + /** + * Decodes a ListDataSourceReferencesResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListDataSourceReferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; + + /** + * Verifies a ListDataSourceReferencesResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListDataSourceReferencesResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListDataSourceReferencesResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; + + /** + * Creates a plain object from a ListDataSourceReferencesResponse message. Also converts values to other types if specified. + * @param message ListDataSourceReferencesResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListDataSourceReferencesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListDataSourceReferencesResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListDataSourceReferencesResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDataSourceReferencesForResourceTypeRequest. */ + interface IFetchDataSourceReferencesForResourceTypeRequest { + + /** FetchDataSourceReferencesForResourceTypeRequest parent */ + parent?: (string|null); + + /** FetchDataSourceReferencesForResourceTypeRequest resourceType */ + resourceType?: (string|null); + + /** FetchDataSourceReferencesForResourceTypeRequest pageSize */ + pageSize?: (number|null); + + /** FetchDataSourceReferencesForResourceTypeRequest pageToken */ + pageToken?: (string|null); + + /** FetchDataSourceReferencesForResourceTypeRequest filter */ + filter?: (string|null); + + /** FetchDataSourceReferencesForResourceTypeRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a FetchDataSourceReferencesForResourceTypeRequest. */ + class FetchDataSourceReferencesForResourceTypeRequest implements IFetchDataSourceReferencesForResourceTypeRequest { + + /** + * Constructs a new FetchDataSourceReferencesForResourceTypeRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest); + + /** FetchDataSourceReferencesForResourceTypeRequest parent. */ + public parent: string; + + /** FetchDataSourceReferencesForResourceTypeRequest resourceType. */ + public resourceType: string; + + /** FetchDataSourceReferencesForResourceTypeRequest pageSize. */ + public pageSize: number; + + /** FetchDataSourceReferencesForResourceTypeRequest pageToken. */ + public pageToken: string; + + /** FetchDataSourceReferencesForResourceTypeRequest filter. */ + public filter: string; + + /** FetchDataSourceReferencesForResourceTypeRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new FetchDataSourceReferencesForResourceTypeRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDataSourceReferencesForResourceTypeRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. + * @param message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. + * @param message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDataSourceReferencesForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDataSourceReferencesForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; + + /** + * Verifies a FetchDataSourceReferencesForResourceTypeRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchDataSourceReferencesForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDataSourceReferencesForResourceTypeRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; + + /** + * Creates a plain object from a FetchDataSourceReferencesForResourceTypeRequest message. Also converts values to other types if specified. + * @param message FetchDataSourceReferencesForResourceTypeRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDataSourceReferencesForResourceTypeRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDataSourceReferencesForResourceTypeRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FetchDataSourceReferencesForResourceTypeResponse. */ + interface IFetchDataSourceReferencesForResourceTypeResponse { + + /** FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences */ + dataSourceReferences?: (google.cloud.backupdr.v1.IDataSourceReference[]|null); + + /** FetchDataSourceReferencesForResourceTypeResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a FetchDataSourceReferencesForResourceTypeResponse. */ + class FetchDataSourceReferencesForResourceTypeResponse implements IFetchDataSourceReferencesForResourceTypeResponse { + + /** + * Constructs a new FetchDataSourceReferencesForResourceTypeResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse); + + /** FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences. */ + public dataSourceReferences: google.cloud.backupdr.v1.IDataSourceReference[]; + + /** FetchDataSourceReferencesForResourceTypeResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new FetchDataSourceReferencesForResourceTypeResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns FetchDataSourceReferencesForResourceTypeResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. + * @param message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. + * @param message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FetchDataSourceReferencesForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FetchDataSourceReferencesForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; + + /** + * Verifies a FetchDataSourceReferencesForResourceTypeResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FetchDataSourceReferencesForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FetchDataSourceReferencesForResourceTypeResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; + + /** + * Creates a plain object from a FetchDataSourceReferencesForResourceTypeResponse message. Also converts values to other types if specified. + * @param message FetchDataSourceReferencesForResourceTypeResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FetchDataSourceReferencesForResourceTypeResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FetchDataSourceReferencesForResourceTypeResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Represents a BackupDrProtectionSummary */ + class BackupDrProtectionSummary extends $protobuf.rpc.Service { + + /** + * Constructs a new BackupDrProtectionSummary 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 BackupDrProtectionSummary 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): BackupDrProtectionSummary; + + /** + * Calls ListResourceBackupConfigs. + * @param request ListResourceBackupConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListResourceBackupConfigsResponse + */ + public listResourceBackupConfigs(request: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, callback: google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigsCallback): void; + + /** + * Calls ListResourceBackupConfigs. + * @param request ListResourceBackupConfigsRequest message or plain object + * @returns Promise + */ + public listResourceBackupConfigs(request: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest): Promise; + } + + namespace BackupDrProtectionSummary { + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDrProtectionSummary|listResourceBackupConfigs}. + * @param error Error, if any + * @param [response] ListResourceBackupConfigsResponse + */ + type ListResourceBackupConfigsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListResourceBackupConfigsResponse) => void; + } + + /** Properties of a ListResourceBackupConfigsRequest. */ + interface IListResourceBackupConfigsRequest { + + /** ListResourceBackupConfigsRequest parent */ + parent?: (string|null); + + /** ListResourceBackupConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListResourceBackupConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListResourceBackupConfigsRequest filter */ + filter?: (string|null); + + /** ListResourceBackupConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListResourceBackupConfigsRequest. */ + class ListResourceBackupConfigsRequest implements IListResourceBackupConfigsRequest { + + /** + * Constructs a new ListResourceBackupConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest); + + /** ListResourceBackupConfigsRequest parent. */ + public parent: string; + + /** ListResourceBackupConfigsRequest pageSize. */ + public pageSize: number; + + /** ListResourceBackupConfigsRequest pageToken. */ + public pageToken: string; + + /** ListResourceBackupConfigsRequest filter. */ + public filter: string; + + /** ListResourceBackupConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListResourceBackupConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceBackupConfigsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Encodes the specified ListResourceBackupConfigsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @param message ListResourceBackupConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceBackupConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @param message ListResourceBackupConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Verifies a ListResourceBackupConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceBackupConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceBackupConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Creates a plain object from a ListResourceBackupConfigsRequest message. Also converts values to other types if specified. + * @param message ListResourceBackupConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListResourceBackupConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceBackupConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceBackupConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceBackupConfigsResponse. */ + interface IListResourceBackupConfigsResponse { + + /** ListResourceBackupConfigsResponse resourceBackupConfigs */ + resourceBackupConfigs?: (google.cloud.backupdr.v1.IResourceBackupConfig[]|null); + + /** ListResourceBackupConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListResourceBackupConfigsResponse. */ + class ListResourceBackupConfigsResponse implements IListResourceBackupConfigsResponse { + + /** + * Constructs a new ListResourceBackupConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse); + + /** ListResourceBackupConfigsResponse resourceBackupConfigs. */ + public resourceBackupConfigs: google.cloud.backupdr.v1.IResourceBackupConfig[]; + + /** ListResourceBackupConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListResourceBackupConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceBackupConfigsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Encodes the specified ListResourceBackupConfigsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @param message ListResourceBackupConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceBackupConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @param message ListResourceBackupConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Verifies a ListResourceBackupConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceBackupConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceBackupConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Creates a plain object from a ListResourceBackupConfigsResponse message. Also converts values to other types if specified. + * @param message ListResourceBackupConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListResourceBackupConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceBackupConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceBackupConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResourceBackupConfig. */ + interface IResourceBackupConfig { + + /** ResourceBackupConfig name */ + name?: (string|null); + + /** ResourceBackupConfig uid */ + uid?: (string|null); + + /** ResourceBackupConfig targetResource */ + targetResource?: (string|null); + + /** ResourceBackupConfig targetResourceDisplayName */ + targetResourceDisplayName?: (string|null); + + /** ResourceBackupConfig targetResourceType */ + targetResourceType?: (google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|keyof typeof google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|null); + + /** ResourceBackupConfig targetResourceLabels */ + targetResourceLabels?: ({ [k: string]: string }|null); + + /** ResourceBackupConfig backupConfigsDetails */ + backupConfigsDetails?: (google.cloud.backupdr.v1.IBackupConfigDetails[]|null); + + /** ResourceBackupConfig backupConfigured */ + backupConfigured?: (boolean|null); + + /** ResourceBackupConfig vaulted */ + vaulted?: (boolean|null); + } + + /** Represents a ResourceBackupConfig. */ + class ResourceBackupConfig implements IResourceBackupConfig { + + /** + * Constructs a new ResourceBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IResourceBackupConfig); + + /** ResourceBackupConfig name. */ + public name: string; + + /** ResourceBackupConfig uid. */ + public uid: string; + + /** ResourceBackupConfig targetResource. */ + public targetResource: string; + + /** ResourceBackupConfig targetResourceDisplayName. */ + public targetResourceDisplayName: string; + + /** ResourceBackupConfig targetResourceType. */ + public targetResourceType: (google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|keyof typeof google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType); + + /** ResourceBackupConfig targetResourceLabels. */ + public targetResourceLabels: { [k: string]: string }; + + /** ResourceBackupConfig backupConfigsDetails. */ + public backupConfigsDetails: google.cloud.backupdr.v1.IBackupConfigDetails[]; + + /** ResourceBackupConfig backupConfigured. */ + public backupConfigured: boolean; + + /** ResourceBackupConfig vaulted. */ + public vaulted: boolean; + + /** + * Creates a new ResourceBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IResourceBackupConfig): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Encodes the specified ResourceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @param message ResourceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IResourceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @param message ResourceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IResourceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Verifies a ResourceBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Creates a plain object from a ResourceBackupConfig message. Also converts values to other types if specified. + * @param message ResourceBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ResourceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceBackupConfig { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + CLOUD_SQL_INSTANCE = 1, + COMPUTE_ENGINE_VM = 2, + COMPUTE_ENGINE_DISK = 3, + COMPUTE_ENGINE_REGIONAL_DISK = 4 + } + } + + /** Properties of a BackupConfigDetails. */ + interface IBackupConfigDetails { + + /** BackupConfigDetails backupConfigSource */ + backupConfigSource?: (string|null); + + /** BackupConfigDetails backupConfigSourceDisplayName */ + backupConfigSourceDisplayName?: (string|null); + + /** BackupConfigDetails type */ + type?: (google.cloud.backupdr.v1.BackupConfigDetails.Type|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.Type|null); + + /** BackupConfigDetails state */ + state?: (google.cloud.backupdr.v1.BackupConfigDetails.State|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.State|null); + + /** BackupConfigDetails pitrSettings */ + pitrSettings?: (google.cloud.backupdr.v1.IPitrSettings|null); + + /** BackupConfigDetails latestSuccessfulBackupTime */ + latestSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigDetails applicableResource */ + applicableResource?: (string|null); + + /** BackupConfigDetails backupVault */ + backupVault?: (string|null); + + /** BackupConfigDetails backupLocations */ + backupLocations?: (google.cloud.backupdr.v1.IBackupLocation[]|null); + + /** BackupConfigDetails backupDrPlanConfig */ + backupDrPlanConfig?: (google.cloud.backupdr.v1.IBackupDrPlanConfig|null); + + /** BackupConfigDetails backupDrTemplateConfig */ + backupDrTemplateConfig?: (google.cloud.backupdr.v1.IBackupDrTemplateConfig|null); + } + + /** Represents a BackupConfigDetails. */ + class BackupConfigDetails implements IBackupConfigDetails { + + /** + * Constructs a new BackupConfigDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupConfigDetails); + + /** BackupConfigDetails backupConfigSource. */ + public backupConfigSource: string; + + /** BackupConfigDetails backupConfigSourceDisplayName. */ + public backupConfigSourceDisplayName: string; + + /** BackupConfigDetails type. */ + public type: (google.cloud.backupdr.v1.BackupConfigDetails.Type|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.Type); + + /** BackupConfigDetails state. */ + public state: (google.cloud.backupdr.v1.BackupConfigDetails.State|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.State); + + /** BackupConfigDetails pitrSettings. */ + public pitrSettings?: (google.cloud.backupdr.v1.IPitrSettings|null); + + /** BackupConfigDetails latestSuccessfulBackupTime. */ + public latestSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigDetails applicableResource. */ + public applicableResource: string; + + /** BackupConfigDetails backupVault. */ + public backupVault: string; + + /** BackupConfigDetails backupLocations. */ + public backupLocations: google.cloud.backupdr.v1.IBackupLocation[]; + + /** BackupConfigDetails backupDrPlanConfig. */ + public backupDrPlanConfig?: (google.cloud.backupdr.v1.IBackupDrPlanConfig|null); + + /** BackupConfigDetails backupDrTemplateConfig. */ + public backupDrTemplateConfig?: (google.cloud.backupdr.v1.IBackupDrTemplateConfig|null); + + /** BackupConfigDetails planSpecificConfig. */ + public planSpecificConfig?: ("backupDrPlanConfig"|"backupDrTemplateConfig"); + + /** + * Creates a new BackupConfigDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupConfigDetails instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupConfigDetails): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Encodes the specified BackupConfigDetails message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @param message BackupConfigDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupConfigDetails message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @param message BackupConfigDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Verifies a BackupConfigDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupConfigDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupConfigDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Creates a plain object from a BackupConfigDetails message. Also converts values to other types if specified. + * @param message BackupConfigDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupConfigDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupConfigDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupConfigDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupConfigDetails { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CLOUD_SQL_INSTANCE_BACKUP_CONFIG = 1, + COMPUTE_ENGINE_RESOURCE_POLICY = 2, + BACKUPDR_BACKUP_PLAN = 3, + BACKUPDR_TEMPLATE = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2, + ERROR = 3 + } + } + + /** Properties of a PitrSettings. */ + interface IPitrSettings { + + /** PitrSettings retentionDays */ + retentionDays?: (number|null); + } + + /** Represents a PitrSettings. */ + class PitrSettings implements IPitrSettings { + + /** + * Constructs a new PitrSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IPitrSettings); + + /** PitrSettings retentionDays. */ + public retentionDays: number; + + /** + * Creates a new PitrSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PitrSettings instance + */ + public static create(properties?: google.cloud.backupdr.v1.IPitrSettings): google.cloud.backupdr.v1.PitrSettings; + + /** + * Encodes the specified PitrSettings message. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @param message PitrSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IPitrSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PitrSettings message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @param message PitrSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IPitrSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PitrSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.PitrSettings; + + /** + * Decodes a PitrSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.PitrSettings; + + /** + * Verifies a PitrSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PitrSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PitrSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.PitrSettings; + + /** + * Creates a plain object from a PitrSettings message. Also converts values to other types if specified. + * @param message PitrSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.PitrSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PitrSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PitrSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupDrTemplateConfig. */ + interface IBackupDrTemplateConfig { + + /** BackupDrTemplateConfig firstPartyManagementUri */ + firstPartyManagementUri?: (string|null); + + /** BackupDrTemplateConfig thirdPartyManagementUri */ + thirdPartyManagementUri?: (string|null); + } + + /** Represents a BackupDrTemplateConfig. */ + class BackupDrTemplateConfig implements IBackupDrTemplateConfig { + + /** + * Constructs a new BackupDrTemplateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupDrTemplateConfig); + + /** BackupDrTemplateConfig firstPartyManagementUri. */ + public firstPartyManagementUri: string; + + /** BackupDrTemplateConfig thirdPartyManagementUri. */ + public thirdPartyManagementUri: string; + + /** + * Creates a new BackupDrTemplateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDrTemplateConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupDrTemplateConfig): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Encodes the specified BackupDrTemplateConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @param message BackupDrTemplateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupDrTemplateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDrTemplateConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @param message BackupDrTemplateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrTemplateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Verifies a BackupDrTemplateConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDrTemplateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDrTemplateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Creates a plain object from a BackupDrTemplateConfig message. Also converts values to other types if specified. + * @param message BackupDrTemplateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupDrTemplateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDrTemplateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDrTemplateConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupDrPlanConfig. */ + interface IBackupDrPlanConfig { + + /** BackupDrPlanConfig backupDrPlanRules */ + backupDrPlanRules?: (google.cloud.backupdr.v1.IBackupDrPlanRule[]|null); + } + + /** Represents a BackupDrPlanConfig. */ + class BackupDrPlanConfig implements IBackupDrPlanConfig { + + /** + * Constructs a new BackupDrPlanConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupDrPlanConfig); + + /** BackupDrPlanConfig backupDrPlanRules. */ + public backupDrPlanRules: google.cloud.backupdr.v1.IBackupDrPlanRule[]; + + /** + * Creates a new BackupDrPlanConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDrPlanConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupDrPlanConfig): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Encodes the specified BackupDrPlanConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @param message BackupDrPlanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupDrPlanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDrPlanConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @param message BackupDrPlanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrPlanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Verifies a BackupDrPlanConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDrPlanConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDrPlanConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Creates a plain object from a BackupDrPlanConfig message. Also converts values to other types if specified. + * @param message BackupDrPlanConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupDrPlanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDrPlanConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDrPlanConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupDrPlanRule. */ + interface IBackupDrPlanRule { + + /** BackupDrPlanRule ruleId */ + ruleId?: (string|null); + + /** BackupDrPlanRule lastSuccessfulBackupTime */ + lastSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupDrPlanRule. */ + class BackupDrPlanRule implements IBackupDrPlanRule { + + /** + * Constructs a new BackupDrPlanRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupDrPlanRule); + + /** BackupDrPlanRule ruleId. */ + public ruleId: string; + + /** BackupDrPlanRule lastSuccessfulBackupTime. */ + public lastSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BackupDrPlanRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDrPlanRule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupDrPlanRule): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Encodes the specified BackupDrPlanRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @param message BackupDrPlanRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupDrPlanRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDrPlanRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @param message BackupDrPlanRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrPlanRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Verifies a BackupDrPlanRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDrPlanRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDrPlanRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Creates a plain object from a BackupDrPlanRule message. Also converts values to other types if specified. + * @param message BackupDrPlanRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupDrPlanRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDrPlanRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDrPlanRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupLocation. */ + interface IBackupLocation { + + /** BackupLocation type */ + type?: (google.cloud.backupdr.v1.BackupLocation.Type|keyof typeof google.cloud.backupdr.v1.BackupLocation.Type|null); + + /** BackupLocation locationId */ + locationId?: (string|null); + } + + /** Represents a BackupLocation. */ + class BackupLocation implements IBackupLocation { + + /** + * Constructs a new BackupLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupLocation); + + /** BackupLocation type. */ + public type: (google.cloud.backupdr.v1.BackupLocation.Type|keyof typeof google.cloud.backupdr.v1.BackupLocation.Type); + + /** BackupLocation locationId. */ + public locationId: string; + + /** + * Creates a new BackupLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupLocation instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupLocation): google.cloud.backupdr.v1.BackupLocation; + + /** + * Encodes the specified BackupLocation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @param message BackupLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupLocation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @param message BackupLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLocation; + + /** + * Decodes a BackupLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLocation; + + /** + * Verifies a BackupLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLocation; + + /** + * Creates a plain object from a BackupLocation message. Also converts values to other types if specified. + * @param message BackupLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupLocation { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2, + MULTI_REGIONAL = 3 + } + } + } + } + } + + /** Namespace api. */ + namespace api { + + /** Properties of a Http. */ + interface IHttp { + + /** Http rules */ + rules?: (google.api.IHttpRule[]|null); + + /** Http fullyDecodeReservedExpansion */ + fullyDecodeReservedExpansion?: (boolean|null); + } + + /** Represents a Http. */ + class Http implements IHttp { + + /** + * Constructs a new Http. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttp); + + /** Http rules. */ + public rules: google.api.IHttpRule[]; + + /** Http fullyDecodeReservedExpansion. */ + public fullyDecodeReservedExpansion: boolean; + + /** + * Creates a new Http instance using the specified properties. + * @param [properties] Properties to set + * @returns Http instance + */ + public static create(properties?: google.api.IHttp): google.api.Http; + + /** + * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. + * @param message Http message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Http message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; + + /** + * Decodes a Http message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Http + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; + + /** + * Verifies a Http message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Http message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Http + */ + public static fromObject(object: { [k: string]: any }): google.api.Http; + + /** + * Creates a plain object from a Http message. Also converts values to other types if specified. + * @param message Http + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Http to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Http + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a HttpRule. */ + interface IHttpRule { + + /** HttpRule selector */ + selector?: (string|null); + + /** HttpRule get */ + get?: (string|null); + + /** HttpRule put */ + put?: (string|null); + + /** HttpRule post */ + post?: (string|null); + + /** HttpRule delete */ + "delete"?: (string|null); + + /** HttpRule patch */ + patch?: (string|null); + + /** HttpRule custom */ + custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body */ + body?: (string|null); + + /** HttpRule responseBody */ + responseBody?: (string|null); + + /** HttpRule additionalBindings */ + additionalBindings?: (google.api.IHttpRule[]|null); + } + + /** Represents a HttpRule. */ + class HttpRule implements IHttpRule { + + /** + * Constructs a new HttpRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IHttpRule); + + /** HttpRule selector. */ + public selector: string; + + /** HttpRule get. */ + public get?: (string|null); + + /** HttpRule put. */ + public put?: (string|null); + + /** HttpRule post. */ + public post?: (string|null); + + /** HttpRule delete. */ + public delete?: (string|null); + + /** HttpRule patch. */ + public patch?: (string|null); + + /** HttpRule custom. */ + public custom?: (google.api.ICustomHttpPattern|null); + + /** HttpRule body. */ + public body: string; + + /** HttpRule responseBody. */ + public responseBody: string; + + /** HttpRule additionalBindings. */ + public additionalBindings: google.api.IHttpRule[]; + + /** HttpRule pattern. */ + public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); + + /** + * Creates a new HttpRule instance using the specified properties. + * @param [properties] Properties to set + * @returns HttpRule instance + */ + public static create(properties?: google.api.IHttpRule): google.api.HttpRule; + + /** + * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. + * @param message HttpRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a HttpRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; + + /** + * Decodes a HttpRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns HttpRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; + + /** + * Verifies a HttpRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns HttpRule + */ + public static fromObject(object: { [k: string]: any }): google.api.HttpRule; + + /** + * Creates a plain object from a HttpRule message. Also converts values to other types if specified. + * @param message HttpRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this HttpRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for HttpRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CustomHttpPattern. */ + interface ICustomHttpPattern { + + /** CustomHttpPattern kind */ + kind?: (string|null); + + /** CustomHttpPattern path */ + path?: (string|null); + } + + /** Represents a CustomHttpPattern. */ + class CustomHttpPattern implements ICustomHttpPattern { + + /** + * Constructs a new CustomHttpPattern. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICustomHttpPattern); + + /** CustomHttpPattern kind. */ + public kind: string; + + /** CustomHttpPattern path. */ + public path: string; + + /** + * Creates a new CustomHttpPattern instance using the specified properties. + * @param [properties] Properties to set + * @returns CustomHttpPattern instance + */ + public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; + + /** + * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. + * @param message CustomHttpPattern message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; + + /** + * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CustomHttpPattern + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; + + /** + * Verifies a CustomHttpPattern message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CustomHttpPattern + */ + public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; + + /** + * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. + * @param message CustomHttpPattern + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CustomHttpPattern to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CustomHttpPattern + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CommonLanguageSettings. */ + interface ICommonLanguageSettings { + + /** CommonLanguageSettings referenceDocsUri */ + referenceDocsUri?: (string|null); + + /** CommonLanguageSettings destinations */ + destinations?: (google.api.ClientLibraryDestination[]|null); + } + + /** Represents a CommonLanguageSettings. */ + class CommonLanguageSettings implements ICommonLanguageSettings { + + /** + * Constructs a new CommonLanguageSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICommonLanguageSettings); + + /** CommonLanguageSettings referenceDocsUri. */ + public referenceDocsUri: string; + + /** CommonLanguageSettings destinations. */ + public destinations: google.api.ClientLibraryDestination[]; + + /** + * Creates a new CommonLanguageSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CommonLanguageSettings instance + */ + public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; + + /** + * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. + * @param message CommonLanguageSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; + + /** + * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CommonLanguageSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; + + /** + * Verifies a CommonLanguageSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CommonLanguageSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; + + /** + * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. + * @param message CommonLanguageSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CommonLanguageSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CommonLanguageSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ClientLibrarySettings. */ + interface IClientLibrarySettings { + + /** ClientLibrarySettings version */ + version?: (string|null); + + /** ClientLibrarySettings launchStage */ + launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); + + /** ClientLibrarySettings restNumericEnums */ + restNumericEnums?: (boolean|null); + + /** ClientLibrarySettings javaSettings */ + javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings */ + cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings */ + phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings */ + pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings */ + nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings */ + dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings */ + rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings */ + goSettings?: (google.api.IGoSettings|null); + } + + /** Represents a ClientLibrarySettings. */ + class ClientLibrarySettings implements IClientLibrarySettings { + + /** + * Constructs a new ClientLibrarySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IClientLibrarySettings); + + /** ClientLibrarySettings version. */ + public version: string; + + /** ClientLibrarySettings launchStage. */ + public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); + + /** ClientLibrarySettings restNumericEnums. */ + public restNumericEnums: boolean; + + /** ClientLibrarySettings javaSettings. */ + public javaSettings?: (google.api.IJavaSettings|null); + + /** ClientLibrarySettings cppSettings. */ + public cppSettings?: (google.api.ICppSettings|null); + + /** ClientLibrarySettings phpSettings. */ + public phpSettings?: (google.api.IPhpSettings|null); + + /** ClientLibrarySettings pythonSettings. */ + public pythonSettings?: (google.api.IPythonSettings|null); + + /** ClientLibrarySettings nodeSettings. */ + public nodeSettings?: (google.api.INodeSettings|null); + + /** ClientLibrarySettings dotnetSettings. */ + public dotnetSettings?: (google.api.IDotnetSettings|null); + + /** ClientLibrarySettings rubySettings. */ + public rubySettings?: (google.api.IRubySettings|null); + + /** ClientLibrarySettings goSettings. */ + public goSettings?: (google.api.IGoSettings|null); + + /** + * Creates a new ClientLibrarySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns ClientLibrarySettings instance + */ + public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; + + /** + * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. + * @param message ClientLibrarySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; + + /** + * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ClientLibrarySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; + + /** + * Verifies a ClientLibrarySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ClientLibrarySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; + + /** + * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. + * @param message ClientLibrarySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ClientLibrarySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ClientLibrarySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a Publishing. */ + interface IPublishing { + + /** Publishing methodSettings */ + methodSettings?: (google.api.IMethodSettings[]|null); + + /** Publishing newIssueUri */ + newIssueUri?: (string|null); + + /** Publishing documentationUri */ + documentationUri?: (string|null); + + /** Publishing apiShortName */ + apiShortName?: (string|null); + + /** Publishing githubLabel */ + githubLabel?: (string|null); + + /** Publishing codeownerGithubTeams */ + codeownerGithubTeams?: (string[]|null); + + /** Publishing docTagPrefix */ + docTagPrefix?: (string|null); + + /** Publishing organization */ + organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); + + /** Publishing librarySettings */ + librarySettings?: (google.api.IClientLibrarySettings[]|null); + + /** Publishing protoReferenceDocumentationUri */ + protoReferenceDocumentationUri?: (string|null); + + /** Publishing restReferenceDocumentationUri */ + restReferenceDocumentationUri?: (string|null); + } + + /** Represents a Publishing. */ + class Publishing implements IPublishing { + + /** + * Constructs a new Publishing. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPublishing); + + /** Publishing methodSettings. */ + public methodSettings: google.api.IMethodSettings[]; + + /** Publishing newIssueUri. */ + public newIssueUri: string; + + /** Publishing documentationUri. */ + public documentationUri: string; + + /** Publishing apiShortName. */ + public apiShortName: string; + + /** Publishing githubLabel. */ + public githubLabel: string; + + /** Publishing codeownerGithubTeams. */ + public codeownerGithubTeams: string[]; + + /** Publishing docTagPrefix. */ + public docTagPrefix: string; + + /** Publishing organization. */ + public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); + + /** Publishing librarySettings. */ + public librarySettings: google.api.IClientLibrarySettings[]; + + /** Publishing protoReferenceDocumentationUri. */ + public protoReferenceDocumentationUri: string; + + /** Publishing restReferenceDocumentationUri. */ + public restReferenceDocumentationUri: string; + + /** + * Creates a new Publishing instance using the specified properties. + * @param [properties] Properties to set + * @returns Publishing instance + */ + public static create(properties?: google.api.IPublishing): google.api.Publishing; + + /** + * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. + * @param message Publishing message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Publishing message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; + + /** + * Decodes a Publishing message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Publishing + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; + + /** + * Verifies a Publishing message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Publishing message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Publishing + */ + public static fromObject(object: { [k: string]: any }): google.api.Publishing; + + /** + * Creates a plain object from a Publishing message. Also converts values to other types if specified. + * @param message Publishing + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Publishing to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Publishing + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a JavaSettings. */ + interface IJavaSettings { + + /** JavaSettings libraryPackage */ + libraryPackage?: (string|null); + + /** JavaSettings serviceClassNames */ + serviceClassNames?: ({ [k: string]: string }|null); + + /** JavaSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a JavaSettings. */ + class JavaSettings implements IJavaSettings { + + /** + * Constructs a new JavaSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IJavaSettings); + + /** JavaSettings libraryPackage. */ + public libraryPackage: string; + + /** JavaSettings serviceClassNames. */ + public serviceClassNames: { [k: string]: string }; + + /** JavaSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new JavaSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns JavaSettings instance + */ + public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; + + /** + * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. + * @param message JavaSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a JavaSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; + + /** + * Decodes a JavaSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns JavaSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; + + /** + * Verifies a JavaSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns JavaSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; + + /** + * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. + * @param message JavaSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this JavaSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for JavaSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a CppSettings. */ + interface ICppSettings { + + /** CppSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a CppSettings. */ + class CppSettings implements ICppSettings { + + /** + * Constructs a new CppSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.ICppSettings); + + /** CppSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new CppSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns CppSettings instance + */ + public static create(properties?: google.api.ICppSettings): google.api.CppSettings; + + /** + * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. + * @param message CppSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a CppSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; + + /** + * Decodes a CppSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns CppSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; + + /** + * Verifies a CppSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns CppSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.CppSettings; + + /** + * Creates a plain object from a CppSettings message. Also converts values to other types if specified. + * @param message CppSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this CppSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for CppSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PhpSettings. */ + interface IPhpSettings { + + /** PhpSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PhpSettings. */ + class PhpSettings implements IPhpSettings { + + /** + * Constructs a new PhpSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPhpSettings); + + /** PhpSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PhpSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PhpSettings instance + */ + public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; + + /** + * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. + * @param message PhpSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PhpSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; + + /** + * Decodes a PhpSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PhpSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; + + /** + * Verifies a PhpSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PhpSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; + + /** + * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. + * @param message PhpSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PhpSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PhpSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a PythonSettings. */ + interface IPythonSettings { + + /** PythonSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a PythonSettings. */ + class PythonSettings implements IPythonSettings { + + /** + * Constructs a new PythonSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IPythonSettings); + + /** PythonSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new PythonSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PythonSettings instance + */ + public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; + + /** + * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. + * @param message PythonSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PythonSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; + + /** + * Decodes a PythonSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PythonSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; + + /** + * Verifies a PythonSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PythonSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; + + /** + * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. + * @param message PythonSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PythonSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PythonSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a NodeSettings. */ + interface INodeSettings { + + /** NodeSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a NodeSettings. */ + class NodeSettings implements INodeSettings { + + /** + * Constructs a new NodeSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.INodeSettings); + + /** NodeSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new NodeSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns NodeSettings instance + */ + public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; + + /** + * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. + * @param message NodeSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NodeSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; + + /** + * Decodes a NodeSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NodeSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; + + /** + * Verifies a NodeSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NodeSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; + + /** + * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. + * @param message NodeSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NodeSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for NodeSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DotnetSettings. */ + interface IDotnetSettings { + + /** DotnetSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices */ + renamedServices?: ({ [k: string]: string }|null); + + /** DotnetSettings renamedResources */ + renamedResources?: ({ [k: string]: string }|null); + + /** DotnetSettings ignoredResources */ + ignoredResources?: (string[]|null); + + /** DotnetSettings forcedNamespaceAliases */ + forcedNamespaceAliases?: (string[]|null); + + /** DotnetSettings handwrittenSignatures */ + handwrittenSignatures?: (string[]|null); + } + + /** Represents a DotnetSettings. */ + class DotnetSettings implements IDotnetSettings { + + /** + * Constructs a new DotnetSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IDotnetSettings); + + /** DotnetSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** DotnetSettings renamedServices. */ + public renamedServices: { [k: string]: string }; + + /** DotnetSettings renamedResources. */ + public renamedResources: { [k: string]: string }; + + /** DotnetSettings ignoredResources. */ + public ignoredResources: string[]; + + /** DotnetSettings forcedNamespaceAliases. */ + public forcedNamespaceAliases: string[]; + + /** DotnetSettings handwrittenSignatures. */ + public handwrittenSignatures: string[]; + + /** + * Creates a new DotnetSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns DotnetSettings instance + */ + public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; + + /** + * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. + * @param message DotnetSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; + + /** + * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DotnetSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; + + /** + * Verifies a DotnetSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DotnetSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; + + /** + * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. + * @param message DotnetSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DotnetSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DotnetSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a RubySettings. */ + interface IRubySettings { + + /** RubySettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a RubySettings. */ + class RubySettings implements IRubySettings { + + /** + * Constructs a new RubySettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IRubySettings); + + /** RubySettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new RubySettings instance using the specified properties. + * @param [properties] Properties to set + * @returns RubySettings instance + */ + public static create(properties?: google.api.IRubySettings): google.api.RubySettings; + + /** + * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. + * @param message RubySettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a RubySettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; + + /** + * Decodes a RubySettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns RubySettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; + + /** + * Verifies a RubySettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns RubySettings + */ + public static fromObject(object: { [k: string]: any }): google.api.RubySettings; + + /** + * Creates a plain object from a RubySettings message. Also converts values to other types if specified. + * @param message RubySettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this RubySettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for RubySettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a GoSettings. */ + interface IGoSettings { + + /** GoSettings common */ + common?: (google.api.ICommonLanguageSettings|null); + } + + /** Represents a GoSettings. */ + class GoSettings implements IGoSettings { + + /** + * Constructs a new GoSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IGoSettings); + + /** GoSettings common. */ + public common?: (google.api.ICommonLanguageSettings|null); + + /** + * Creates a new GoSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns GoSettings instance + */ + public static create(properties?: google.api.IGoSettings): google.api.GoSettings; + + /** + * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. + * @param message GoSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GoSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; + + /** + * Decodes a GoSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GoSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; + + /** + * Verifies a GoSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GoSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.GoSettings; + + /** + * Creates a plain object from a GoSettings message. Also converts values to other types if specified. + * @param message GoSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GoSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for GoSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodSettings. */ + interface IMethodSettings { + + /** MethodSettings selector */ + selector?: (string|null); + + /** MethodSettings longRunning */ + longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields */ + autoPopulatedFields?: (string[]|null); + } + + /** Represents a MethodSettings. */ + class MethodSettings implements IMethodSettings { + + /** + * Constructs a new MethodSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IMethodSettings); + + /** MethodSettings selector. */ + public selector: string; + + /** MethodSettings longRunning. */ + public longRunning?: (google.api.MethodSettings.ILongRunning|null); + + /** MethodSettings autoPopulatedFields. */ + public autoPopulatedFields: string[]; + + /** + * Creates a new MethodSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodSettings instance + */ + public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; + + /** + * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. + * @param message MethodSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; + + /** + * Decodes a MethodSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; + + /** + * Verifies a MethodSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodSettings + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; + + /** + * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. + * @param message MethodSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodSettings { + + /** Properties of a LongRunning. */ + interface ILongRunning { + + /** LongRunning initialPollDelay */ + initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier */ + pollDelayMultiplier?: (number|null); + + /** LongRunning maxPollDelay */ + maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout */ + totalPollTimeout?: (google.protobuf.IDuration|null); + } + + /** Represents a LongRunning. */ + class LongRunning implements ILongRunning { + + /** + * Constructs a new LongRunning. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.MethodSettings.ILongRunning); + + /** LongRunning initialPollDelay. */ + public initialPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning pollDelayMultiplier. */ + public pollDelayMultiplier: number; + + /** LongRunning maxPollDelay. */ + public maxPollDelay?: (google.protobuf.IDuration|null); + + /** LongRunning totalPollTimeout. */ + public totalPollTimeout?: (google.protobuf.IDuration|null); + + /** + * Creates a new LongRunning instance using the specified properties. + * @param [properties] Properties to set + * @returns LongRunning instance + */ + public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; + + /** + * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. + * @param message LongRunning message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a LongRunning message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; + + /** + * Decodes a LongRunning message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns LongRunning + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; + + /** + * Verifies a LongRunning message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns LongRunning + */ + public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; + + /** + * Creates a plain object from a LongRunning message. Also converts values to other types if specified. + * @param message LongRunning + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this LongRunning to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for LongRunning + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** ClientLibraryOrganization enum. */ + enum ClientLibraryOrganization { + CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, + CLOUD = 1, + ADS = 2, + PHOTOS = 3, + STREET_VIEW = 4, + SHOPPING = 5, + GEO = 6, + GENERATIVE_AI = 7 + } + + /** ClientLibraryDestination enum. */ + enum ClientLibraryDestination { + CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, + GITHUB = 10, + PACKAGE_MANAGER = 20 + } + + /** LaunchStage enum. */ + enum LaunchStage { + LAUNCH_STAGE_UNSPECIFIED = 0, + UNIMPLEMENTED = 6, + PRELAUNCH = 7, + EARLY_ACCESS = 1, + ALPHA = 2, + BETA = 3, + GA = 4, + DEPRECATED = 5 + } + + /** FieldBehavior enum. */ + enum FieldBehavior { + FIELD_BEHAVIOR_UNSPECIFIED = 0, + OPTIONAL = 1, + REQUIRED = 2, + OUTPUT_ONLY = 3, + INPUT_ONLY = 4, + IMMUTABLE = 5, + UNORDERED_LIST = 6, + NON_EMPTY_DEFAULT = 7, + IDENTIFIER = 8 + } + + /** Properties of a FieldInfo. */ + interface IFieldInfo { + + /** FieldInfo format */ + format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); + } + + /** Represents a FieldInfo. */ + class FieldInfo implements IFieldInfo { + + /** + * Constructs a new FieldInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IFieldInfo); + + /** FieldInfo format. */ + public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); + + /** + * Creates a new FieldInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldInfo instance + */ + public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @param message FieldInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; + + /** + * Verifies a FieldInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldInfo + */ + public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @param message FieldInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldInfo + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldInfo { + + /** Format enum. */ + enum Format { + FORMAT_UNSPECIFIED = 0, + UUID4 = 1, + IPV4 = 2, + IPV6 = 3, + IPV4_OR_IPV6 = 4 + } + } + + /** Properties of a ResourceDescriptor. */ + interface IResourceDescriptor { + + /** ResourceDescriptor type */ + type?: (string|null); + + /** ResourceDescriptor pattern */ + pattern?: (string[]|null); + + /** ResourceDescriptor nameField */ + nameField?: (string|null); + + /** ResourceDescriptor history */ + history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); + + /** ResourceDescriptor plural */ + plural?: (string|null); + + /** ResourceDescriptor singular */ + singular?: (string|null); + + /** ResourceDescriptor style */ + style?: (google.api.ResourceDescriptor.Style[]|null); + } + + /** Represents a ResourceDescriptor. */ + class ResourceDescriptor implements IResourceDescriptor { + + /** + * Constructs a new ResourceDescriptor. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceDescriptor); + + /** ResourceDescriptor type. */ + public type: string; + + /** ResourceDescriptor pattern. */ + public pattern: string[]; + + /** ResourceDescriptor nameField. */ + public nameField: string; + + /** ResourceDescriptor history. */ + public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); + + /** ResourceDescriptor plural. */ + public plural: string; + + /** ResourceDescriptor singular. */ + public singular: string; + + /** ResourceDescriptor style. */ + public style: google.api.ResourceDescriptor.Style[]; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceDescriptor instance + */ + public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @param message ResourceDescriptor message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; + + /** + * Verifies a ResourceDescriptor message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceDescriptor + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; + + /** + * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. + * @param message ResourceDescriptor + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceDescriptor to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceDescriptor + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceDescriptor { + + /** History enum. */ + enum History { + HISTORY_UNSPECIFIED = 0, + ORIGINALLY_SINGLE_PATTERN = 1, + FUTURE_MULTI_PATTERN = 2 + } + + /** Style enum. */ + enum Style { + STYLE_UNSPECIFIED = 0, + DECLARATIVE_FRIENDLY = 1 + } + } + + /** Properties of a ResourceReference. */ + interface IResourceReference { + + /** ResourceReference type */ + type?: (string|null); + + /** ResourceReference childType */ + childType?: (string|null); + } + + /** Represents a ResourceReference. */ + class ResourceReference implements IResourceReference { + + /** + * Constructs a new ResourceReference. + * @param [properties] Properties to set + */ + constructor(properties?: google.api.IResourceReference); + + /** ResourceReference type. */ + public type: string; + + /** ResourceReference childType. */ + public childType: string; + + /** + * Creates a new ResourceReference instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceReference instance + */ + public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; + + /** + * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. + * @param message ResourceReference message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceReference message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; + + /** + * Decodes a ResourceReference message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; + + /** + * Verifies a ResourceReference message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceReference + */ + public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; + + /** + * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. + * @param message ResourceReference + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceReference to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceReference + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorSet + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Edition enum. */ + enum Edition { + EDITION_UNKNOWN = 0, + EDITION_PROTO2 = 998, + EDITION_PROTO3 = 999, + EDITION_2023 = 1000, + EDITION_2024 = 1001, + EDITION_1_TEST_ONLY = 1, + EDITION_2_TEST_ONLY = 2, + EDITION_99997_TEST_ONLY = 99997, + EDITION_99998_TEST_ONLY = 99998, + EDITION_99999_TEST_ONLY = 99999, + EDITION_MAX = 2147483647 + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + + /** FileDescriptorProto edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** FileDescriptorProto edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for DescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ExtensionRangeOptions declaration */ + declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); + + /** ExtensionRangeOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification */ + verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** ExtensionRangeOptions declaration. */ + public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; + + /** ExtensionRangeOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ExtensionRangeOptions verification. */ + public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ExtensionRangeOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ExtensionRangeOptions { + + /** Properties of a Declaration. */ + interface IDeclaration { + + /** Declaration number */ + number?: (number|null); + + /** Declaration fullName */ + fullName?: (string|null); + + /** Declaration type */ + type?: (string|null); + + /** Declaration reserved */ + reserved?: (boolean|null); + + /** Declaration repeated */ + repeated?: (boolean|null); + } + + /** Represents a Declaration. */ + class Declaration implements IDeclaration { + + /** + * Constructs a new Declaration. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); + + /** Declaration number. */ + public number: number; + + /** Declaration fullName. */ + public fullName: string; + + /** Declaration type. */ + public type: string; + + /** Declaration reserved. */ + public reserved: boolean; + + /** Declaration repeated. */ + public repeated: boolean; + + /** + * Creates a new Declaration instance using the specified properties. + * @param [properties] Properties to set + * @returns Declaration instance + */ + public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. + * @param message Declaration message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Declaration message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Decodes a Declaration message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Declaration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Verifies a Declaration message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Declaration message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Declaration + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; + + /** + * Creates a plain object from a Declaration message. Also converts values to other types if specified. + * @param message Declaration + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Declaration to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for Declaration + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** VerificationState enum. */ + enum VerificationState { + DECLARATION = 0, + UNVERIFIED = 1 + } + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); + + /** FieldDescriptorProto type. */ + public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REPEATED = 3, + LABEL_REQUIRED = 2 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumReservedRange + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodDescriptorProto + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .google.api.resourceDefinition */ + ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FileOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** MessageOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .google.api.resource */ + ".google.api.resource"?: (google.api.IResourceDescriptor|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** MessageOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MessageOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions unverifiedLazy */ + unverifiedLazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions debugRedact */ + debugRedact?: (boolean|null); + + /** FieldOptions retention */ + retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); + + /** FieldOptions targets */ + targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); + + /** FieldOptions editionDefaults */ + editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); + + /** FieldOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .google.api.fieldBehavior */ + ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); + + /** FieldOptions .google.api.fieldInfo */ + ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); + + /** FieldOptions .google.api.resourceReference */ + ".google.api.resourceReference"?: (google.api.IResourceReference|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions unverifiedLazy. */ + public unverifiedLazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions debugRedact. */ + public debugRedact: boolean; + + /** FieldOptions retention. */ + public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); + + /** FieldOptions targets. */ + public targets: google.protobuf.FieldOptions.OptionTargetType[]; + + /** FieldOptions editionDefaults. */ + public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; + + /** FieldOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for FieldOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + + /** OptionRetention enum. */ + enum OptionRetention { + RETENTION_UNKNOWN = 0, + RETENTION_RUNTIME = 1, + RETENTION_SOURCE = 2 + } + + /** OptionTargetType enum. */ + enum OptionTargetType { + TARGET_TYPE_UNKNOWN = 0, + TARGET_TYPE_FILE = 1, + TARGET_TYPE_EXTENSION_RANGE = 2, + TARGET_TYPE_MESSAGE = 3, + TARGET_TYPE_FIELD = 4, + TARGET_TYPE_ONEOF = 5, + TARGET_TYPE_ENUM = 6, + TARGET_TYPE_ENUM_ENTRY = 7, + TARGET_TYPE_SERVICE = 8, + TARGET_TYPE_METHOD = 9 + } + + /** Properties of an EditionDefault. */ + interface IEditionDefault { + + /** EditionDefault edition */ + edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); + + /** EditionDefault value */ + value?: (string|null); + } + + /** Represents an EditionDefault. */ + class EditionDefault implements IEditionDefault { + + /** + * Constructs a new EditionDefault. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); + + /** EditionDefault edition. */ + public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); + + /** EditionDefault value. */ + public value: string; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @param [properties] Properties to set + * @returns EditionDefault instance + */ + public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @param message EditionDefault message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; + + /** + * Decodes an EditionDefault message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; + + /** + * Verifies an EditionDefault message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EditionDefault + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; + + /** + * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. + * @param message EditionDefault + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EditionDefault to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EditionDefault + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for OneofOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions deprecatedLegacyJsonFieldConflicts */ + deprecatedLegacyJsonFieldConflicts?: (boolean|null); + + /** EnumOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ + public deprecatedLegacyJsonFieldConflicts: boolean; + + /** EnumOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact */ + debugRedact?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** EnumValueOptions debugRedact. */ + public debugRedact: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for EnumValueOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** ServiceOptions .google.api.defaultHost */ + ".google.api.defaultHost"?: (string|null); + + /** ServiceOptions .google.api.oauthScopes */ + ".google.api.oauthScopes"?: (string|null); + + /** ServiceOptions .google.api.apiVersion */ + ".google.api.apiVersion"?: (string|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ServiceOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions features */ + features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MethodOptions .google.api.http */ + ".google.api.http"?: (google.api.IHttpRule|null); + + /** MethodOptions .google.api.methodSignature */ + ".google.api.methodSignature"?: (string[]|null); + + /** MethodOptions .google.longrunning.operationInfo */ + ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); + + /** MethodOptions features. */ + public features?: (google.protobuf.IFeatureSet|null); + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for MethodOptions + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|string|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|string|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|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 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 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 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 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 type. */ + namespace type { + + /** DayOfWeek enum. */ + enum DayOfWeek { + DAY_OF_WEEK_UNSPECIFIED = 0, + MONDAY = 1, + TUESDAY = 2, + WEDNESDAY = 3, + THURSDAY = 4, + FRIDAY = 5, + SATURDAY = 6, + SUNDAY = 7 + } + + /** Month enum. */ + enum Month { + MONTH_UNSPECIFIED = 0, + JANUARY = 1, + FEBRUARY = 2, + MARCH = 3, + APRIL = 4, + MAY = 5, + JUNE = 6, + JULY = 7, + AUGUST = 8, + SEPTEMBER = 9, + OCTOBER = 10, + NOVEMBER = 11, + DECEMBER = 12 + } + } + + /** 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 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; + } + } +} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/protos.js b/owl-bot-staging/google-cloud-backupdr/protos/protos.js new file mode 100644 index 00000000000..2eab54d52dd --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/protos.js @@ -0,0 +1,69448 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.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_backupdr_protos || ($protobuf.roots._google_cloud_backupdr_protos = {}); + + $root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.cloud = (function() { + + /** + * Namespace cloud. + * @memberof google + * @namespace + */ + var cloud = {}; + + cloud.backupdr = (function() { + + /** + * Namespace backupdr. + * @memberof google.cloud + * @namespace + */ + var backupdr = {}; + + backupdr.v1 = (function() { + + /** + * Namespace v1. + * @memberof google.cloud.backupdr + * @namespace + */ + var v1 = {}; + + v1.BackupDR = (function() { + + /** + * Constructs a new BackupDR service. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDR + * @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 BackupDR(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BackupDR.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackupDR; + + /** + * Creates new BackupDR service using the specified rpc implementation. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDR + * @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 {BackupDR} RPC service. Useful where requests and/or responses are streamed. + */ + BackupDR.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListManagementServersCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListManagementServersResponse} [response] ListManagementServersResponse + */ + + /** + * Calls ListManagementServers. + * @function listManagementServers + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListManagementServersRequest} request ListManagementServersRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListManagementServersCallback} callback Node-style callback called with the error, if any, and ListManagementServersResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listManagementServers = function listManagementServers(request, callback) { + return this.rpcCall(listManagementServers, $root.google.cloud.backupdr.v1.ListManagementServersRequest, $root.google.cloud.backupdr.v1.ListManagementServersResponse, request, callback); + }, "name", { value: "ListManagementServers" }); + + /** + * Calls ListManagementServers. + * @function listManagementServers + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListManagementServersRequest} request ListManagementServersRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetManagementServerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ManagementServer} [response] ManagementServer + */ + + /** + * Calls GetManagementServer. + * @function getManagementServer + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} request GetManagementServerRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetManagementServerCallback} callback Node-style callback called with the error, if any, and ManagementServer + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getManagementServer = function getManagementServer(request, callback) { + return this.rpcCall(getManagementServer, $root.google.cloud.backupdr.v1.GetManagementServerRequest, $root.google.cloud.backupdr.v1.ManagementServer, request, callback); + }, "name", { value: "GetManagementServer" }); + + /** + * Calls GetManagementServer. + * @function getManagementServer + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} request GetManagementServerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateManagementServerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateManagementServer. + * @function createManagementServer + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} request CreateManagementServerRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateManagementServerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createManagementServer = function createManagementServer(request, callback) { + return this.rpcCall(createManagementServer, $root.google.cloud.backupdr.v1.CreateManagementServerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateManagementServer" }); + + /** + * Calls CreateManagementServer. + * @function createManagementServer + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} request CreateManagementServerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteManagementServerCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteManagementServer. + * @function deleteManagementServer + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} request DeleteManagementServerRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteManagementServerCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteManagementServer = function deleteManagementServer(request, callback) { + return this.rpcCall(deleteManagementServer, $root.google.cloud.backupdr.v1.DeleteManagementServerRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteManagementServer" }); + + /** + * Calls DeleteManagementServer. + * @function deleteManagementServer + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} request DeleteManagementServerRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupVault. + * @function createBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupVault = function createBackupVault(request, callback) { + return this.rpcCall(createBackupVault, $root.google.cloud.backupdr.v1.CreateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupVault" }); + + /** + * Calls CreateBackupVault. + * @function createBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupVaultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} [response] ListBackupVaultsResponse + */ + + /** + * Calls ListBackupVaults. + * @function listBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback} callback Node-style callback called with the error, if any, and ListBackupVaultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupVaults = function listBackupVaults(request, callback) { + return this.rpcCall(listBackupVaults, $root.google.cloud.backupdr.v1.ListBackupVaultsRequest, $root.google.cloud.backupdr.v1.ListBackupVaultsResponse, request, callback); + }, "name", { value: "ListBackupVaults" }); + + /** + * Calls ListBackupVaults. + * @function listBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef FetchUsableBackupVaultsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} [response] FetchUsableBackupVaultsResponse + */ + + /** + * Calls FetchUsableBackupVaults. + * @function fetchUsableBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback} callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.fetchUsableBackupVaults = function fetchUsableBackupVaults(request, callback) { + return this.rpcCall(fetchUsableBackupVaults, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, request, callback); + }, "name", { value: "FetchUsableBackupVaults" }); + + /** + * Calls FetchUsableBackupVaults. + * @function fetchUsableBackupVaults + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupVault} [response] BackupVault + */ + + /** + * Calls GetBackupVault. + * @function getBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback} callback Node-style callback called with the error, if any, and BackupVault + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupVault = function getBackupVault(request, callback) { + return this.rpcCall(getBackupVault, $root.google.cloud.backupdr.v1.GetBackupVaultRequest, $root.google.cloud.backupdr.v1.BackupVault, request, callback); + }, "name", { value: "GetBackupVault" }); + + /** + * Calls GetBackupVault. + * @function getBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackupVault. + * @function updateBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackupVault = function updateBackupVault(request, callback) { + return this.rpcCall(updateBackupVault, $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackupVault" }); + + /** + * Calls UpdateBackupVault. + * @function updateBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupVaultCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupVault. + * @function deleteBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupVault = function deleteBackupVault(request, callback) { + return this.rpcCall(deleteBackupVault, $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupVault" }); + + /** + * Calls DeleteBackupVault. + * @function deleteBackupVault + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListDataSourcesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} [response] ListDataSourcesResponse + */ + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback} callback Node-style callback called with the error, if any, and ListDataSourcesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listDataSources = function listDataSources(request, callback) { + return this.rpcCall(listDataSources, $root.google.cloud.backupdr.v1.ListDataSourcesRequest, $root.google.cloud.backupdr.v1.ListDataSourcesResponse, request, callback); + }, "name", { value: "ListDataSources" }); + + /** + * Calls ListDataSources. + * @function listDataSources + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.DataSource} [response] DataSource + */ + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback} callback Node-style callback called with the error, if any, and DataSource + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getDataSource = function getDataSource(request, callback) { + return this.rpcCall(getDataSource, $root.google.cloud.backupdr.v1.GetDataSourceRequest, $root.google.cloud.backupdr.v1.DataSource, request, callback); + }, "name", { value: "GetDataSource" }); + + /** + * Calls GetDataSource. + * @function getDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateDataSourceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateDataSource. + * @function updateDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateDataSource = function updateDataSource(request, callback) { + return this.rpcCall(updateDataSource, $root.google.cloud.backupdr.v1.UpdateDataSourceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateDataSource" }); + + /** + * Calls UpdateDataSource. + * @function updateDataSource + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupsResponse} [response] ListBackupsResponse + */ + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackups = function listBackups(request, callback) { + return this.rpcCall(listBackups, $root.google.cloud.backupdr.v1.ListBackupsRequest, $root.google.cloud.backupdr.v1.ListBackupsResponse, request, callback); + }, "name", { value: "ListBackups" }); + + /** + * Calls ListBackups. + * @function listBackups + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupsForResourceType}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef FetchBackupsForResourceTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} [response] FetchBackupsForResourceTypeResponse + */ + + /** + * Calls FetchBackupsForResourceType. + * @function fetchBackupsForResourceType + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} request FetchBackupsForResourceTypeRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceTypeCallback} callback Node-style callback called with the error, if any, and FetchBackupsForResourceTypeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.fetchBackupsForResourceType = function fetchBackupsForResourceType(request, callback) { + return this.rpcCall(fetchBackupsForResourceType, $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest, $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse, request, callback); + }, "name", { value: "FetchBackupsForResourceType" }); + + /** + * Calls FetchBackupsForResourceType. + * @function fetchBackupsForResourceType + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} request FetchBackupsForResourceTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.Backup} [response] Backup + */ + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackup = function getBackup(request, callback) { + return this.rpcCall(getBackup, $root.google.cloud.backupdr.v1.GetBackupRequest, $root.google.cloud.backupdr.v1.Backup, request, callback); + }, "name", { value: "GetBackup" }); + + /** + * Calls GetBackup. + * @function getBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackup = function updateBackup(request, callback) { + return this.rpcCall(updateBackup, $root.google.cloud.backupdr.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackup" }); + + /** + * Calls UpdateBackup. + * @function updateBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackup = function deleteBackup(request, callback) { + return this.rpcCall(deleteBackup, $root.google.cloud.backupdr.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackup" }); + + /** + * Calls DeleteBackup. + * @function deleteBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef RestoreBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls RestoreBackup. + * @function restoreBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.restoreBackup = function restoreBackup(request, callback) { + return this.rpcCall(restoreBackup, $root.google.cloud.backupdr.v1.RestoreBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "RestoreBackup" }); + + /** + * Calls RestoreBackup. + * @function restoreBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupPlan = function createBackupPlan(request, callback) { + return this.rpcCall(createBackupPlan, $root.google.cloud.backupdr.v1.CreateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlan" }); + + /** + * Calls CreateBackupPlan. + * @function createBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackupPlan. + * @function updateBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} request UpdateBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackupPlan = function updateBackupPlan(request, callback) { + return this.rpcCall(updateBackupPlan, $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackupPlan" }); + + /** + * Calls UpdateBackupPlan. + * @function updateBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} request UpdateBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlan} [response] BackupPlan + */ + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback} callback Node-style callback called with the error, if any, and BackupPlan + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlan = function getBackupPlan(request, callback) { + return this.rpcCall(getBackupPlan, $root.google.cloud.backupdr.v1.GetBackupPlanRequest, $root.google.cloud.backupdr.v1.BackupPlan, request, callback); + }, "name", { value: "GetBackupPlan" }); + + /** + * Calls GetBackupPlan. + * @function getBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlansCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} [response] ListBackupPlansResponse + */ + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback} callback Node-style callback called with the error, if any, and ListBackupPlansResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlans = function listBackupPlans(request, callback) { + return this.rpcCall(listBackupPlans, $root.google.cloud.backupdr.v1.ListBackupPlansRequest, $root.google.cloud.backupdr.v1.ListBackupPlansResponse, request, callback); + }, "name", { value: "ListBackupPlans" }); + + /** + * Calls ListBackupPlans. + * @function listBackupPlans + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupPlanCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupPlan = function deleteBackupPlan(request, callback) { + return this.rpcCall(deleteBackupPlan, $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlan" }); + + /** + * Calls DeleteBackupPlan. + * @function deleteBackupPlan + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanRevision}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanRevisionCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlanRevision} [response] BackupPlanRevision + */ + + /** + * Calls GetBackupPlanRevision. + * @function getBackupPlanRevision + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} request GetBackupPlanRevisionRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevisionCallback} callback Node-style callback called with the error, if any, and BackupPlanRevision + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlanRevision = function getBackupPlanRevision(request, callback) { + return this.rpcCall(getBackupPlanRevision, $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest, $root.google.cloud.backupdr.v1.BackupPlanRevision, request, callback); + }, "name", { value: "GetBackupPlanRevision" }); + + /** + * Calls GetBackupPlanRevision. + * @function getBackupPlanRevision + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} request GetBackupPlanRevisionRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanRevisions}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlanRevisionsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} [response] ListBackupPlanRevisionsResponse + */ + + /** + * Calls ListBackupPlanRevisions. + * @function listBackupPlanRevisions + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} request ListBackupPlanRevisionsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisionsCallback} callback Node-style callback called with the error, if any, and ListBackupPlanRevisionsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlanRevisions = function listBackupPlanRevisions(request, callback) { + return this.rpcCall(listBackupPlanRevisions, $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest, $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse, request, callback); + }, "name", { value: "ListBackupPlanRevisions" }); + + /** + * Calls ListBackupPlanRevisions. + * @function listBackupPlanRevisions + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} request ListBackupPlanRevisionsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef CreateBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls CreateBackupPlanAssociation. + * @function createBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.createBackupPlanAssociation = function createBackupPlanAssociation(request, callback) { + return this.rpcCall(createBackupPlanAssociation, $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "CreateBackupPlanAssociation" }); + + /** + * Calls CreateBackupPlanAssociation. + * @function createBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef UpdateBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls UpdateBackupPlanAssociation. + * @function updateBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} request UpdateBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.updateBackupPlanAssociation = function updateBackupPlanAssociation(request, callback) { + return this.rpcCall(updateBackupPlanAssociation, $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "UpdateBackupPlanAssociation" }); + + /** + * Calls UpdateBackupPlanAssociation. + * @function updateBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} request UpdateBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} [response] BackupPlanAssociation + */ + + /** + * Calls GetBackupPlanAssociation. + * @function getBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and BackupPlanAssociation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getBackupPlanAssociation = function getBackupPlanAssociation(request, callback) { + return this.rpcCall(getBackupPlanAssociation, $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, $root.google.cloud.backupdr.v1.BackupPlanAssociation, request, callback); + }, "name", { value: "GetBackupPlanAssociation" }); + + /** + * Calls GetBackupPlanAssociation. + * @function getBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListBackupPlanAssociationsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} [response] ListBackupPlanAssociationsResponse + */ + + /** + * Calls ListBackupPlanAssociations. + * @function listBackupPlanAssociations + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback} callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listBackupPlanAssociations = function listBackupPlanAssociations(request, callback) { + return this.rpcCall(listBackupPlanAssociations, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, request, callback); + }, "name", { value: "ListBackupPlanAssociations" }); + + /** + * Calls ListBackupPlanAssociations. + * @function listBackupPlanAssociations + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupPlanAssociationsForResourceType}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef FetchBackupPlanAssociationsForResourceTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} [response] FetchBackupPlanAssociationsForResourceTypeResponse + */ + + /** + * Calls FetchBackupPlanAssociationsForResourceType. + * @function fetchBackupPlanAssociationsForResourceType + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceTypeCallback} callback Node-style callback called with the error, if any, and FetchBackupPlanAssociationsForResourceTypeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.fetchBackupPlanAssociationsForResourceType = function fetchBackupPlanAssociationsForResourceType(request, callback) { + return this.rpcCall(fetchBackupPlanAssociationsForResourceType, $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest, $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse, request, callback); + }, "name", { value: "FetchBackupPlanAssociationsForResourceType" }); + + /** + * Calls FetchBackupPlanAssociationsForResourceType. + * @function fetchBackupPlanAssociationsForResourceType + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef DeleteBackupPlanAssociationCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls DeleteBackupPlanAssociation. + * @function deleteBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.deleteBackupPlanAssociation = function deleteBackupPlanAssociation(request, callback) { + return this.rpcCall(deleteBackupPlanAssociation, $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "DeleteBackupPlanAssociation" }); + + /** + * Calls DeleteBackupPlanAssociation. + * @function deleteBackupPlanAssociation + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef TriggerBackupCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls TriggerBackup. + * @function triggerBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.triggerBackup = function triggerBackup(request, callback) { + return this.rpcCall(triggerBackup, $root.google.cloud.backupdr.v1.TriggerBackupRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "TriggerBackup" }); + + /** + * Calls TriggerBackup. + * @function triggerBackup + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSourceReference}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef GetDataSourceReferenceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.DataSourceReference} [response] DataSourceReference + */ + + /** + * Calls GetDataSourceReference. + * @function getDataSourceReference + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} request GetDataSourceReferenceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.GetDataSourceReferenceCallback} callback Node-style callback called with the error, if any, and DataSourceReference + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.getDataSourceReference = function getDataSourceReference(request, callback) { + return this.rpcCall(getDataSourceReference, $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest, $root.google.cloud.backupdr.v1.DataSourceReference, request, callback); + }, "name", { value: "GetDataSourceReference" }); + + /** + * Calls GetDataSourceReference. + * @function getDataSourceReference + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} request GetDataSourceReferenceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSourceReferences}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef ListDataSourceReferencesCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} [response] ListDataSourceReferencesResponse + */ + + /** + * Calls ListDataSourceReferences. + * @function listDataSourceReferences + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} request ListDataSourceReferencesRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.ListDataSourceReferencesCallback} callback Node-style callback called with the error, if any, and ListDataSourceReferencesResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.listDataSourceReferences = function listDataSourceReferences(request, callback) { + return this.rpcCall(listDataSourceReferences, $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest, $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse, request, callback); + }, "name", { value: "ListDataSourceReferences" }); + + /** + * Calls ListDataSourceReferences. + * @function listDataSourceReferences + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} request ListDataSourceReferencesRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchDataSourceReferencesForResourceType}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef FetchDataSourceReferencesForResourceTypeCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} [response] FetchDataSourceReferencesForResourceTypeResponse + */ + + /** + * Calls FetchDataSourceReferencesForResourceType. + * @function fetchDataSourceReferencesForResourceType + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} request FetchDataSourceReferencesForResourceTypeRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceTypeCallback} callback Node-style callback called with the error, if any, and FetchDataSourceReferencesForResourceTypeResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.fetchDataSourceReferencesForResourceType = function fetchDataSourceReferencesForResourceType(request, callback) { + return this.rpcCall(fetchDataSourceReferencesForResourceType, $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest, $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse, request, callback); + }, "name", { value: "FetchDataSourceReferencesForResourceType" }); + + /** + * Calls FetchDataSourceReferencesForResourceType. + * @function fetchDataSourceReferencesForResourceType + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} request FetchDataSourceReferencesForResourceTypeRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|initializeService}. + * @memberof google.cloud.backupdr.v1.BackupDR + * @typedef InitializeServiceCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.longrunning.Operation} [response] Operation + */ + + /** + * Calls InitializeService. + * @function initializeService + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} request InitializeServiceRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDR.InitializeServiceCallback} callback Node-style callback called with the error, if any, and Operation + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDR.prototype.initializeService = function initializeService(request, callback) { + return this.rpcCall(initializeService, $root.google.cloud.backupdr.v1.InitializeServiceRequest, $root.google.longrunning.Operation, request, callback); + }, "name", { value: "InitializeService" }); + + /** + * Calls InitializeService. + * @function initializeService + * @memberof google.cloud.backupdr.v1.BackupDR + * @instance + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} request InitializeServiceRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BackupDR; + })(); + + v1.NetworkConfig = (function() { + + /** + * Properties of a NetworkConfig. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkConfig + * @property {string|null} [network] NetworkConfig network + * @property {google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null} [peeringMode] NetworkConfig peeringMode + */ + + /** + * Constructs a new NetworkConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkConfig. + * @implements INetworkConfig + * @constructor + * @param {google.cloud.backupdr.v1.INetworkConfig=} [properties] Properties to set + */ + function NetworkConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkConfig network. + * @member {string} network + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.network = ""; + + /** + * NetworkConfig peeringMode. + * @member {google.cloud.backupdr.v1.NetworkConfig.PeeringMode} peeringMode + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @instance + */ + NetworkConfig.prototype.peeringMode = 0; + + /** + * Creates a new NetworkConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig instance + */ + NetworkConfig.create = function create(properties) { + return new NetworkConfig(properties); + }; + + /** + * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.peeringMode != null && Object.hasOwnProperty.call(message, "peeringMode")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.peeringMode); + return writer; + }; + + /** + * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkConfig} message NetworkConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.peeringMode = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.network != null && message.hasOwnProperty("network")) + if (!$util.isString(message.network)) + return "network: string expected"; + if (message.peeringMode != null && message.hasOwnProperty("peeringMode")) + switch (message.peeringMode) { + default: + return "peeringMode: enum value expected"; + case 0: + case 1: + break; + } + return null; + }; + + /** + * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig + */ + NetworkConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkConfig(); + if (object.network != null) + message.network = String(object.network); + switch (object.peeringMode) { + default: + if (typeof object.peeringMode === "number") { + message.peeringMode = object.peeringMode; + break; + } + break; + case "PEERING_MODE_UNSPECIFIED": + case 0: + message.peeringMode = 0; + break; + case "PRIVATE_SERVICE_ACCESS": + case 1: + message.peeringMode = 1; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {google.cloud.backupdr.v1.NetworkConfig} message NetworkConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.network = ""; + object.peeringMode = options.enums === String ? "PEERING_MODE_UNSPECIFIED" : 0; + } + if (message.network != null && message.hasOwnProperty("network")) + object.network = message.network; + if (message.peeringMode != null && message.hasOwnProperty("peeringMode")) + object.peeringMode = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkConfig.PeeringMode[message.peeringMode] === undefined ? message.peeringMode : $root.google.cloud.backupdr.v1.NetworkConfig.PeeringMode[message.peeringMode] : message.peeringMode; + return object; + }; + + /** + * Converts this NetworkConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkConfig"; + }; + + /** + * PeeringMode enum. + * @name google.cloud.backupdr.v1.NetworkConfig.PeeringMode + * @enum {number} + * @property {number} PEERING_MODE_UNSPECIFIED=0 PEERING_MODE_UNSPECIFIED value + * @property {number} PRIVATE_SERVICE_ACCESS=1 PRIVATE_SERVICE_ACCESS value + */ + NetworkConfig.PeeringMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PEERING_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRIVATE_SERVICE_ACCESS"] = 1; + return values; + })(); + + return NetworkConfig; + })(); + + v1.ManagementURI = (function() { + + /** + * Properties of a ManagementURI. + * @memberof google.cloud.backupdr.v1 + * @interface IManagementURI + * @property {string|null} [webUi] ManagementURI webUi + * @property {string|null} [api] ManagementURI api + */ + + /** + * Constructs a new ManagementURI. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ManagementURI. + * @implements IManagementURI + * @constructor + * @param {google.cloud.backupdr.v1.IManagementURI=} [properties] Properties to set + */ + function ManagementURI(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagementURI webUi. + * @member {string} webUi + * @memberof google.cloud.backupdr.v1.ManagementURI + * @instance + */ + ManagementURI.prototype.webUi = ""; + + /** + * ManagementURI api. + * @member {string} api + * @memberof google.cloud.backupdr.v1.ManagementURI + * @instance + */ + ManagementURI.prototype.api = ""; + + /** + * Creates a new ManagementURI instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {google.cloud.backupdr.v1.IManagementURI=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI instance + */ + ManagementURI.create = function create(properties) { + return new ManagementURI(properties); + }; + + /** + * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {google.cloud.backupdr.v1.IManagementURI} message ManagementURI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementURI.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.webUi != null && Object.hasOwnProperty.call(message, "webUi")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.webUi); + if (message.api != null && Object.hasOwnProperty.call(message, "api")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.api); + return writer; + }; + + /** + * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {google.cloud.backupdr.v1.IManagementURI} message ManagementURI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementURI.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagementURI message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementURI.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ManagementURI(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.webUi = reader.string(); + break; + } + case 2: { + message.api = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagementURI message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementURI.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagementURI message. + * @function verify + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagementURI.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.webUi != null && message.hasOwnProperty("webUi")) + if (!$util.isString(message.webUi)) + return "webUi: string expected"; + if (message.api != null && message.hasOwnProperty("api")) + if (!$util.isString(message.api)) + return "api: string expected"; + return null; + }; + + /** + * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI + */ + ManagementURI.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ManagementURI) + return object; + var message = new $root.google.cloud.backupdr.v1.ManagementURI(); + if (object.webUi != null) + message.webUi = String(object.webUi); + if (object.api != null) + message.api = String(object.api); + return message; + }; + + /** + * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {google.cloud.backupdr.v1.ManagementURI} message ManagementURI + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagementURI.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.webUi = ""; + object.api = ""; + } + if (message.webUi != null && message.hasOwnProperty("webUi")) + object.webUi = message.webUi; + if (message.api != null && message.hasOwnProperty("api")) + object.api = message.api; + return object; + }; + + /** + * Converts this ManagementURI to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ManagementURI + * @instance + * @returns {Object.} JSON object + */ + ManagementURI.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagementURI + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ManagementURI + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagementURI.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ManagementURI"; + }; + + return ManagementURI; + })(); + + v1.WorkforceIdentityBasedManagementURI = (function() { + + /** + * Properties of a WorkforceIdentityBasedManagementURI. + * @memberof google.cloud.backupdr.v1 + * @interface IWorkforceIdentityBasedManagementURI + * @property {string|null} [firstPartyManagementUri] WorkforceIdentityBasedManagementURI firstPartyManagementUri + * @property {string|null} [thirdPartyManagementUri] WorkforceIdentityBasedManagementURI thirdPartyManagementUri + */ + + /** + * Constructs a new WorkforceIdentityBasedManagementURI. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a WorkforceIdentityBasedManagementURI. + * @implements IWorkforceIdentityBasedManagementURI + * @constructor + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI=} [properties] Properties to set + */ + function WorkforceIdentityBasedManagementURI(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkforceIdentityBasedManagementURI firstPartyManagementUri. + * @member {string} firstPartyManagementUri + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @instance + */ + WorkforceIdentityBasedManagementURI.prototype.firstPartyManagementUri = ""; + + /** + * WorkforceIdentityBasedManagementURI thirdPartyManagementUri. + * @member {string} thirdPartyManagementUri + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @instance + */ + WorkforceIdentityBasedManagementURI.prototype.thirdPartyManagementUri = ""; + + /** + * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI instance + */ + WorkforceIdentityBasedManagementURI.create = function create(properties) { + return new WorkforceIdentityBasedManagementURI(properties); + }; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI} message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkforceIdentityBasedManagementURI.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstPartyManagementUri != null && Object.hasOwnProperty.call(message, "firstPartyManagementUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyManagementUri); + if (message.thirdPartyManagementUri != null && Object.hasOwnProperty.call(message, "thirdPartyManagementUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyManagementUri); + return writer; + }; + + /** + * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI} message WorkforceIdentityBasedManagementURI message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkforceIdentityBasedManagementURI.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkforceIdentityBasedManagementURI.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.firstPartyManagementUri = reader.string(); + break; + } + case 2: { + message.thirdPartyManagementUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkforceIdentityBasedManagementURI.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkforceIdentityBasedManagementURI message. + * @function verify + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkforceIdentityBasedManagementURI.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) + if (!$util.isString(message.firstPartyManagementUri)) + return "firstPartyManagementUri: string expected"; + if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) + if (!$util.isString(message.thirdPartyManagementUri)) + return "thirdPartyManagementUri: string expected"; + return null; + }; + + /** + * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI + */ + WorkforceIdentityBasedManagementURI.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI) + return object; + var message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI(); + if (object.firstPartyManagementUri != null) + message.firstPartyManagementUri = String(object.firstPartyManagementUri); + if (object.thirdPartyManagementUri != null) + message.thirdPartyManagementUri = String(object.thirdPartyManagementUri); + return message; + }; + + /** + * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} message WorkforceIdentityBasedManagementURI + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkforceIdentityBasedManagementURI.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstPartyManagementUri = ""; + object.thirdPartyManagementUri = ""; + } + if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) + object.firstPartyManagementUri = message.firstPartyManagementUri; + if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) + object.thirdPartyManagementUri = message.thirdPartyManagementUri; + return object; + }; + + /** + * Converts this WorkforceIdentityBasedManagementURI to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @instance + * @returns {Object.} JSON object + */ + WorkforceIdentityBasedManagementURI.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkforceIdentityBasedManagementURI + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkforceIdentityBasedManagementURI.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI"; + }; + + return WorkforceIdentityBasedManagementURI; + })(); + + v1.WorkforceIdentityBasedOAuth2ClientID = (function() { + + /** + * Properties of a WorkforceIdentityBasedOAuth2ClientID. + * @memberof google.cloud.backupdr.v1 + * @interface IWorkforceIdentityBasedOAuth2ClientID + * @property {string|null} [firstPartyOauth2ClientId] WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId + * @property {string|null} [thirdPartyOauth2ClientId] WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId + */ + + /** + * Constructs a new WorkforceIdentityBasedOAuth2ClientID. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a WorkforceIdentityBasedOAuth2ClientID. + * @implements IWorkforceIdentityBasedOAuth2ClientID + * @constructor + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID=} [properties] Properties to set + */ + function WorkforceIdentityBasedOAuth2ClientID(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. + * @member {string} firstPartyOauth2ClientId + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @instance + */ + WorkforceIdentityBasedOAuth2ClientID.prototype.firstPartyOauth2ClientId = ""; + + /** + * WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. + * @member {string} thirdPartyOauth2ClientId + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @instance + */ + WorkforceIdentityBasedOAuth2ClientID.prototype.thirdPartyOauth2ClientId = ""; + + /** + * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID instance + */ + WorkforceIdentityBasedOAuth2ClientID.create = function create(properties) { + return new WorkforceIdentityBasedOAuth2ClientID(properties); + }; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID} message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkforceIdentityBasedOAuth2ClientID.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstPartyOauth2ClientId != null && Object.hasOwnProperty.call(message, "firstPartyOauth2ClientId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyOauth2ClientId); + if (message.thirdPartyOauth2ClientId != null && Object.hasOwnProperty.call(message, "thirdPartyOauth2ClientId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyOauth2ClientId); + return writer; + }; + + /** + * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID} message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WorkforceIdentityBasedOAuth2ClientID.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkforceIdentityBasedOAuth2ClientID.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.firstPartyOauth2ClientId = reader.string(); + break; + } + case 2: { + message.thirdPartyOauth2ClientId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WorkforceIdentityBasedOAuth2ClientID.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WorkforceIdentityBasedOAuth2ClientID message. + * @function verify + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WorkforceIdentityBasedOAuth2ClientID.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstPartyOauth2ClientId != null && message.hasOwnProperty("firstPartyOauth2ClientId")) + if (!$util.isString(message.firstPartyOauth2ClientId)) + return "firstPartyOauth2ClientId: string expected"; + if (message.thirdPartyOauth2ClientId != null && message.hasOwnProperty("thirdPartyOauth2ClientId")) + if (!$util.isString(message.thirdPartyOauth2ClientId)) + return "thirdPartyOauth2ClientId: string expected"; + return null; + }; + + /** + * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID + */ + WorkforceIdentityBasedOAuth2ClientID.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID) + return object; + var message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID(); + if (object.firstPartyOauth2ClientId != null) + message.firstPartyOauth2ClientId = String(object.firstPartyOauth2ClientId); + if (object.thirdPartyOauth2ClientId != null) + message.thirdPartyOauth2ClientId = String(object.thirdPartyOauth2ClientId); + return message; + }; + + /** + * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} message WorkforceIdentityBasedOAuth2ClientID + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WorkforceIdentityBasedOAuth2ClientID.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstPartyOauth2ClientId = ""; + object.thirdPartyOauth2ClientId = ""; + } + if (message.firstPartyOauth2ClientId != null && message.hasOwnProperty("firstPartyOauth2ClientId")) + object.firstPartyOauth2ClientId = message.firstPartyOauth2ClientId; + if (message.thirdPartyOauth2ClientId != null && message.hasOwnProperty("thirdPartyOauth2ClientId")) + object.thirdPartyOauth2ClientId = message.thirdPartyOauth2ClientId; + return object; + }; + + /** + * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @instance + * @returns {Object.} JSON object + */ + WorkforceIdentityBasedOAuth2ClientID.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WorkforceIdentityBasedOAuth2ClientID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID"; + }; + + return WorkforceIdentityBasedOAuth2ClientID; + })(); + + v1.ManagementServer = (function() { + + /** + * Properties of a ManagementServer. + * @memberof google.cloud.backupdr.v1 + * @interface IManagementServer + * @property {string|null} [name] ManagementServer name + * @property {string|null} [description] ManagementServer description + * @property {Object.|null} [labels] ManagementServer labels + * @property {google.protobuf.ITimestamp|null} [createTime] ManagementServer createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] ManagementServer updateTime + * @property {google.cloud.backupdr.v1.ManagementServer.InstanceType|null} [type] ManagementServer type + * @property {google.cloud.backupdr.v1.IManagementURI|null} [managementUri] ManagementServer managementUri + * @property {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null} [workforceIdentityBasedManagementUri] ManagementServer workforceIdentityBasedManagementUri + * @property {google.cloud.backupdr.v1.ManagementServer.InstanceState|null} [state] ManagementServer state + * @property {Array.|null} [networks] ManagementServer networks + * @property {string|null} [etag] ManagementServer etag + * @property {string|null} [oauth2ClientId] ManagementServer oauth2ClientId + * @property {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null} [workforceIdentityBasedOauth2ClientId] ManagementServer workforceIdentityBasedOauth2ClientId + * @property {Array.|null} [baProxyUri] ManagementServer baProxyUri + * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] ManagementServer satisfiesPzs + * @property {boolean|null} [satisfiesPzi] ManagementServer satisfiesPzi + */ + + /** + * Constructs a new ManagementServer. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ManagementServer. + * @implements IManagementServer + * @constructor + * @param {google.cloud.backupdr.v1.IManagementServer=} [properties] Properties to set + */ + function ManagementServer(properties) { + this.labels = {}; + this.networks = []; + this.baProxyUri = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ManagementServer name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.name = ""; + + /** + * ManagementServer description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.description = ""; + + /** + * ManagementServer labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.labels = $util.emptyObject; + + /** + * ManagementServer createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.createTime = null; + + /** + * ManagementServer updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.updateTime = null; + + /** + * ManagementServer type. + * @member {google.cloud.backupdr.v1.ManagementServer.InstanceType} type + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.type = 0; + + /** + * ManagementServer managementUri. + * @member {google.cloud.backupdr.v1.IManagementURI|null|undefined} managementUri + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.managementUri = null; + + /** + * ManagementServer workforceIdentityBasedManagementUri. + * @member {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null|undefined} workforceIdentityBasedManagementUri + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.workforceIdentityBasedManagementUri = null; + + /** + * ManagementServer state. + * @member {google.cloud.backupdr.v1.ManagementServer.InstanceState} state + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.state = 0; + + /** + * ManagementServer networks. + * @member {Array.} networks + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.networks = $util.emptyArray; + + /** + * ManagementServer etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.etag = ""; + + /** + * ManagementServer oauth2ClientId. + * @member {string} oauth2ClientId + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.oauth2ClientId = ""; + + /** + * ManagementServer workforceIdentityBasedOauth2ClientId. + * @member {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null|undefined} workforceIdentityBasedOauth2ClientId + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.workforceIdentityBasedOauth2ClientId = null; + + /** + * ManagementServer baProxyUri. + * @member {Array.} baProxyUri + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.baProxyUri = $util.emptyArray; + + /** + * ManagementServer satisfiesPzs. + * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.satisfiesPzs = null; + + /** + * ManagementServer satisfiesPzi. + * @member {boolean} satisfiesPzi + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + */ + ManagementServer.prototype.satisfiesPzi = false; + + /** + * Creates a new ManagementServer instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {google.cloud.backupdr.v1.IManagementServer=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer instance + */ + ManagementServer.create = function create(properties) { + return new ManagementServer(properties); + }; + + /** + * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {google.cloud.backupdr.v1.IManagementServer} message ManagementServer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementServer.encode = function encode(message, writer) { + if (!writer) + 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, 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(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.networks != null && message.networks.length) + for (var i = 0; i < message.networks.length; ++i) + $root.google.cloud.backupdr.v1.NetworkConfig.encode(message.networks[i], 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.managementUri != null && Object.hasOwnProperty.call(message, "managementUri")) + $root.google.cloud.backupdr.v1.ManagementURI.encode(message.managementUri, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.etag); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.type); + if (message.oauth2ClientId != null && Object.hasOwnProperty.call(message, "oauth2ClientId")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.oauth2ClientId); + if (message.workforceIdentityBasedManagementUri != null && Object.hasOwnProperty.call(message, "workforceIdentityBasedManagementUri")) + $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.encode(message.workforceIdentityBasedManagementUri, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); + if (message.workforceIdentityBasedOauth2ClientId != null && Object.hasOwnProperty.call(message, "workforceIdentityBasedOauth2ClientId")) + $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.encode(message.workforceIdentityBasedOauth2ClientId, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.baProxyUri != null && message.baProxyUri.length) + for (var i = 0; i < message.baProxyUri.length; ++i) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.baProxyUri[i]); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.satisfiesPzi); + return writer; + }; + + /** + * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {google.cloud.backupdr.v1.IManagementServer} message ManagementServer message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ManagementServer.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ManagementServer message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementServer.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ManagementServer(), 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 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 2: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 14: { + message.type = reader.int32(); + break; + } + case 11: { + message.managementUri = $root.google.cloud.backupdr.v1.ManagementURI.decode(reader, reader.uint32()); + break; + } + case 16: { + message.workforceIdentityBasedManagementUri = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + if (!(message.networks && message.networks.length)) + message.networks = []; + message.networks.push($root.google.cloud.backupdr.v1.NetworkConfig.decode(reader, reader.uint32())); + break; + } + case 13: { + message.etag = reader.string(); + break; + } + case 15: { + message.oauth2ClientId = reader.string(); + break; + } + case 17: { + message.workforceIdentityBasedOauth2ClientId = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.decode(reader, reader.uint32()); + break; + } + case 18: { + if (!(message.baProxyUri && message.baProxyUri.length)) + message.baProxyUri = []; + message.baProxyUri.push(reader.string()); + break; + } + case 19: { + message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); + break; + } + case 20: { + message.satisfiesPzi = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ManagementServer message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ManagementServer.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ManagementServer message. + * @function verify + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ManagementServer.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.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.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.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + break; + } + if (message.managementUri != null && message.hasOwnProperty("managementUri")) { + var error = $root.google.cloud.backupdr.v1.ManagementURI.verify(message.managementUri); + if (error) + return "managementUri." + error; + } + if (message.workforceIdentityBasedManagementUri != null && message.hasOwnProperty("workforceIdentityBasedManagementUri")) { + var error = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify(message.workforceIdentityBasedManagementUri); + if (error) + return "workforceIdentityBasedManagementUri." + 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: + case 7: + break; + } + if (message.networks != null && message.hasOwnProperty("networks")) { + if (!Array.isArray(message.networks)) + return "networks: array expected"; + for (var i = 0; i < message.networks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkConfig.verify(message.networks[i]); + if (error) + return "networks." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) + if (!$util.isString(message.oauth2ClientId)) + return "oauth2ClientId: string expected"; + if (message.workforceIdentityBasedOauth2ClientId != null && message.hasOwnProperty("workforceIdentityBasedOauth2ClientId")) { + var error = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify(message.workforceIdentityBasedOauth2ClientId); + if (error) + return "workforceIdentityBasedOauth2ClientId." + error; + } + if (message.baProxyUri != null && message.hasOwnProperty("baProxyUri")) { + if (!Array.isArray(message.baProxyUri)) + return "baProxyUri: array expected"; + for (var i = 0; i < message.baProxyUri.length; ++i) + if (!$util.isString(message.baProxyUri[i])) + return "baProxyUri: string[] expected"; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); + if (error) + return "satisfiesPzs." + error; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + return null; + }; + + /** + * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer + */ + ManagementServer.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ManagementServer) + return object; + var message = new $root.google.cloud.backupdr.v1.ManagementServer(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.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.backupdr.v1.ManagementServer.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "INSTANCE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "BACKUP_RESTORE": + case 1: + message.type = 1; + break; + } + if (object.managementUri != null) { + if (typeof object.managementUri !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.managementUri: object expected"); + message.managementUri = $root.google.cloud.backupdr.v1.ManagementURI.fromObject(object.managementUri); + } + if (object.workforceIdentityBasedManagementUri != null) { + if (typeof object.workforceIdentityBasedManagementUri !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.workforceIdentityBasedManagementUri: object expected"); + message.workforceIdentityBasedManagementUri = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.fromObject(object.workforceIdentityBasedManagementUri); + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "INSTANCE_STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "READY": + case 2: + message.state = 2; + break; + case "UPDATING": + case 3: + message.state = 3; + break; + case "DELETING": + case 4: + message.state = 4; + break; + case "REPAIRING": + case 5: + message.state = 5; + break; + case "MAINTENANCE": + case 6: + message.state = 6; + break; + case "ERROR": + case 7: + message.state = 7; + break; + } + if (object.networks) { + if (!Array.isArray(object.networks)) + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.networks: array expected"); + message.networks = []; + for (var i = 0; i < object.networks.length; ++i) { + if (typeof object.networks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.networks: object expected"); + message.networks[i] = $root.google.cloud.backupdr.v1.NetworkConfig.fromObject(object.networks[i]); + } + } + if (object.etag != null) + message.etag = String(object.etag); + if (object.oauth2ClientId != null) + message.oauth2ClientId = String(object.oauth2ClientId); + if (object.workforceIdentityBasedOauth2ClientId != null) { + if (typeof object.workforceIdentityBasedOauth2ClientId !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.workforceIdentityBasedOauth2ClientId: object expected"); + message.workforceIdentityBasedOauth2ClientId = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.fromObject(object.workforceIdentityBasedOauth2ClientId); + } + if (object.baProxyUri) { + if (!Array.isArray(object.baProxyUri)) + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.baProxyUri: array expected"); + message.baProxyUri = []; + for (var i = 0; i < object.baProxyUri.length; ++i) + message.baProxyUri[i] = String(object.baProxyUri[i]); + } + if (object.satisfiesPzs != null) { + if (typeof object.satisfiesPzs !== "object") + throw TypeError(".google.cloud.backupdr.v1.ManagementServer.satisfiesPzs: object expected"); + message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); + } + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + return message; + }; + + /** + * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {google.cloud.backupdr.v1.ManagementServer} message ManagementServer + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ManagementServer.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networks = []; + object.baProxyUri = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "INSTANCE_STATE_UNSPECIFIED" : 0; + object.description = ""; + object.managementUri = null; + object.etag = ""; + object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; + object.oauth2ClientId = ""; + object.workforceIdentityBasedManagementUri = null; + object.workforceIdentityBasedOauth2ClientId = null; + object.satisfiesPzs = null; + object.satisfiesPzi = false; + } + 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.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.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.ManagementServer.InstanceState[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.ManagementServer.InstanceState[message.state] : message.state; + if (message.networks && message.networks.length) { + object.networks = []; + for (var j = 0; j < message.networks.length; ++j) + object.networks[j] = $root.google.cloud.backupdr.v1.NetworkConfig.toObject(message.networks[j], options); + } + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.managementUri != null && message.hasOwnProperty("managementUri")) + object.managementUri = $root.google.cloud.backupdr.v1.ManagementURI.toObject(message.managementUri, options); + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.ManagementServer.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.ManagementServer.InstanceType[message.type] : message.type; + if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) + object.oauth2ClientId = message.oauth2ClientId; + if (message.workforceIdentityBasedManagementUri != null && message.hasOwnProperty("workforceIdentityBasedManagementUri")) + object.workforceIdentityBasedManagementUri = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.toObject(message.workforceIdentityBasedManagementUri, options); + if (message.workforceIdentityBasedOauth2ClientId != null && message.hasOwnProperty("workforceIdentityBasedOauth2ClientId")) + object.workforceIdentityBasedOauth2ClientId = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.toObject(message.workforceIdentityBasedOauth2ClientId, options); + if (message.baProxyUri && message.baProxyUri.length) { + object.baProxyUri = []; + for (var j = 0; j < message.baProxyUri.length; ++j) + object.baProxyUri[j] = message.baProxyUri[j]; + } + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) + object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) + object.satisfiesPzi = message.satisfiesPzi; + return object; + }; + + /** + * Converts this ManagementServer to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ManagementServer + * @instance + * @returns {Object.} JSON object + */ + ManagementServer.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ManagementServer + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ManagementServer + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ManagementServer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ManagementServer"; + }; + + /** + * InstanceType enum. + * @name google.cloud.backupdr.v1.ManagementServer.InstanceType + * @enum {number} + * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value + * @property {number} BACKUP_RESTORE=1 BACKUP_RESTORE value + */ + ManagementServer.InstanceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_RESTORE"] = 1; + return values; + })(); + + /** + * InstanceState enum. + * @name google.cloud.backupdr.v1.ManagementServer.InstanceState + * @enum {number} + * @property {number} INSTANCE_STATE_UNSPECIFIED=0 INSTANCE_STATE_UNSPECIFIED value + * @property {number} CREATING=1 CREATING value + * @property {number} READY=2 READY value + * @property {number} UPDATING=3 UPDATING value + * @property {number} DELETING=4 DELETING value + * @property {number} REPAIRING=5 REPAIRING value + * @property {number} MAINTENANCE=6 MAINTENANCE value + * @property {number} ERROR=7 ERROR value + */ + ManagementServer.InstanceState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CREATING"] = 1; + values[valuesById[2] = "READY"] = 2; + values[valuesById[3] = "UPDATING"] = 3; + values[valuesById[4] = "DELETING"] = 4; + values[valuesById[5] = "REPAIRING"] = 5; + values[valuesById[6] = "MAINTENANCE"] = 6; + values[valuesById[7] = "ERROR"] = 7; + return values; + })(); + + return ManagementServer; + })(); + + v1.ListManagementServersRequest = (function() { + + /** + * Properties of a ListManagementServersRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListManagementServersRequest + * @property {string|null} [parent] ListManagementServersRequest parent + * @property {number|null} [pageSize] ListManagementServersRequest pageSize + * @property {string|null} [pageToken] ListManagementServersRequest pageToken + * @property {string|null} [filter] ListManagementServersRequest filter + * @property {string|null} [orderBy] ListManagementServersRequest orderBy + */ + + /** + * Constructs a new ListManagementServersRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListManagementServersRequest. + * @implements IListManagementServersRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListManagementServersRequest=} [properties] Properties to set + */ + function ListManagementServersRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListManagementServersRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @instance + */ + ListManagementServersRequest.prototype.parent = ""; + + /** + * ListManagementServersRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @instance + */ + ListManagementServersRequest.prototype.pageSize = 0; + + /** + * ListManagementServersRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @instance + */ + ListManagementServersRequest.prototype.pageToken = ""; + + /** + * ListManagementServersRequest filter. + * @member {string|null|undefined} filter + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @instance + */ + ListManagementServersRequest.prototype.filter = null; + + /** + * ListManagementServersRequest orderBy. + * @member {string|null|undefined} orderBy + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @instance + */ + ListManagementServersRequest.prototype.orderBy = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListManagementServersRequest.prototype, "_filter", { + get: $util.oneOfGetter($oneOfFields = ["filter"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ListManagementServersRequest.prototype, "_orderBy", { + get: $util.oneOfGetter($oneOfFields = ["orderBy"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ListManagementServersRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {google.cloud.backupdr.v1.IListManagementServersRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest instance + */ + ListManagementServersRequest.create = function create(properties) { + return new ListManagementServersRequest(properties); + }; + + /** + * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {google.cloud.backupdr.v1.IListManagementServersRequest} message ListManagementServersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagementServersRequest.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 ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {google.cloud.backupdr.v1.IListManagementServersRequest} message ListManagementServersRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagementServersRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListManagementServersRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagementServersRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListManagementServersRequest(); + 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 ListManagementServersRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagementServersRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListManagementServersRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListManagementServersRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.parent != null && message.hasOwnProperty("parent")) + if (!$util.isString(message.parent)) + return "parent: string expected"; + if (message.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")) { + properties._filter = 1; + if (!$util.isString(message.filter)) + return "filter: string expected"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + properties._orderBy = 1; + if (!$util.isString(message.orderBy)) + return "orderBy: string expected"; + } + return null; + }; + + /** + * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest + */ + ListManagementServersRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListManagementServersRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListManagementServersRequest(); + 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 ListManagementServersRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {google.cloud.backupdr.v1.ListManagementServersRequest} message ListManagementServersRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListManagementServersRequest.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; + if (message.filter != null && message.hasOwnProperty("filter")) { + object.filter = message.filter; + if (options.oneofs) + object._filter = "filter"; + } + if (message.orderBy != null && message.hasOwnProperty("orderBy")) { + object.orderBy = message.orderBy; + if (options.oneofs) + object._orderBy = "orderBy"; + } + return object; + }; + + /** + * Converts this ListManagementServersRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @instance + * @returns {Object.} JSON object + */ + ListManagementServersRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListManagementServersRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListManagementServersRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListManagementServersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListManagementServersRequest"; + }; + + return ListManagementServersRequest; + })(); + + v1.ListManagementServersResponse = (function() { + + /** + * Properties of a ListManagementServersResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListManagementServersResponse + * @property {Array.|null} [managementServers] ListManagementServersResponse managementServers + * @property {string|null} [nextPageToken] ListManagementServersResponse nextPageToken + * @property {Array.|null} [unreachable] ListManagementServersResponse unreachable + */ + + /** + * Constructs a new ListManagementServersResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListManagementServersResponse. + * @implements IListManagementServersResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListManagementServersResponse=} [properties] Properties to set + */ + function ListManagementServersResponse(properties) { + this.managementServers = []; + 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]]; + } + + /** + * ListManagementServersResponse managementServers. + * @member {Array.} managementServers + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @instance + */ + ListManagementServersResponse.prototype.managementServers = $util.emptyArray; + + /** + * ListManagementServersResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @instance + */ + ListManagementServersResponse.prototype.nextPageToken = ""; + + /** + * ListManagementServersResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @instance + */ + ListManagementServersResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListManagementServersResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {google.cloud.backupdr.v1.IListManagementServersResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse instance + */ + ListManagementServersResponse.create = function create(properties) { + return new ListManagementServersResponse(properties); + }; + + /** + * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {google.cloud.backupdr.v1.IListManagementServersResponse} message ListManagementServersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagementServersResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.managementServers != null && message.managementServers.length) + for (var i = 0; i < message.managementServers.length; ++i) + $root.google.cloud.backupdr.v1.ManagementServer.encode(message.managementServers[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 ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {google.cloud.backupdr.v1.IListManagementServersResponse} message ListManagementServersResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListManagementServersResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListManagementServersResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagementServersResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListManagementServersResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.managementServers && message.managementServers.length)) + message.managementServers = []; + message.managementServers.push($root.google.cloud.backupdr.v1.ManagementServer.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 ListManagementServersResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListManagementServersResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListManagementServersResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListManagementServersResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.managementServers != null && message.hasOwnProperty("managementServers")) { + if (!Array.isArray(message.managementServers)) + return "managementServers: array expected"; + for (var i = 0; i < message.managementServers.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ManagementServer.verify(message.managementServers[i]); + if (error) + return "managementServers." + 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 ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse + */ + ListManagementServersResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListManagementServersResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListManagementServersResponse(); + if (object.managementServers) { + if (!Array.isArray(object.managementServers)) + throw TypeError(".google.cloud.backupdr.v1.ListManagementServersResponse.managementServers: array expected"); + message.managementServers = []; + for (var i = 0; i < object.managementServers.length; ++i) { + if (typeof object.managementServers[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListManagementServersResponse.managementServers: object expected"); + message.managementServers[i] = $root.google.cloud.backupdr.v1.ManagementServer.fromObject(object.managementServers[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListManagementServersResponse.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 ListManagementServersResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {google.cloud.backupdr.v1.ListManagementServersResponse} message ListManagementServersResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListManagementServersResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.managementServers = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.managementServers && message.managementServers.length) { + object.managementServers = []; + for (var j = 0; j < message.managementServers.length; ++j) + object.managementServers[j] = $root.google.cloud.backupdr.v1.ManagementServer.toObject(message.managementServers[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 ListManagementServersResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @instance + * @returns {Object.} JSON object + */ + ListManagementServersResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListManagementServersResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListManagementServersResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListManagementServersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListManagementServersResponse"; + }; + + return ListManagementServersResponse; + })(); + + v1.GetManagementServerRequest = (function() { + + /** + * Properties of a GetManagementServerRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetManagementServerRequest + * @property {string|null} [name] GetManagementServerRequest name + */ + + /** + * Constructs a new GetManagementServerRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetManagementServerRequest. + * @implements IGetManagementServerRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetManagementServerRequest=} [properties] Properties to set + */ + function GetManagementServerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetManagementServerRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @instance + */ + GetManagementServerRequest.prototype.name = ""; + + /** + * Creates a new GetManagementServerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.IGetManagementServerRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest instance + */ + GetManagementServerRequest.create = function create(properties) { + return new GetManagementServerRequest(properties); + }; + + /** + * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} message GetManagementServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetManagementServerRequest.encode = function encode(message, writer) { + 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 GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} message GetManagementServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetManagementServerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetManagementServerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetManagementServerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetManagementServerRequest(); + 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 GetManagementServerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetManagementServerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetManagementServerRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetManagementServerRequest.verify = function verify(message) { + if (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 GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest + */ + GetManagementServerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetManagementServerRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetManagementServerRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.GetManagementServerRequest} message GetManagementServerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetManagementServerRequest.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 GetManagementServerRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @instance + * @returns {Object.} JSON object + */ + GetManagementServerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetManagementServerRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetManagementServerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetManagementServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetManagementServerRequest"; + }; + + return GetManagementServerRequest; + })(); + + v1.CreateManagementServerRequest = (function() { + + /** + * Properties of a CreateManagementServerRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateManagementServerRequest + * @property {string|null} [parent] CreateManagementServerRequest parent + * @property {string|null} [managementServerId] CreateManagementServerRequest managementServerId + * @property {google.cloud.backupdr.v1.IManagementServer|null} [managementServer] CreateManagementServerRequest managementServer + * @property {string|null} [requestId] CreateManagementServerRequest requestId + */ + + /** + * Constructs a new CreateManagementServerRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateManagementServerRequest. + * @implements ICreateManagementServerRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest=} [properties] Properties to set + */ + function CreateManagementServerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateManagementServerRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @instance + */ + CreateManagementServerRequest.prototype.parent = ""; + + /** + * CreateManagementServerRequest managementServerId. + * @member {string} managementServerId + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @instance + */ + CreateManagementServerRequest.prototype.managementServerId = ""; + + /** + * CreateManagementServerRequest managementServer. + * @member {google.cloud.backupdr.v1.IManagementServer|null|undefined} managementServer + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @instance + */ + CreateManagementServerRequest.prototype.managementServer = null; + + /** + * CreateManagementServerRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @instance + */ + CreateManagementServerRequest.prototype.requestId = ""; + + /** + * Creates a new CreateManagementServerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest instance + */ + CreateManagementServerRequest.create = function create(properties) { + return new CreateManagementServerRequest(properties); + }; + + /** + * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} message CreateManagementServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateManagementServerRequest.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.managementServerId != null && Object.hasOwnProperty.call(message, "managementServerId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.managementServerId); + if (message.managementServer != null && Object.hasOwnProperty.call(message, "managementServer")) + $root.google.cloud.backupdr.v1.ManagementServer.encode(message.managementServer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} message CreateManagementServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateManagementServerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateManagementServerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateManagementServerRequest(); + 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.managementServerId = reader.string(); + break; + } + case 3: { + message.managementServer = $root.google.cloud.backupdr.v1.ManagementServer.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateManagementServerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateManagementServerRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateManagementServerRequest.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.managementServerId != null && message.hasOwnProperty("managementServerId")) + if (!$util.isString(message.managementServerId)) + return "managementServerId: string expected"; + if (message.managementServer != null && message.hasOwnProperty("managementServer")) { + var error = $root.google.cloud.backupdr.v1.ManagementServer.verify(message.managementServer); + if (error) + return "managementServer." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest + */ + CreateManagementServerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateManagementServerRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateManagementServerRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.managementServerId != null) + message.managementServerId = String(object.managementServerId); + if (object.managementServer != null) { + if (typeof object.managementServer !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateManagementServerRequest.managementServer: object expected"); + message.managementServer = $root.google.cloud.backupdr.v1.ManagementServer.fromObject(object.managementServer); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.CreateManagementServerRequest} message CreateManagementServerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateManagementServerRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.managementServerId = ""; + object.managementServer = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.managementServerId != null && message.hasOwnProperty("managementServerId")) + object.managementServerId = message.managementServerId; + if (message.managementServer != null && message.hasOwnProperty("managementServer")) + object.managementServer = $root.google.cloud.backupdr.v1.ManagementServer.toObject(message.managementServer, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateManagementServerRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @instance + * @returns {Object.} JSON object + */ + CreateManagementServerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateManagementServerRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateManagementServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateManagementServerRequest"; + }; + + return CreateManagementServerRequest; + })(); + + v1.DeleteManagementServerRequest = (function() { + + /** + * Properties of a DeleteManagementServerRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteManagementServerRequest + * @property {string|null} [name] DeleteManagementServerRequest name + * @property {string|null} [requestId] DeleteManagementServerRequest requestId + */ + + /** + * Constructs a new DeleteManagementServerRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteManagementServerRequest. + * @implements IDeleteManagementServerRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest=} [properties] Properties to set + */ + function DeleteManagementServerRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteManagementServerRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @instance + */ + DeleteManagementServerRequest.prototype.name = ""; + + /** + * DeleteManagementServerRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @instance + */ + DeleteManagementServerRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteManagementServerRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest instance + */ + DeleteManagementServerRequest.create = function create(properties) { + return new DeleteManagementServerRequest(properties); + }; + + /** + * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} message DeleteManagementServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteManagementServerRequest.encode = function encode(message, writer) { + if (!writer) + 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 DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} message DeleteManagementServerRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteManagementServerRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteManagementServerRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteManagementServerRequest(); + 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 DeleteManagementServerRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteManagementServerRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteManagementServerRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteManagementServerRequest.verify = function verify(message) { + if (typeof message !== "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 DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest + */ + DeleteManagementServerRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteManagementServerRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteManagementServerRequest(); + 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 DeleteManagementServerRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteManagementServerRequest} message DeleteManagementServerRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteManagementServerRequest.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 DeleteManagementServerRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteManagementServerRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteManagementServerRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteManagementServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteManagementServerRequest"; + }; + + return DeleteManagementServerRequest; + })(); + + v1.InitializeServiceRequest = (function() { + + /** + * Properties of an InitializeServiceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IInitializeServiceRequest + * @property {string|null} [name] InitializeServiceRequest name + * @property {string|null} [resourceType] InitializeServiceRequest resourceType + * @property {string|null} [requestId] InitializeServiceRequest requestId + * @property {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null} [cloudSqlInstanceInitializationConfig] InitializeServiceRequest cloudSqlInstanceInitializationConfig + */ + + /** + * Constructs a new InitializeServiceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InitializeServiceRequest. + * @implements IInitializeServiceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest=} [properties] Properties to set + */ + function InitializeServiceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitializeServiceRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.name = ""; + + /** + * InitializeServiceRequest resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.resourceType = ""; + + /** + * InitializeServiceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.requestId = ""; + + /** + * InitializeServiceRequest cloudSqlInstanceInitializationConfig. + * @member {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null|undefined} cloudSqlInstanceInitializationConfig + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + InitializeServiceRequest.prototype.cloudSqlInstanceInitializationConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * InitializeServiceRequest initializationConfig. + * @member {"cloudSqlInstanceInitializationConfig"|undefined} initializationConfig + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + */ + Object.defineProperty(InitializeServiceRequest.prototype, "initializationConfig", { + get: $util.oneOfGetter($oneOfFields = ["cloudSqlInstanceInitializationConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InitializeServiceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest instance + */ + InitializeServiceRequest.create = function create(properties) { + return new InitializeServiceRequest(properties); + }; + + /** + * Encodes the specified InitializeServiceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} message InitializeServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + if (message.cloudSqlInstanceInitializationConfig != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceInitializationConfig")) + $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.encode(message.cloudSqlInstanceInitializationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified InitializeServiceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} message InitializeServiceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InitializeServiceRequest(); + 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.resourceType = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.cloudSqlInstanceInitializationConfig = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeServiceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeServiceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeServiceRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.cloudSqlInstanceInitializationConfig != null && message.hasOwnProperty("cloudSqlInstanceInitializationConfig")) { + properties.initializationConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify(message.cloudSqlInstanceInitializationConfig); + if (error) + return "cloudSqlInstanceInitializationConfig." + error; + } + } + return null; + }; + + /** + * Creates an InitializeServiceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest + */ + InitializeServiceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InitializeServiceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.InitializeServiceRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.cloudSqlInstanceInitializationConfig != null) { + if (typeof object.cloudSqlInstanceInitializationConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.InitializeServiceRequest.cloudSqlInstanceInitializationConfig: object expected"); + message.cloudSqlInstanceInitializationConfig = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.fromObject(object.cloudSqlInstanceInitializationConfig); + } + return message; + }; + + /** + * Creates a plain object from an InitializeServiceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {google.cloud.backupdr.v1.InitializeServiceRequest} message InitializeServiceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeServiceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.resourceType = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.cloudSqlInstanceInitializationConfig != null && message.hasOwnProperty("cloudSqlInstanceInitializationConfig")) { + object.cloudSqlInstanceInitializationConfig = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.toObject(message.cloudSqlInstanceInitializationConfig, options); + if (options.oneofs) + object.initializationConfig = "cloudSqlInstanceInitializationConfig"; + } + return object; + }; + + /** + * Converts this InitializeServiceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @instance + * @returns {Object.} JSON object + */ + InitializeServiceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeServiceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InitializeServiceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InitializeServiceRequest"; + }; + + return InitializeServiceRequest; + })(); + + v1.InitializeServiceResponse = (function() { + + /** + * Properties of an InitializeServiceResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IInitializeServiceResponse + * @property {string|null} [backupVaultName] InitializeServiceResponse backupVaultName + * @property {string|null} [backupPlanName] InitializeServiceResponse backupPlanName + */ + + /** + * Constructs a new InitializeServiceResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InitializeServiceResponse. + * @implements IInitializeServiceResponse + * @constructor + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse=} [properties] Properties to set + */ + function InitializeServiceResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitializeServiceResponse backupVaultName. + * @member {string} backupVaultName + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @instance + */ + InitializeServiceResponse.prototype.backupVaultName = ""; + + /** + * InitializeServiceResponse backupPlanName. + * @member {string} backupPlanName + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @instance + */ + InitializeServiceResponse.prototype.backupPlanName = ""; + + /** + * Creates a new InitializeServiceResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse instance + */ + InitializeServiceResponse.create = function create(properties) { + return new InitializeServiceResponse(properties); + }; + + /** + * Encodes the specified InitializeServiceResponse message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse} message InitializeServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaultName != null && Object.hasOwnProperty.call(message, "backupVaultName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupVaultName); + if (message.backupPlanName != null && Object.hasOwnProperty.call(message, "backupPlanName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanName); + return writer; + }; + + /** + * Encodes the specified InitializeServiceResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.IInitializeServiceResponse} message InitializeServiceResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InitializeServiceResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupVaultName = reader.string(); + break; + } + case 2: { + message.backupPlanName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeServiceResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeServiceResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeServiceResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeServiceResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaultName != null && message.hasOwnProperty("backupVaultName")) + if (!$util.isString(message.backupVaultName)) + return "backupVaultName: string expected"; + if (message.backupPlanName != null && message.hasOwnProperty("backupPlanName")) + if (!$util.isString(message.backupPlanName)) + return "backupPlanName: string expected"; + return null; + }; + + /** + * Creates an InitializeServiceResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse + */ + InitializeServiceResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InitializeServiceResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.InitializeServiceResponse(); + if (object.backupVaultName != null) + message.backupVaultName = String(object.backupVaultName); + if (object.backupPlanName != null) + message.backupPlanName = String(object.backupPlanName); + return message; + }; + + /** + * Creates a plain object from an InitializeServiceResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {google.cloud.backupdr.v1.InitializeServiceResponse} message InitializeServiceResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeServiceResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupVaultName = ""; + object.backupPlanName = ""; + } + if (message.backupVaultName != null && message.hasOwnProperty("backupVaultName")) + object.backupVaultName = message.backupVaultName; + if (message.backupPlanName != null && message.hasOwnProperty("backupPlanName")) + object.backupPlanName = message.backupPlanName; + return object; + }; + + /** + * Converts this InitializeServiceResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @instance + * @returns {Object.} JSON object + */ + InitializeServiceResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeServiceResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InitializeServiceResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InitializeServiceResponse"; + }; + + return InitializeServiceResponse; + })(); + + v1.OperationMetadata = (function() { + + /** + * Properties of an OperationMetadata. + * @memberof google.cloud.backupdr.v1 + * @interface IOperationMetadata + * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime + * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime + * @property {string|null} [target] OperationMetadata target + * @property {string|null} [verb] OperationMetadata verb + * @property {string|null} [statusMessage] OperationMetadata statusMessage + * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation + * @property {string|null} [apiVersion] OperationMetadata apiVersion + * @property {Object.|null} [additionalInfo] OperationMetadata additionalInfo + */ + + /** + * Constructs a new OperationMetadata. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an OperationMetadata. + * @implements IOperationMetadata + * @constructor + * @param {google.cloud.backupdr.v1.IOperationMetadata=} [properties] Properties to set + */ + function OperationMetadata(properties) { + this.additionalInfo = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * OperationMetadata createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.createTime = null; + + /** + * OperationMetadata endTime. + * @member {google.protobuf.ITimestamp|null|undefined} endTime + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.endTime = null; + + /** + * OperationMetadata target. + * @member {string} target + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.target = ""; + + /** + * OperationMetadata verb. + * @member {string} verb + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.verb = ""; + + /** + * OperationMetadata statusMessage. + * @member {string} statusMessage + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.statusMessage = ""; + + /** + * OperationMetadata requestedCancellation. + * @member {boolean} requestedCancellation + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.requestedCancellation = false; + + /** + * OperationMetadata apiVersion. + * @member {string} apiVersion + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.apiVersion = ""; + + /** + * OperationMetadata additionalInfo. + * @member {Object.} additionalInfo + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + */ + OperationMetadata.prototype.additionalInfo = $util.emptyObject; + + /** + * Creates a new OperationMetadata instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {google.cloud.backupdr.v1.IOperationMetadata=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata instance + */ + OperationMetadata.create = function create(properties) { + return new OperationMetadata(properties); + }; + + /** + * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {google.cloud.backupdr.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) + $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.target != null && Object.hasOwnProperty.call(message, "target")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); + if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); + if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); + if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); + if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); + if (message.additionalInfo != null && Object.hasOwnProperty.call(message, "additionalInfo")) + for (var keys = Object.keys(message.additionalInfo), 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.additionalInfo[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {google.cloud.backupdr.v1.IOperationMetadata} message OperationMetadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.OperationMetadata(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 2: { + message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.target = reader.string(); + break; + } + case 4: { + message.verb = reader.string(); + break; + } + case 5: { + message.statusMessage = reader.string(); + break; + } + case 6: { + message.requestedCancellation = reader.bool(); + break; + } + case 7: { + message.apiVersion = reader.string(); + break; + } + case 8: { + if (message.additionalInfo === $util.emptyObject) + message.additionalInfo = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.additionalInfo[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OperationMetadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OperationMetadata message. + * @function verify + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OperationMetadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.endTime != null && message.hasOwnProperty("endTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.endTime); + if (error) + return "endTime." + error; + } + if (message.target != null && message.hasOwnProperty("target")) + if (!$util.isString(message.target)) + return "target: string expected"; + if (message.verb != null && message.hasOwnProperty("verb")) + if (!$util.isString(message.verb)) + return "verb: string expected"; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + if (!$util.isString(message.statusMessage)) + return "statusMessage: string expected"; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + if (typeof message.requestedCancellation !== "boolean") + return "requestedCancellation: boolean expected"; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + if (!$util.isString(message.apiVersion)) + return "apiVersion: string expected"; + if (message.additionalInfo != null && message.hasOwnProperty("additionalInfo")) { + if (!$util.isObject(message.additionalInfo)) + return "additionalInfo: object expected"; + var key = Object.keys(message.additionalInfo); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.additionalInfo[key[i]])) + return "additionalInfo: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata + */ + OperationMetadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.OperationMetadata) + return object; + var message = new $root.google.cloud.backupdr.v1.OperationMetadata(); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.OperationMetadata.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + if (object.endTime != null) { + if (typeof object.endTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.OperationMetadata.endTime: object expected"); + message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); + } + if (object.target != null) + message.target = String(object.target); + if (object.verb != null) + message.verb = String(object.verb); + if (object.statusMessage != null) + message.statusMessage = String(object.statusMessage); + if (object.requestedCancellation != null) + message.requestedCancellation = Boolean(object.requestedCancellation); + if (object.apiVersion != null) + message.apiVersion = String(object.apiVersion); + if (object.additionalInfo) { + if (typeof object.additionalInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.OperationMetadata.additionalInfo: object expected"); + message.additionalInfo = {}; + for (var keys = Object.keys(object.additionalInfo), i = 0; i < keys.length; ++i) + message.additionalInfo[keys[i]] = String(object.additionalInfo[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {google.cloud.backupdr.v1.OperationMetadata} message OperationMetadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OperationMetadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.additionalInfo = {}; + if (options.defaults) { + object.createTime = null; + object.endTime = null; + object.target = ""; + object.verb = ""; + object.statusMessage = ""; + object.requestedCancellation = false; + object.apiVersion = ""; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.endTime != null && message.hasOwnProperty("endTime")) + object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); + if (message.target != null && message.hasOwnProperty("target")) + object.target = message.target; + if (message.verb != null && message.hasOwnProperty("verb")) + object.verb = message.verb; + if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) + object.statusMessage = message.statusMessage; + if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) + object.requestedCancellation = message.requestedCancellation; + if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) + object.apiVersion = message.apiVersion; + var keys2; + if (message.additionalInfo && (keys2 = Object.keys(message.additionalInfo)).length) { + object.additionalInfo = {}; + for (var j = 0; j < keys2.length; ++j) + object.additionalInfo[keys2[j]] = message.additionalInfo[keys2[j]]; + } + return object; + }; + + /** + * Converts this OperationMetadata to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @instance + * @returns {Object.} JSON object + */ + OperationMetadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for OperationMetadata + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.OperationMetadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.OperationMetadata"; + }; + + return OperationMetadata; + })(); + + v1.BackupPlan = (function() { + + /** + * Properties of a BackupPlan. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlan + * @property {string|null} [name] BackupPlan name + * @property {string|null} [description] BackupPlan description + * @property {Object.|null} [labels] BackupPlan labels + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlan createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlan updateTime + * @property {Array.|null} [backupRules] BackupPlan backupRules + * @property {google.cloud.backupdr.v1.BackupPlan.State|null} [state] BackupPlan state + * @property {string|null} [resourceType] BackupPlan resourceType + * @property {string|null} [etag] BackupPlan etag + * @property {string|null} [backupVault] BackupPlan backupVault + * @property {string|null} [backupVaultServiceAccount] BackupPlan backupVaultServiceAccount + * @property {number|Long|null} [logRetentionDays] BackupPlan logRetentionDays + * @property {Array.|null} [supportedResourceTypes] BackupPlan supportedResourceTypes + * @property {string|null} [revisionId] BackupPlan revisionId + * @property {string|null} [revisionName] BackupPlan revisionName + */ + + /** + * Constructs a new BackupPlan. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlan. + * @implements IBackupPlan + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set + */ + function BackupPlan(properties) { + this.labels = {}; + this.backupRules = []; + this.supportedResourceTypes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupPlan name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.name = ""; + + /** + * BackupPlan description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.description = ""; + + /** + * BackupPlan labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.labels = $util.emptyObject; + + /** + * BackupPlan createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.createTime = null; + + /** + * BackupPlan updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.updateTime = null; + + /** + * BackupPlan backupRules. + * @member {Array.} backupRules + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupRules = $util.emptyArray; + + /** + * BackupPlan state. + * @member {google.cloud.backupdr.v1.BackupPlan.State} state + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.state = 0; + + /** + * BackupPlan resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.resourceType = ""; + + /** + * BackupPlan etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.etag = ""; + + /** + * BackupPlan backupVault. + * @member {string} backupVault + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupVault = ""; + + /** + * BackupPlan backupVaultServiceAccount. + * @member {string} backupVaultServiceAccount + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.backupVaultServiceAccount = ""; + + /** + * BackupPlan logRetentionDays. + * @member {number|Long} logRetentionDays + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.logRetentionDays = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupPlan supportedResourceTypes. + * @member {Array.} supportedResourceTypes + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.supportedResourceTypes = $util.emptyArray; + + /** + * BackupPlan revisionId. + * @member {string} revisionId + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.revisionId = ""; + + /** + * BackupPlan revisionName. + * @member {string} revisionName + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + */ + BackupPlan.prototype.revisionName = ""; + + /** + * Creates a new BackupPlan instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan instance + */ + BackupPlan.create = function create(properties) { + return new BackupPlan(properties); + }; + + /** + * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlan.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + 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.backupRules != null && message.backupRules.length) + for (var i = 0; i < message.backupRules.length; ++i) + $root.google.cloud.backupdr.v1.BackupRule.encode(message.backupRules[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceType); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.backupVault); + if (message.backupVaultServiceAccount != null && Object.hasOwnProperty.call(message, "backupVaultServiceAccount")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.backupVaultServiceAccount); + if (message.logRetentionDays != null && Object.hasOwnProperty.call(message, "logRetentionDays")) + writer.uint32(/* id 12, wireType 0 =*/96).int64(message.logRetentionDays); + if (message.supportedResourceTypes != null && message.supportedResourceTypes.length) + for (var i = 0; i < message.supportedResourceTypes.length; ++i) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.supportedResourceTypes[i]); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.revisionId); + if (message.revisionName != null && Object.hasOwnProperty.call(message, "revisionName")) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.revisionName); + return writer; + }; + + /** + * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlan.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlan message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlan.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlan(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + 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.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.backupRules && message.backupRules.length)) + message.backupRules = []; + message.backupRules.push($root.google.cloud.backupdr.v1.BackupRule.decode(reader, reader.uint32())); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + message.resourceType = reader.string(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.backupVault = reader.string(); + break; + } + case 11: { + message.backupVaultServiceAccount = reader.string(); + break; + } + case 12: { + message.logRetentionDays = reader.int64(); + break; + } + case 13: { + if (!(message.supportedResourceTypes && message.supportedResourceTypes.length)) + message.supportedResourceTypes = []; + message.supportedResourceTypes.push(reader.string()); + break; + } + case 14: { + message.revisionId = reader.string(); + break; + } + case 15: { + message.revisionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlan message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlan.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlan message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlan.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.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.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.backupRules != null && message.hasOwnProperty("backupRules")) { + if (!Array.isArray(message.backupRules)) + return "backupRules: array expected"; + for (var i = 0; i < message.backupRules.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupRule.verify(message.backupRules[i]); + if (error) + return "backupRules." + 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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + if (!$util.isString(message.backupVault)) + return "backupVault: string expected"; + if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) + if (!$util.isString(message.backupVaultServiceAccount)) + return "backupVaultServiceAccount: string expected"; + if (message.logRetentionDays != null && message.hasOwnProperty("logRetentionDays")) + if (!$util.isInteger(message.logRetentionDays) && !(message.logRetentionDays && $util.isInteger(message.logRetentionDays.low) && $util.isInteger(message.logRetentionDays.high))) + return "logRetentionDays: integer|Long expected"; + if (message.supportedResourceTypes != null && message.hasOwnProperty("supportedResourceTypes")) { + if (!Array.isArray(message.supportedResourceTypes)) + return "supportedResourceTypes: array expected"; + for (var i = 0; i < message.supportedResourceTypes.length; ++i) + if (!$util.isString(message.supportedResourceTypes[i])) + return "supportedResourceTypes: string[] expected"; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.revisionName != null && message.hasOwnProperty("revisionName")) + if (!$util.isString(message.revisionName)) + return "revisionName: string expected"; + return null; + }; + + /** + * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan + */ + BackupPlan.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlan) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlan(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.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.backupdr.v1.BackupPlan.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupRules) { + if (!Array.isArray(object.backupRules)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: array expected"); + message.backupRules = []; + for (var i = 0; i < object.backupRules.length; ++i) { + if (typeof object.backupRules[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: object expected"); + message.backupRules[i] = $root.google.cloud.backupdr.v1.BackupRule.fromObject(object.backupRules[i]); + } + } + switch (object.state) { + default: + if (typeof object.state === "number") { + message.state = object.state; + break; + } + break; + case "STATE_UNSPECIFIED": + case 0: + message.state = 0; + break; + case "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + case "UPDATING": + case 5: + message.state = 5; + break; + } + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.etag != null) + message.etag = String(object.etag); + if (object.backupVault != null) + message.backupVault = String(object.backupVault); + if (object.backupVaultServiceAccount != null) + message.backupVaultServiceAccount = String(object.backupVaultServiceAccount); + if (object.logRetentionDays != null) + if ($util.Long) + (message.logRetentionDays = $util.Long.fromValue(object.logRetentionDays)).unsigned = false; + else if (typeof object.logRetentionDays === "string") + message.logRetentionDays = parseInt(object.logRetentionDays, 10); + else if (typeof object.logRetentionDays === "number") + message.logRetentionDays = object.logRetentionDays; + else if (typeof object.logRetentionDays === "object") + message.logRetentionDays = new $util.LongBits(object.logRetentionDays.low >>> 0, object.logRetentionDays.high >>> 0).toNumber(); + if (object.supportedResourceTypes) { + if (!Array.isArray(object.supportedResourceTypes)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlan.supportedResourceTypes: array expected"); + message.supportedResourceTypes = []; + for (var i = 0; i < object.supportedResourceTypes.length; ++i) + message.supportedResourceTypes[i] = String(object.supportedResourceTypes[i]); + } + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + if (object.revisionName != null) + message.revisionName = String(object.revisionName); + return message; + }; + + /** + * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {google.cloud.backupdr.v1.BackupPlan} message BackupPlan + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlan.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupRules = []; + object.supportedResourceTypes = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.resourceType = ""; + object.etag = ""; + object.backupVault = ""; + object.backupVaultServiceAccount = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.logRetentionDays = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.logRetentionDays = options.longs === String ? "0" : 0; + object.revisionId = ""; + object.revisionName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.backupRules && message.backupRules.length) { + object.backupRules = []; + for (var j = 0; j < message.backupRules.length; ++j) + object.backupRules[j] = $root.google.cloud.backupdr.v1.BackupRule.toObject(message.backupRules[j], options); + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] : message.state; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = message.backupVault; + if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) + object.backupVaultServiceAccount = message.backupVaultServiceAccount; + if (message.logRetentionDays != null && message.hasOwnProperty("logRetentionDays")) + if (typeof message.logRetentionDays === "number") + object.logRetentionDays = options.longs === String ? String(message.logRetentionDays) : message.logRetentionDays; + else + object.logRetentionDays = options.longs === String ? $util.Long.prototype.toString.call(message.logRetentionDays) : options.longs === Number ? new $util.LongBits(message.logRetentionDays.low >>> 0, message.logRetentionDays.high >>> 0).toNumber() : message.logRetentionDays; + if (message.supportedResourceTypes && message.supportedResourceTypes.length) { + object.supportedResourceTypes = []; + for (var j = 0; j < message.supportedResourceTypes.length; ++j) + object.supportedResourceTypes[j] = message.supportedResourceTypes[j]; + } + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.revisionName != null && message.hasOwnProperty("revisionName")) + object.revisionName = message.revisionName; + return object; + }; + + /** + * Converts this BackupPlan to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlan + * @instance + * @returns {Object.} JSON object + */ + BackupPlan.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlan + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlan + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlan"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlan.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} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + * @property {number} UPDATING=5 UPDATING value + */ + BackupPlan.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] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + values[valuesById[5] = "UPDATING"] = 5; + return values; + })(); + + return BackupPlan; + })(); + + v1.BackupRule = (function() { + + /** + * Properties of a BackupRule. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupRule + * @property {string|null} [ruleId] BackupRule ruleId + * @property {number|null} [backupRetentionDays] BackupRule backupRetentionDays + * @property {google.cloud.backupdr.v1.IStandardSchedule|null} [standardSchedule] BackupRule standardSchedule + */ + + /** + * Constructs a new BackupRule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupRule. + * @implements IBackupRule + * @constructor + * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set + */ + function BackupRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupRule ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.ruleId = ""; + + /** + * BackupRule backupRetentionDays. + * @member {number} backupRetentionDays + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.backupRetentionDays = 0; + + /** + * BackupRule standardSchedule. + * @member {google.cloud.backupdr.v1.IStandardSchedule|null|undefined} standardSchedule + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + BackupRule.prototype.standardSchedule = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupRule backupScheduleOneof. + * @member {"standardSchedule"|undefined} backupScheduleOneof + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + */ + Object.defineProperty(BackupRule.prototype, "backupScheduleOneof", { + get: $util.oneOfGetter($oneOfFields = ["standardSchedule"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupRule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule instance + */ + BackupRule.create = function create(properties) { + return new BackupRule(properties); + }; + + /** + * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.backupRetentionDays != null && Object.hasOwnProperty.call(message, "backupRetentionDays")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.backupRetentionDays); + if (message.standardSchedule != null && Object.hasOwnProperty.call(message, "standardSchedule")) + $root.google.cloud.backupdr.v1.StandardSchedule.encode(message.standardSchedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 4: { + message.backupRetentionDays = reader.int32(); + break; + } + case 5: { + message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupRule message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) + if (!$util.isInteger(message.backupRetentionDays)) + return "backupRetentionDays: integer expected"; + if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { + properties.backupScheduleOneof = 1; + { + var error = $root.google.cloud.backupdr.v1.StandardSchedule.verify(message.standardSchedule); + if (error) + return "standardSchedule." + error; + } + } + return null; + }; + + /** + * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule + */ + BackupRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupRule) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupRule(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.backupRetentionDays != null) + message.backupRetentionDays = object.backupRetentionDays | 0; + if (object.standardSchedule != null) { + if (typeof object.standardSchedule !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupRule.standardSchedule: object expected"); + message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.fromObject(object.standardSchedule); + } + return message; + }; + + /** + * Creates a plain object from a BackupRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {google.cloud.backupdr.v1.BackupRule} message BackupRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.backupRetentionDays = 0; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) + object.backupRetentionDays = message.backupRetentionDays; + if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { + object.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.toObject(message.standardSchedule, options); + if (options.oneofs) + object.backupScheduleOneof = "standardSchedule"; + } + return object; + }; + + /** + * Converts this BackupRule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupRule + * @instance + * @returns {Object.} JSON object + */ + BackupRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupRule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupRule"; + }; + + return BackupRule; + })(); + + v1.StandardSchedule = (function() { + + /** + * Properties of a StandardSchedule. + * @memberof google.cloud.backupdr.v1 + * @interface IStandardSchedule + * @property {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null} [recurrenceType] StandardSchedule recurrenceType + * @property {number|null} [hourlyFrequency] StandardSchedule hourlyFrequency + * @property {Array.|null} [daysOfWeek] StandardSchedule daysOfWeek + * @property {Array.|null} [daysOfMonth] StandardSchedule daysOfMonth + * @property {google.cloud.backupdr.v1.IWeekDayOfMonth|null} [weekDayOfMonth] StandardSchedule weekDayOfMonth + * @property {Array.|null} [months] StandardSchedule months + * @property {google.cloud.backupdr.v1.IBackupWindow|null} [backupWindow] StandardSchedule backupWindow + * @property {string|null} [timeZone] StandardSchedule timeZone + */ + + /** + * Constructs a new StandardSchedule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a StandardSchedule. + * @implements IStandardSchedule + * @constructor + * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set + */ + function StandardSchedule(properties) { + this.daysOfWeek = []; + this.daysOfMonth = []; + this.months = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * StandardSchedule recurrenceType. + * @member {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType} recurrenceType + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.recurrenceType = 0; + + /** + * StandardSchedule hourlyFrequency. + * @member {number} hourlyFrequency + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.hourlyFrequency = 0; + + /** + * StandardSchedule daysOfWeek. + * @member {Array.} daysOfWeek + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.daysOfWeek = $util.emptyArray; + + /** + * StandardSchedule daysOfMonth. + * @member {Array.} daysOfMonth + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.daysOfMonth = $util.emptyArray; + + /** + * StandardSchedule weekDayOfMonth. + * @member {google.cloud.backupdr.v1.IWeekDayOfMonth|null|undefined} weekDayOfMonth + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.weekDayOfMonth = null; + + /** + * StandardSchedule months. + * @member {Array.} months + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.months = $util.emptyArray; + + /** + * StandardSchedule backupWindow. + * @member {google.cloud.backupdr.v1.IBackupWindow|null|undefined} backupWindow + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.backupWindow = null; + + /** + * StandardSchedule timeZone. + * @member {string} timeZone + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + */ + StandardSchedule.prototype.timeZone = ""; + + /** + * Creates a new StandardSchedule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule instance + */ + StandardSchedule.create = function create(properties) { + return new StandardSchedule(properties); + }; + + /** + * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.recurrenceType != null && Object.hasOwnProperty.call(message, "recurrenceType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.recurrenceType); + if (message.hourlyFrequency != null && Object.hasOwnProperty.call(message, "hourlyFrequency")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.hourlyFrequency); + if (message.daysOfWeek != null && message.daysOfWeek.length) { + writer.uint32(/* id 3, wireType 2 =*/26).fork(); + for (var i = 0; i < message.daysOfWeek.length; ++i) + writer.int32(message.daysOfWeek[i]); + writer.ldelim(); + } + if (message.daysOfMonth != null && message.daysOfMonth.length) { + writer.uint32(/* id 4, wireType 2 =*/34).fork(); + for (var i = 0; i < message.daysOfMonth.length; ++i) + writer.int32(message.daysOfMonth[i]); + writer.ldelim(); + } + if (message.weekDayOfMonth != null && Object.hasOwnProperty.call(message, "weekDayOfMonth")) + $root.google.cloud.backupdr.v1.WeekDayOfMonth.encode(message.weekDayOfMonth, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.months != null && message.months.length) { + writer.uint32(/* id 6, wireType 2 =*/50).fork(); + for (var i = 0; i < message.months.length; ++i) + writer.int32(message.months[i]); + writer.ldelim(); + } + if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) + $root.google.cloud.backupdr.v1.BackupWindow.encode(message.backupWindow, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); + return writer; + }; + + /** + * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + StandardSchedule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.StandardSchedule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.recurrenceType = reader.int32(); + break; + } + case 2: { + message.hourlyFrequency = reader.int32(); + break; + } + case 3: { + if (!(message.daysOfWeek && message.daysOfWeek.length)) + message.daysOfWeek = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfWeek.push(reader.int32()); + } else + message.daysOfWeek.push(reader.int32()); + break; + } + case 4: { + if (!(message.daysOfMonth && message.daysOfMonth.length)) + message.daysOfMonth = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.daysOfMonth.push(reader.int32()); + } else + message.daysOfMonth.push(reader.int32()); + break; + } + case 5: { + message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.decode(reader, reader.uint32()); + break; + } + case 6: { + if (!(message.months && message.months.length)) + message.months = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.months.push(reader.int32()); + } else + message.months.push(reader.int32()); + break; + } + case 7: { + message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.decode(reader, reader.uint32()); + break; + } + case 8: { + message.timeZone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + StandardSchedule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a StandardSchedule message. + * @function verify + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + StandardSchedule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) + switch (message.recurrenceType) { + default: + return "recurrenceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) + if (!$util.isInteger(message.hourlyFrequency)) + return "hourlyFrequency: integer expected"; + if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { + if (!Array.isArray(message.daysOfWeek)) + return "daysOfWeek: array expected"; + for (var i = 0; i < message.daysOfWeek.length; ++i) + switch (message.daysOfWeek[i]) { + default: + return "daysOfWeek: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + } + if (message.daysOfMonth != null && message.hasOwnProperty("daysOfMonth")) { + if (!Array.isArray(message.daysOfMonth)) + return "daysOfMonth: array expected"; + for (var i = 0; i < message.daysOfMonth.length; ++i) + if (!$util.isInteger(message.daysOfMonth[i])) + return "daysOfMonth: integer[] expected"; + } + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) { + var error = $root.google.cloud.backupdr.v1.WeekDayOfMonth.verify(message.weekDayOfMonth); + if (error) + return "weekDayOfMonth." + error; + } + if (message.months != null && message.hasOwnProperty("months")) { + if (!Array.isArray(message.months)) + return "months: array expected"; + for (var i = 0; i < message.months.length; ++i) + switch (message.months[i]) { + default: + return "months: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + break; + } + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { + var error = $root.google.cloud.backupdr.v1.BackupWindow.verify(message.backupWindow); + if (error) + return "backupWindow." + error; + } + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + if (!$util.isString(message.timeZone)) + return "timeZone: string expected"; + return null; + }; + + /** + * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule + */ + StandardSchedule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.StandardSchedule) + return object; + var message = new $root.google.cloud.backupdr.v1.StandardSchedule(); + switch (object.recurrenceType) { + default: + if (typeof object.recurrenceType === "number") { + message.recurrenceType = object.recurrenceType; + break; + } + break; + case "RECURRENCE_TYPE_UNSPECIFIED": + case 0: + message.recurrenceType = 0; + break; + case "HOURLY": + case 1: + message.recurrenceType = 1; + break; + case "DAILY": + case 2: + message.recurrenceType = 2; + break; + case "WEEKLY": + case 3: + message.recurrenceType = 3; + break; + case "MONTHLY": + case 4: + message.recurrenceType = 4; + break; + case "YEARLY": + case 5: + message.recurrenceType = 5; + break; + } + if (object.hourlyFrequency != null) + message.hourlyFrequency = object.hourlyFrequency | 0; + if (object.daysOfWeek) { + if (!Array.isArray(object.daysOfWeek)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfWeek: array expected"); + message.daysOfWeek = []; + for (var i = 0; i < object.daysOfWeek.length; ++i) + switch (object.daysOfWeek[i]) { + default: + if (typeof object.daysOfWeek[i] === "number") { + message.daysOfWeek[i] = object.daysOfWeek[i]; + break; + } + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.daysOfWeek[i] = 0; + break; + case "MONDAY": + case 1: + message.daysOfWeek[i] = 1; + break; + case "TUESDAY": + case 2: + message.daysOfWeek[i] = 2; + break; + case "WEDNESDAY": + case 3: + message.daysOfWeek[i] = 3; + break; + case "THURSDAY": + case 4: + message.daysOfWeek[i] = 4; + break; + case "FRIDAY": + case 5: + message.daysOfWeek[i] = 5; + break; + case "SATURDAY": + case 6: + message.daysOfWeek[i] = 6; + break; + case "SUNDAY": + case 7: + message.daysOfWeek[i] = 7; + break; + } + } + if (object.daysOfMonth) { + if (!Array.isArray(object.daysOfMonth)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfMonth: array expected"); + message.daysOfMonth = []; + for (var i = 0; i < object.daysOfMonth.length; ++i) + message.daysOfMonth[i] = object.daysOfMonth[i] | 0; + } + if (object.weekDayOfMonth != null) { + if (typeof object.weekDayOfMonth !== "object") + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.weekDayOfMonth: object expected"); + message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.fromObject(object.weekDayOfMonth); + } + if (object.months) { + if (!Array.isArray(object.months)) + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.months: array expected"); + message.months = []; + for (var i = 0; i < object.months.length; ++i) + switch (object.months[i]) { + default: + if (typeof object.months[i] === "number") { + message.months[i] = object.months[i]; + break; + } + case "MONTH_UNSPECIFIED": + case 0: + message.months[i] = 0; + break; + case "JANUARY": + case 1: + message.months[i] = 1; + break; + case "FEBRUARY": + case 2: + message.months[i] = 2; + break; + case "MARCH": + case 3: + message.months[i] = 3; + break; + case "APRIL": + case 4: + message.months[i] = 4; + break; + case "MAY": + case 5: + message.months[i] = 5; + break; + case "JUNE": + case 6: + message.months[i] = 6; + break; + case "JULY": + case 7: + message.months[i] = 7; + break; + case "AUGUST": + case 8: + message.months[i] = 8; + break; + case "SEPTEMBER": + case 9: + message.months[i] = 9; + break; + case "OCTOBER": + case 10: + message.months[i] = 10; + break; + case "NOVEMBER": + case 11: + message.months[i] = 11; + break; + case "DECEMBER": + case 12: + message.months[i] = 12; + break; + } + } + if (object.backupWindow != null) { + if (typeof object.backupWindow !== "object") + throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.backupWindow: object expected"); + message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.fromObject(object.backupWindow); + } + if (object.timeZone != null) + message.timeZone = String(object.timeZone); + return message; + }; + + /** + * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {google.cloud.backupdr.v1.StandardSchedule} message StandardSchedule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + StandardSchedule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.daysOfWeek = []; + object.daysOfMonth = []; + object.months = []; + } + if (options.defaults) { + object.recurrenceType = options.enums === String ? "RECURRENCE_TYPE_UNSPECIFIED" : 0; + object.hourlyFrequency = 0; + object.weekDayOfMonth = null; + object.backupWindow = null; + object.timeZone = ""; + } + if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) + object.recurrenceType = options.enums === String ? $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] === undefined ? message.recurrenceType : $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] : message.recurrenceType; + if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) + object.hourlyFrequency = message.hourlyFrequency; + if (message.daysOfWeek && message.daysOfWeek.length) { + object.daysOfWeek = []; + for (var j = 0; j < message.daysOfWeek.length; ++j) + object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; + } + if (message.daysOfMonth && message.daysOfMonth.length) { + object.daysOfMonth = []; + for (var j = 0; j < message.daysOfMonth.length; ++j) + object.daysOfMonth[j] = message.daysOfMonth[j]; + } + if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) + object.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.toObject(message.weekDayOfMonth, options); + if (message.months && message.months.length) { + object.months = []; + for (var j = 0; j < message.months.length; ++j) + object.months[j] = options.enums === String ? $root.google.type.Month[message.months[j]] === undefined ? message.months[j] : $root.google.type.Month[message.months[j]] : message.months[j]; + } + if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) + object.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.toObject(message.backupWindow, options); + if (message.timeZone != null && message.hasOwnProperty("timeZone")) + object.timeZone = message.timeZone; + return object; + }; + + /** + * Converts this StandardSchedule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @instance + * @returns {Object.} JSON object + */ + StandardSchedule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for StandardSchedule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.StandardSchedule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + StandardSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.StandardSchedule"; + }; + + /** + * RecurrenceType enum. + * @name google.cloud.backupdr.v1.StandardSchedule.RecurrenceType + * @enum {number} + * @property {number} RECURRENCE_TYPE_UNSPECIFIED=0 RECURRENCE_TYPE_UNSPECIFIED value + * @property {number} HOURLY=1 HOURLY value + * @property {number} DAILY=2 DAILY value + * @property {number} WEEKLY=3 WEEKLY value + * @property {number} MONTHLY=4 MONTHLY value + * @property {number} YEARLY=5 YEARLY value + */ + StandardSchedule.RecurrenceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RECURRENCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "HOURLY"] = 1; + values[valuesById[2] = "DAILY"] = 2; + values[valuesById[3] = "WEEKLY"] = 3; + values[valuesById[4] = "MONTHLY"] = 4; + values[valuesById[5] = "YEARLY"] = 5; + return values; + })(); + + return StandardSchedule; + })(); + + v1.BackupWindow = (function() { + + /** + * Properties of a BackupWindow. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupWindow + * @property {number|null} [startHourOfDay] BackupWindow startHourOfDay + * @property {number|null} [endHourOfDay] BackupWindow endHourOfDay + */ + + /** + * Constructs a new BackupWindow. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupWindow. + * @implements IBackupWindow + * @constructor + * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set + */ + function BackupWindow(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupWindow startHourOfDay. + * @member {number} startHourOfDay + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + */ + BackupWindow.prototype.startHourOfDay = 0; + + /** + * BackupWindow endHourOfDay. + * @member {number} endHourOfDay + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + */ + BackupWindow.prototype.endHourOfDay = 0; + + /** + * Creates a new BackupWindow instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow instance + */ + BackupWindow.create = function create(properties) { + return new BackupWindow(properties); + }; + + /** + * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupWindow.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.startHourOfDay != null && Object.hasOwnProperty.call(message, "startHourOfDay")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startHourOfDay); + if (message.endHourOfDay != null && Object.hasOwnProperty.call(message, "endHourOfDay")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endHourOfDay); + return writer; + }; + + /** + * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupWindow.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupWindow message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupWindow.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupWindow(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.startHourOfDay = reader.int32(); + break; + } + case 2: { + message.endHourOfDay = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupWindow message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupWindow.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupWindow message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupWindow.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) + if (!$util.isInteger(message.startHourOfDay)) + return "startHourOfDay: integer expected"; + if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) + if (!$util.isInteger(message.endHourOfDay)) + return "endHourOfDay: integer expected"; + return null; + }; + + /** + * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow + */ + BackupWindow.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupWindow) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupWindow(); + if (object.startHourOfDay != null) + message.startHourOfDay = object.startHourOfDay | 0; + if (object.endHourOfDay != null) + message.endHourOfDay = object.endHourOfDay | 0; + return message; + }; + + /** + * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {google.cloud.backupdr.v1.BackupWindow} message BackupWindow + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupWindow.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.startHourOfDay = 0; + object.endHourOfDay = 0; + } + if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) + object.startHourOfDay = message.startHourOfDay; + if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) + object.endHourOfDay = message.endHourOfDay; + return object; + }; + + /** + * Converts this BackupWindow to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupWindow + * @instance + * @returns {Object.} JSON object + */ + BackupWindow.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupWindow + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupWindow + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupWindow"; + }; + + return BackupWindow; + })(); + + v1.WeekDayOfMonth = (function() { + + /** + * Properties of a WeekDayOfMonth. + * @memberof google.cloud.backupdr.v1 + * @interface IWeekDayOfMonth + * @property {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null} [weekOfMonth] WeekDayOfMonth weekOfMonth + * @property {google.type.DayOfWeek|null} [dayOfWeek] WeekDayOfMonth dayOfWeek + */ + + /** + * Constructs a new WeekDayOfMonth. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a WeekDayOfMonth. + * @implements IWeekDayOfMonth + * @constructor + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set + */ + function WeekDayOfMonth(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * WeekDayOfMonth weekOfMonth. + * @member {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth} weekOfMonth + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.weekOfMonth = 0; + + /** + * WeekDayOfMonth dayOfWeek. + * @member {google.type.DayOfWeek} dayOfWeek + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + */ + WeekDayOfMonth.prototype.dayOfWeek = 0; + + /** + * Creates a new WeekDayOfMonth instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth instance + */ + WeekDayOfMonth.create = function create(properties) { + return new WeekDayOfMonth(properties); + }; + + /** + * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.weekOfMonth != null && Object.hasOwnProperty.call(message, "weekOfMonth")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.weekOfMonth); + if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dayOfWeek); + return writer; + }; + + /** + * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + WeekDayOfMonth.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.weekOfMonth = reader.int32(); + break; + } + case 2: { + message.dayOfWeek = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + WeekDayOfMonth.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a WeekDayOfMonth message. + * @function verify + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + WeekDayOfMonth.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) + switch (message.weekOfMonth) { + default: + return "weekOfMonth: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + switch (message.dayOfWeek) { + default: + return "dayOfWeek: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + break; + } + return null; + }; + + /** + * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth + */ + WeekDayOfMonth.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.WeekDayOfMonth) + return object; + var message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); + switch (object.weekOfMonth) { + default: + if (typeof object.weekOfMonth === "number") { + message.weekOfMonth = object.weekOfMonth; + break; + } + break; + case "WEEK_OF_MONTH_UNSPECIFIED": + case 0: + message.weekOfMonth = 0; + break; + case "FIRST": + case 1: + message.weekOfMonth = 1; + break; + case "SECOND": + case 2: + message.weekOfMonth = 2; + break; + case "THIRD": + case 3: + message.weekOfMonth = 3; + break; + case "FOURTH": + case 4: + message.weekOfMonth = 4; + break; + case "LAST": + case 5: + message.weekOfMonth = 5; + break; + } + switch (object.dayOfWeek) { + default: + if (typeof object.dayOfWeek === "number") { + message.dayOfWeek = object.dayOfWeek; + break; + } + break; + case "DAY_OF_WEEK_UNSPECIFIED": + case 0: + message.dayOfWeek = 0; + break; + case "MONDAY": + case 1: + message.dayOfWeek = 1; + break; + case "TUESDAY": + case 2: + message.dayOfWeek = 2; + break; + case "WEDNESDAY": + case 3: + message.dayOfWeek = 3; + break; + case "THURSDAY": + case 4: + message.dayOfWeek = 4; + break; + case "FRIDAY": + case 5: + message.dayOfWeek = 5; + break; + case "SATURDAY": + case 6: + message.dayOfWeek = 6; + break; + case "SUNDAY": + case 7: + message.dayOfWeek = 7; + break; + } + return message; + }; + + /** + * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {google.cloud.backupdr.v1.WeekDayOfMonth} message WeekDayOfMonth + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + WeekDayOfMonth.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.weekOfMonth = options.enums === String ? "WEEK_OF_MONTH_UNSPECIFIED" : 0; + object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; + } + if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) + object.weekOfMonth = options.enums === String ? $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] === undefined ? message.weekOfMonth : $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] : message.weekOfMonth; + if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) + object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] === undefined ? message.dayOfWeek : $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; + return object; + }; + + /** + * Converts this WeekDayOfMonth to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @instance + * @returns {Object.} JSON object + */ + WeekDayOfMonth.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for WeekDayOfMonth + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.WeekDayOfMonth + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + WeekDayOfMonth.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.WeekDayOfMonth"; + }; + + /** + * WeekOfMonth enum. + * @name google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth + * @enum {number} + * @property {number} WEEK_OF_MONTH_UNSPECIFIED=0 WEEK_OF_MONTH_UNSPECIFIED value + * @property {number} FIRST=1 FIRST value + * @property {number} SECOND=2 SECOND value + * @property {number} THIRD=3 THIRD value + * @property {number} FOURTH=4 FOURTH value + * @property {number} LAST=5 LAST value + */ + WeekDayOfMonth.WeekOfMonth = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "WEEK_OF_MONTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST"] = 1; + values[valuesById[2] = "SECOND"] = 2; + values[valuesById[3] = "THIRD"] = 3; + values[valuesById[4] = "FOURTH"] = 4; + values[valuesById[5] = "LAST"] = 5; + return values; + })(); + + return WeekDayOfMonth; + })(); + + v1.CreateBackupPlanRequest = (function() { + + /** + * Properties of a CreateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupPlanRequest + * @property {string|null} [parent] CreateBackupPlanRequest parent + * @property {string|null} [backupPlanId] CreateBackupPlanRequest backupPlanId + * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlan] CreateBackupPlanRequest backupPlan + * @property {string|null} [requestId] CreateBackupPlanRequest requestId + */ + + /** + * Constructs a new CreateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupPlanRequest. + * @implements ICreateBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set + */ + function CreateBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupPlanRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.parent = ""; + + /** + * CreateBackupPlanRequest backupPlanId. + * @member {string} backupPlanId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlanId = ""; + + /** + * CreateBackupPlanRequest backupPlan. + * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlan + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.backupPlan = null; + + /** + * CreateBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + */ + CreateBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest instance + */ + CreateBackupPlanRequest.create = function create(properties) { + return new CreateBackupPlanRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanRequest.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.backupPlanId != null && Object.hasOwnProperty.call(message, "backupPlanId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanId); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); + 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.backupPlanId = reader.string(); + break; + } + case 3: { + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupPlanRequest.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.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + if (!$util.isString(message.backupPlanId)) + return "backupPlanId: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlan); + if (error) + return "backupPlan." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest + */ + CreateBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlanId != null) + message.backupPlanId = String(object.backupPlanId); + if (object.backupPlan != null) { + if (typeof object.backupPlan !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanRequest.backupPlan: object expected"); + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlan); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupPlanRequest} message CreateBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupPlanId = ""; + object.backupPlan = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) + object.backupPlanId = message.backupPlanId; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlan, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanRequest"; + }; + + return CreateBackupPlanRequest; + })(); + + v1.ListBackupPlansRequest = (function() { + + /** + * Properties of a ListBackupPlansRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlansRequest + * @property {string|null} [parent] ListBackupPlansRequest parent + * @property {number|null} [pageSize] ListBackupPlansRequest pageSize + * @property {string|null} [pageToken] ListBackupPlansRequest pageToken + * @property {string|null} [filter] ListBackupPlansRequest filter + * @property {string|null} [orderBy] ListBackupPlansRequest orderBy + */ + + /** + * Constructs a new ListBackupPlansRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlansRequest. + * @implements IListBackupPlansRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set + */ + function ListBackupPlansRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlansRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.parent = ""; + + /** + * ListBackupPlansRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageSize = 0; + + /** + * ListBackupPlansRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.pageToken = ""; + + /** + * ListBackupPlansRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.filter = ""; + + /** + * ListBackupPlansRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + */ + ListBackupPlansRequest.prototype.orderBy = ""; + + /** + * Creates a new ListBackupPlansRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest instance + */ + ListBackupPlansRequest.create = function create(properties) { + return new ListBackupPlansRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansRequest.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 ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlansRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); + 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 ListBackupPlansRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlansRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlansRequest.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 ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest + */ + ListBackupPlansRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); + 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 ListBackupPlansRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlansRequest} message ListBackupPlansRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlansRequest.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 ListBackupPlansRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlansRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlansRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlansRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansRequest"; + }; + + return ListBackupPlansRequest; + })(); + + v1.ListBackupPlansResponse = (function() { + + /** + * Properties of a ListBackupPlansResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlansResponse + * @property {Array.|null} [backupPlans] ListBackupPlansResponse backupPlans + * @property {string|null} [nextPageToken] ListBackupPlansResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlansResponse unreachable + */ + + /** + * Constructs a new ListBackupPlansResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlansResponse. + * @implements IListBackupPlansResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set + */ + function ListBackupPlansResponse(properties) { + this.backupPlans = []; + 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]]; + } + + /** + * ListBackupPlansResponse backupPlans. + * @member {Array.} backupPlans + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.backupPlans = $util.emptyArray; + + /** + * ListBackupPlansResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlansResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + */ + ListBackupPlansResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlansResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse instance + */ + ListBackupPlansResponse.create = function create(properties) { + return new ListBackupPlansResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlans != null && message.backupPlans.length) + for (var i = 0; i < message.backupPlans.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlans[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 ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlansResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlansResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlans && message.backupPlans.length)) + message.backupPlans = []; + message.backupPlans.push($root.google.cloud.backupdr.v1.BackupPlan.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 ListBackupPlansResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlansResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlansResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlansResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlans != null && message.hasOwnProperty("backupPlans")) { + if (!Array.isArray(message.backupPlans)) + return "backupPlans: array expected"; + for (var i = 0; i < message.backupPlans.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlans[i]); + if (error) + return "backupPlans." + 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 ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse + */ + ListBackupPlansResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); + if (object.backupPlans) { + if (!Array.isArray(object.backupPlans)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: array expected"); + message.backupPlans = []; + for (var i = 0; i < object.backupPlans.length; ++i) { + if (typeof object.backupPlans[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: object expected"); + message.backupPlans[i] = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlans[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.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 ListBackupPlansResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} message ListBackupPlansResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlansResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlans = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlans && message.backupPlans.length) { + object.backupPlans = []; + for (var j = 0; j < message.backupPlans.length; ++j) + object.backupPlans[j] = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlans[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 ListBackupPlansResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlansResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlansResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlansResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansResponse"; + }; + + return ListBackupPlansResponse; + })(); + + v1.GetBackupPlanRequest = (function() { + + /** + * Properties of a GetBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanRequest + * @property {string|null} [name] GetBackupPlanRequest name + */ + + /** + * Constructs a new GetBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanRequest. + * @implements IGetBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set + */ + function GetBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupPlanRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @instance + */ + GetBackupPlanRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest instance + */ + GetBackupPlanRequest.create = function create(properties) { + return new GetBackupPlanRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRequest.encode = function encode(message, writer) { + 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 GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); + 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 GetBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanRequest.verify = function verify(message) { + if (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 GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest + */ + GetBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanRequest} message GetBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanRequest.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 GetBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanRequest"; + }; + + return GetBackupPlanRequest; + })(); + + v1.DeleteBackupPlanRequest = (function() { + + /** + * Properties of a DeleteBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupPlanRequest + * @property {string|null} [name] DeleteBackupPlanRequest name + * @property {string|null} [requestId] DeleteBackupPlanRequest requestId + */ + + /** + * Constructs a new DeleteBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupPlanRequest. + * @implements IDeleteBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + */ + function DeleteBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupPlanRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.name = ""; + + /** + * DeleteBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + */ + DeleteBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest instance + */ + DeleteBackupPlanRequest.create = function create(properties) { + return new DeleteBackupPlanRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanRequest.encode = function encode(message, writer) { + if (!writer) + 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 DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); + 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 DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupPlanRequest.verify = function verify(message) { + if (typeof message !== "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 DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest + */ + DeleteBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); + 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 DeleteBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupPlanRequest} message DeleteBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupPlanRequest.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 DeleteBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanRequest"; + }; + + return DeleteBackupPlanRequest; + })(); + + v1.UpdateBackupPlanRequest = (function() { + + /** + * Properties of an UpdateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupPlanRequest + * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlan] UpdateBackupPlanRequest backupPlan + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupPlanRequest updateMask + * @property {string|null} [requestId] UpdateBackupPlanRequest requestId + */ + + /** + * Constructs a new UpdateBackupPlanRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupPlanRequest. + * @implements IUpdateBackupPlanRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest=} [properties] Properties to set + */ + function UpdateBackupPlanRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupPlanRequest backupPlan. + * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlan + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @instance + */ + UpdateBackupPlanRequest.prototype.backupPlan = null; + + /** + * UpdateBackupPlanRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @instance + */ + UpdateBackupPlanRequest.prototype.updateMask = null; + + /** + * UpdateBackupPlanRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @instance + */ + UpdateBackupPlanRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateBackupPlanRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest instance + */ + UpdateBackupPlanRequest.create = function create(properties) { + return new UpdateBackupPlanRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} message UpdateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupPlanRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} message UpdateBackupPlanRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupPlanRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupPlanRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupPlanRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlan); + if (error) + return "backupPlan." + 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 UpdateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest + */ + UpdateBackupPlanRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest(); + if (object.backupPlan != null) { + if (typeof object.backupPlan !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanRequest.backupPlan: object expected"); + message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlan); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanRequest.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 UpdateBackupPlanRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupPlanRequest} message UpdateBackupPlanRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupPlanRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupPlan = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlan, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateBackupPlanRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupPlanRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupPlanRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupPlanRequest"; + }; + + return UpdateBackupPlanRequest; + })(); + + v1.BackupPlanRevision = (function() { + + /** + * Properties of a BackupPlanRevision. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlanRevision + * @property {string|null} [name] BackupPlanRevision name + * @property {string|null} [revisionId] BackupPlanRevision revisionId + * @property {google.cloud.backupdr.v1.BackupPlanRevision.State|null} [state] BackupPlanRevision state + * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlanSnapshot] BackupPlanRevision backupPlanSnapshot + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlanRevision createTime + */ + + /** + * Constructs a new BackupPlanRevision. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlanRevision. + * @implements IBackupPlanRevision + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlanRevision=} [properties] Properties to set + */ + function BackupPlanRevision(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupPlanRevision name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @instance + */ + BackupPlanRevision.prototype.name = ""; + + /** + * BackupPlanRevision revisionId. + * @member {string} revisionId + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @instance + */ + BackupPlanRevision.prototype.revisionId = ""; + + /** + * BackupPlanRevision state. + * @member {google.cloud.backupdr.v1.BackupPlanRevision.State} state + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @instance + */ + BackupPlanRevision.prototype.state = 0; + + /** + * BackupPlanRevision backupPlanSnapshot. + * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlanSnapshot + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @instance + */ + BackupPlanRevision.prototype.backupPlanSnapshot = null; + + /** + * BackupPlanRevision createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @instance + */ + BackupPlanRevision.prototype.createTime = null; + + /** + * Creates a new BackupPlanRevision instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanRevision=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision instance + */ + BackupPlanRevision.create = function create(properties) { + return new BackupPlanRevision(properties); + }; + + /** + * Encodes the specified BackupPlanRevision message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanRevision} message BackupPlanRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanRevision.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); + if (message.backupPlanSnapshot != null && Object.hasOwnProperty.call(message, "backupPlanSnapshot")) + $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlanSnapshot, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupPlanRevision message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanRevision} message BackupPlanRevision message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanRevision.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlanRevision message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanRevision.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlanRevision(); + 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.revisionId = reader.string(); + break; + } + case 3: { + message.state = reader.int32(); + break; + } + case 4: { + message.backupPlanSnapshot = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlanRevision message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanRevision.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlanRevision message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlanRevision.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + if (!$util.isString(message.revisionId)) + return "revisionId: string expected"; + if (message.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.backupPlanSnapshot != null && message.hasOwnProperty("backupPlanSnapshot")) { + var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlanSnapshot); + if (error) + return "backupPlanSnapshot." + error; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + return null; + }; + + /** + * Creates a BackupPlanRevision message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision + */ + BackupPlanRevision.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlanRevision) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlanRevision(); + if (object.name != null) + message.name = String(object.name); + if (object.revisionId != null) + message.revisionId = String(object.revisionId); + 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 "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + } + if (object.backupPlanSnapshot != null) { + if (typeof object.backupPlanSnapshot !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanRevision.backupPlanSnapshot: object expected"); + message.backupPlanSnapshot = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlanSnapshot); + } + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanRevision.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupPlanRevision message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {google.cloud.backupdr.v1.BackupPlanRevision} message BackupPlanRevision + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlanRevision.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.revisionId = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.backupPlanSnapshot = null; + object.createTime = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.revisionId != null && message.hasOwnProperty("revisionId")) + object.revisionId = message.revisionId; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlanRevision.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlanRevision.State[message.state] : message.state; + if (message.backupPlanSnapshot != null && message.hasOwnProperty("backupPlanSnapshot")) + object.backupPlanSnapshot = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlanSnapshot, options); + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + return object; + }; + + /** + * Converts this BackupPlanRevision to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @instance + * @returns {Object.} JSON object + */ + BackupPlanRevision.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlanRevision + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlanRevision + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlanRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlanRevision"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlanRevision.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} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + */ + BackupPlanRevision.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] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + return values; + })(); + + return BackupPlanRevision; + })(); + + v1.GetBackupPlanRevisionRequest = (function() { + + /** + * Properties of a GetBackupPlanRevisionRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanRevisionRequest + * @property {string|null} [name] GetBackupPlanRevisionRequest name + */ + + /** + * Constructs a new GetBackupPlanRevisionRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanRevisionRequest. + * @implements IGetBackupPlanRevisionRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest=} [properties] Properties to set + */ + function GetBackupPlanRevisionRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupPlanRevisionRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @instance + */ + GetBackupPlanRevisionRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanRevisionRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest instance + */ + GetBackupPlanRevisionRequest.create = function create(properties) { + return new GetBackupPlanRevisionRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanRevisionRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} message GetBackupPlanRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRevisionRequest.encode = function encode(message, writer) { + 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 GetBackupPlanRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} message GetBackupPlanRevisionRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanRevisionRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRevisionRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest(); + 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 GetBackupPlanRevisionRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanRevisionRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanRevisionRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanRevisionRequest.verify = function verify(message) { + if (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 GetBackupPlanRevisionRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest + */ + GetBackupPlanRevisionRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanRevisionRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} message GetBackupPlanRevisionRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanRevisionRequest.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 GetBackupPlanRevisionRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanRevisionRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanRevisionRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanRevisionRequest"; + }; + + return GetBackupPlanRevisionRequest; + })(); + + v1.ListBackupPlanRevisionsRequest = (function() { + + /** + * Properties of a ListBackupPlanRevisionsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanRevisionsRequest + * @property {string|null} [parent] ListBackupPlanRevisionsRequest parent + * @property {number|null} [pageSize] ListBackupPlanRevisionsRequest pageSize + * @property {string|null} [pageToken] ListBackupPlanRevisionsRequest pageToken + */ + + /** + * Constructs a new ListBackupPlanRevisionsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanRevisionsRequest. + * @implements IListBackupPlanRevisionsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest=} [properties] Properties to set + */ + function ListBackupPlanRevisionsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlanRevisionsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @instance + */ + ListBackupPlanRevisionsRequest.prototype.parent = ""; + + /** + * ListBackupPlanRevisionsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @instance + */ + ListBackupPlanRevisionsRequest.prototype.pageSize = 0; + + /** + * ListBackupPlanRevisionsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @instance + */ + ListBackupPlanRevisionsRequest.prototype.pageToken = ""; + + /** + * Creates a new ListBackupPlanRevisionsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest instance + */ + ListBackupPlanRevisionsRequest.create = function create(properties) { + return new ListBackupPlanRevisionsRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlanRevisionsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} message ListBackupPlanRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanRevisionsRequest.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 ListBackupPlanRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} message ListBackupPlanRevisionsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanRevisionsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanRevisionsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest(); + 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 ListBackupPlanRevisionsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanRevisionsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanRevisionsRequest.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 ListBackupPlanRevisionsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest + */ + ListBackupPlanRevisionsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest(); + 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 ListBackupPlanRevisionsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} message ListBackupPlanRevisionsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanRevisionsRequest.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 ListBackupPlanRevisionsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanRevisionsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanRevisionsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest"; + }; + + return ListBackupPlanRevisionsRequest; + })(); + + v1.ListBackupPlanRevisionsResponse = (function() { + + /** + * Properties of a ListBackupPlanRevisionsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanRevisionsResponse + * @property {Array.|null} [backupPlanRevisions] ListBackupPlanRevisionsResponse backupPlanRevisions + * @property {string|null} [nextPageToken] ListBackupPlanRevisionsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlanRevisionsResponse unreachable + */ + + /** + * Constructs a new ListBackupPlanRevisionsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanRevisionsResponse. + * @implements IListBackupPlanRevisionsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse=} [properties] Properties to set + */ + function ListBackupPlanRevisionsResponse(properties) { + this.backupPlanRevisions = []; + 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]]; + } + + /** + * ListBackupPlanRevisionsResponse backupPlanRevisions. + * @member {Array.} backupPlanRevisions + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @instance + */ + ListBackupPlanRevisionsResponse.prototype.backupPlanRevisions = $util.emptyArray; + + /** + * ListBackupPlanRevisionsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @instance + */ + ListBackupPlanRevisionsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlanRevisionsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @instance + */ + ListBackupPlanRevisionsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlanRevisionsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse instance + */ + ListBackupPlanRevisionsResponse.create = function create(properties) { + return new ListBackupPlanRevisionsResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlanRevisionsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse} message ListBackupPlanRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanRevisionsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlanRevisions != null && message.backupPlanRevisions.length) + for (var i = 0; i < message.backupPlanRevisions.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlanRevision.encode(message.backupPlanRevisions[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 ListBackupPlanRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse} message ListBackupPlanRevisionsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanRevisionsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanRevisionsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlanRevisions && message.backupPlanRevisions.length)) + message.backupPlanRevisions = []; + message.backupPlanRevisions.push($root.google.cloud.backupdr.v1.BackupPlanRevision.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 ListBackupPlanRevisionsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanRevisionsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanRevisionsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlanRevisions != null && message.hasOwnProperty("backupPlanRevisions")) { + if (!Array.isArray(message.backupPlanRevisions)) + return "backupPlanRevisions: array expected"; + for (var i = 0; i < message.backupPlanRevisions.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlanRevision.verify(message.backupPlanRevisions[i]); + if (error) + return "backupPlanRevisions." + 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 ListBackupPlanRevisionsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse + */ + ListBackupPlanRevisionsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse(); + if (object.backupPlanRevisions) { + if (!Array.isArray(object.backupPlanRevisions)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.backupPlanRevisions: array expected"); + message.backupPlanRevisions = []; + for (var i = 0; i < object.backupPlanRevisions.length; ++i) { + if (typeof object.backupPlanRevisions[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.backupPlanRevisions: object expected"); + message.backupPlanRevisions[i] = $root.google.cloud.backupdr.v1.BackupPlanRevision.fromObject(object.backupPlanRevisions[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.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 ListBackupPlanRevisionsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} message ListBackupPlanRevisionsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanRevisionsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlanRevisions = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlanRevisions && message.backupPlanRevisions.length) { + object.backupPlanRevisions = []; + for (var j = 0; j < message.backupPlanRevisions.length; ++j) + object.backupPlanRevisions[j] = $root.google.cloud.backupdr.v1.BackupPlanRevision.toObject(message.backupPlanRevisions[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 ListBackupPlanRevisionsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanRevisionsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanRevisionsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse"; + }; + + return ListBackupPlanRevisionsResponse; + })(); + + v1.BackupPlanAssociation = (function() { + + /** + * Properties of a BackupPlanAssociation. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupPlanAssociation + * @property {string|null} [name] BackupPlanAssociation name + * @property {string|null} [resourceType] BackupPlanAssociation resourceType + * @property {string|null} [resource] BackupPlanAssociation resource + * @property {string|null} [backupPlan] BackupPlanAssociation backupPlan + * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlanAssociation createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlanAssociation updateTime + * @property {google.cloud.backupdr.v1.BackupPlanAssociation.State|null} [state] BackupPlanAssociation state + * @property {Array.|null} [rulesConfigInfo] BackupPlanAssociation rulesConfigInfo + * @property {string|null} [dataSource] BackupPlanAssociation dataSource + * @property {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null} [cloudSqlInstanceBackupPlanAssociationProperties] BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties + * @property {string|null} [backupPlanRevisionId] BackupPlanAssociation backupPlanRevisionId + * @property {string|null} [backupPlanRevisionName] BackupPlanAssociation backupPlanRevisionName + */ + + /** + * Constructs a new BackupPlanAssociation. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupPlanAssociation. + * @implements IBackupPlanAssociation + * @constructor + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set + */ + function BackupPlanAssociation(properties) { + this.rulesConfigInfo = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupPlanAssociation name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.name = ""; + + /** + * BackupPlanAssociation resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.resourceType = ""; + + /** + * BackupPlanAssociation resource. + * @member {string} resource + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.resource = ""; + + /** + * BackupPlanAssociation backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.backupPlan = ""; + + /** + * BackupPlanAssociation createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.createTime = null; + + /** + * BackupPlanAssociation updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.updateTime = null; + + /** + * BackupPlanAssociation state. + * @member {google.cloud.backupdr.v1.BackupPlanAssociation.State} state + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.state = 0; + + /** + * BackupPlanAssociation rulesConfigInfo. + * @member {Array.} rulesConfigInfo + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.rulesConfigInfo = $util.emptyArray; + + /** + * BackupPlanAssociation dataSource. + * @member {string} dataSource + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.dataSource = ""; + + /** + * BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties. + * @member {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null|undefined} cloudSqlInstanceBackupPlanAssociationProperties + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.cloudSqlInstanceBackupPlanAssociationProperties = null; + + /** + * BackupPlanAssociation backupPlanRevisionId. + * @member {string} backupPlanRevisionId + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.backupPlanRevisionId = ""; + + /** + * BackupPlanAssociation backupPlanRevisionName. + * @member {string} backupPlanRevisionName + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + BackupPlanAssociation.prototype.backupPlanRevisionName = ""; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupPlanAssociation resourceProperties. + * @member {"cloudSqlInstanceBackupPlanAssociationProperties"|undefined} resourceProperties + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + */ + Object.defineProperty(BackupPlanAssociation.prototype, "resourceProperties", { + get: $util.oneOfGetter($oneOfFields = ["cloudSqlInstanceBackupPlanAssociationProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupPlanAssociation instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation instance + */ + BackupPlanAssociation.create = function create(properties) { + return new BackupPlanAssociation(properties); + }; + + /** + * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanAssociation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlan); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); + if (message.rulesConfigInfo != null && message.rulesConfigInfo.length) + for (var i = 0; i < message.rulesConfigInfo.length; ++i) + $root.google.cloud.backupdr.v1.RuleConfigInfo.encode(message.rulesConfigInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.dataSource); + if (message.cloudSqlInstanceBackupPlanAssociationProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceBackupPlanAssociationProperties")) + $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.encode(message.cloudSqlInstanceBackupPlanAssociationProperties, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.backupPlanRevisionId != null && Object.hasOwnProperty.call(message, "backupPlanRevisionId")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.backupPlanRevisionId); + if (message.backupPlanRevisionName != null && Object.hasOwnProperty.call(message, "backupPlanRevisionName")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.backupPlanRevisionName); + return writer; + }; + + /** + * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupPlanAssociation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanAssociation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); + 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.resourceType = reader.string(); + break; + } + case 3: { + message.resource = reader.string(); + break; + } + case 4: { + message.backupPlan = reader.string(); + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.state = reader.int32(); + break; + } + case 8: { + if (!(message.rulesConfigInfo && message.rulesConfigInfo.length)) + message.rulesConfigInfo = []; + message.rulesConfigInfo.push($root.google.cloud.backupdr.v1.RuleConfigInfo.decode(reader, reader.uint32())); + break; + } + case 9: { + message.dataSource = reader.string(); + break; + } + case 10: { + message.cloudSqlInstanceBackupPlanAssociationProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.decode(reader, reader.uint32()); + break; + } + case 11: { + message.backupPlanRevisionId = reader.string(); + break; + } + case 12: { + message.backupPlanRevisionName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupPlanAssociation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupPlanAssociation message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupPlanAssociation.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: string expected"; + if (message.resource != null && message.hasOwnProperty("resource")) + if (!$util.isString(message.resource)) + return "resource: string expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.createTime != null && message.hasOwnProperty("createTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + if (message.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.rulesConfigInfo != null && message.hasOwnProperty("rulesConfigInfo")) { + if (!Array.isArray(message.rulesConfigInfo)) + return "rulesConfigInfo: array expected"; + for (var i = 0; i < message.rulesConfigInfo.length; ++i) { + var error = $root.google.cloud.backupdr.v1.RuleConfigInfo.verify(message.rulesConfigInfo[i]); + if (error) + return "rulesConfigInfo." + error; + } + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: string expected"; + if (message.cloudSqlInstanceBackupPlanAssociationProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupPlanAssociationProperties")) { + properties.resourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify(message.cloudSqlInstanceBackupPlanAssociationProperties); + if (error) + return "cloudSqlInstanceBackupPlanAssociationProperties." + error; + } + } + if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) + if (!$util.isString(message.backupPlanRevisionId)) + return "backupPlanRevisionId: string expected"; + if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) + if (!$util.isString(message.backupPlanRevisionName)) + return "backupPlanRevisionName: string expected"; + return null; + }; + + /** + * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation + */ + BackupPlanAssociation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupPlanAssociation) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); + if (object.name != null) + message.name = String(object.name); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + if (object.resource != null) + message.resource = String(object.resource); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.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.backupdr.v1.BackupPlanAssociation.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + 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 "DELETING": + case 3: + message.state = 3; + break; + case "INACTIVE": + case 4: + message.state = 4; + break; + case "UPDATING": + case 5: + message.state = 5; + break; + } + if (object.rulesConfigInfo) { + if (!Array.isArray(object.rulesConfigInfo)) + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: array expected"); + message.rulesConfigInfo = []; + for (var i = 0; i < object.rulesConfigInfo.length; ++i) { + if (typeof object.rulesConfigInfo[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: object expected"); + message.rulesConfigInfo[i] = $root.google.cloud.backupdr.v1.RuleConfigInfo.fromObject(object.rulesConfigInfo[i]); + } + } + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + if (object.cloudSqlInstanceBackupPlanAssociationProperties != null) { + if (typeof object.cloudSqlInstanceBackupPlanAssociationProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.cloudSqlInstanceBackupPlanAssociationProperties: object expected"); + message.cloudSqlInstanceBackupPlanAssociationProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.fromObject(object.cloudSqlInstanceBackupPlanAssociationProperties); + } + if (object.backupPlanRevisionId != null) + message.backupPlanRevisionId = String(object.backupPlanRevisionId); + if (object.backupPlanRevisionName != null) + message.backupPlanRevisionName = String(object.backupPlanRevisionName); + return message; + }; + + /** + * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} message BackupPlanAssociation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupPlanAssociation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rulesConfigInfo = []; + if (options.defaults) { + object.name = ""; + object.resourceType = ""; + object.resource = ""; + object.backupPlan = ""; + object.createTime = null; + object.updateTime = null; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.dataSource = ""; + object.backupPlanRevisionId = ""; + object.backupPlanRevisionName = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + if (message.resource != null && message.hasOwnProperty("resource")) + object.resource = message.resource; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.updateTime != null && message.hasOwnProperty("updateTime")) + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] : message.state; + if (message.rulesConfigInfo && message.rulesConfigInfo.length) { + object.rulesConfigInfo = []; + for (var j = 0; j < message.rulesConfigInfo.length; ++j) + object.rulesConfigInfo[j] = $root.google.cloud.backupdr.v1.RuleConfigInfo.toObject(message.rulesConfigInfo[j], options); + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + if (message.cloudSqlInstanceBackupPlanAssociationProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupPlanAssociationProperties")) { + object.cloudSqlInstanceBackupPlanAssociationProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.toObject(message.cloudSqlInstanceBackupPlanAssociationProperties, options); + if (options.oneofs) + object.resourceProperties = "cloudSqlInstanceBackupPlanAssociationProperties"; + } + if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) + object.backupPlanRevisionId = message.backupPlanRevisionId; + if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) + object.backupPlanRevisionName = message.backupPlanRevisionName; + return object; + }; + + /** + * Converts this BackupPlanAssociation to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @instance + * @returns {Object.} JSON object + */ + BackupPlanAssociation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupPlanAssociation + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupPlanAssociation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupPlanAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlanAssociation"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupPlanAssociation.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} DELETING=3 DELETING value + * @property {number} INACTIVE=4 INACTIVE value + * @property {number} UPDATING=5 UPDATING value + */ + BackupPlanAssociation.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] = "DELETING"] = 3; + values[valuesById[4] = "INACTIVE"] = 4; + values[valuesById[5] = "UPDATING"] = 5; + return values; + })(); + + return BackupPlanAssociation; + })(); + + v1.RuleConfigInfo = (function() { + + /** + * Properties of a RuleConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IRuleConfigInfo + * @property {string|null} [ruleId] RuleConfigInfo ruleId + * @property {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null} [lastBackupState] RuleConfigInfo lastBackupState + * @property {google.rpc.IStatus|null} [lastBackupError] RuleConfigInfo lastBackupError + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] RuleConfigInfo lastSuccessfulBackupConsistencyTime + */ + + /** + * Constructs a new RuleConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RuleConfigInfo. + * @implements IRuleConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set + */ + function RuleConfigInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RuleConfigInfo ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.ruleId = ""; + + /** + * RuleConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastBackupState = 0; + + /** + * RuleConfigInfo lastBackupError. + * @member {google.rpc.IStatus|null|undefined} lastBackupError + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastBackupError = null; + + /** + * RuleConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + */ + RuleConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * Creates a new RuleConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo instance + */ + RuleConfigInfo.create = function create(properties) { + return new RuleConfigInfo(properties); + }; + + /** + * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.lastBackupState); + if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) + $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RuleConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleConfigInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 3: { + message.lastBackupState = reader.int32(); + break; + } + case 4: { + message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 5: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RuleConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RuleConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RuleConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { + var error = $root.google.rpc.Status.verify(message.lastBackupError); + if (error) + return "lastBackupError." + error; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + return null; + }; + + /** + * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo + */ + RuleConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RuleConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "PERMISSION_DENIED": + case 2: + message.lastBackupState = 2; + break; + case "SUCCEEDED": + case 3: + message.lastBackupState = 3; + break; + case "FAILED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastBackupError != null) { + if (typeof object.lastBackupError !== "object") + throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastBackupError: object expected"); + message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + return message; + }; + + /** + * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {google.cloud.backupdr.v1.RuleConfigInfo} message RuleConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RuleConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastBackupError = null; + object.lastSuccessfulBackupConsistencyTime = null; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) + object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + return object; + }; + + /** + * Converts this RuleConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @instance + * @returns {Object.} JSON object + */ + RuleConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RuleConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RuleConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RuleConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RuleConfigInfo"; + }; + + /** + * LastBackupState enum. + * @name google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState + * @enum {number} + * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value + * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value + * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value + * @property {number} SUCCEEDED=3 SUCCEEDED value + * @property {number} FAILED=4 FAILED value + */ + RuleConfigInfo.LastBackupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; + values[valuesById[2] = "PERMISSION_DENIED"] = 2; + values[valuesById[3] = "SUCCEEDED"] = 3; + values[valuesById[4] = "FAILED"] = 4; + return values; + })(); + + return RuleConfigInfo; + })(); + + v1.CreateBackupPlanAssociationRequest = (function() { + + /** + * Properties of a CreateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupPlanAssociationRequest + * @property {string|null} [parent] CreateBackupPlanAssociationRequest parent + * @property {string|null} [backupPlanAssociationId] CreateBackupPlanAssociationRequest backupPlanAssociationId + * @property {google.cloud.backupdr.v1.IBackupPlanAssociation|null} [backupPlanAssociation] CreateBackupPlanAssociationRequest backupPlanAssociation + * @property {string|null} [requestId] CreateBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new CreateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupPlanAssociationRequest. + * @implements ICreateBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set + */ + function CreateBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupPlanAssociationRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.parent = ""; + + /** + * CreateBackupPlanAssociationRequest backupPlanAssociationId. + * @member {string} backupPlanAssociationId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.backupPlanAssociationId = ""; + + /** + * CreateBackupPlanAssociationRequest backupPlanAssociation. + * @member {google.cloud.backupdr.v1.IBackupPlanAssociation|null|undefined} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.backupPlanAssociation = null; + + /** + * CreateBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + */ + CreateBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest instance + */ + CreateBackupPlanAssociationRequest.create = function create(properties) { + return new CreateBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanAssociationRequest.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.backupPlanAssociationId != null && Object.hasOwnProperty.call(message, "backupPlanAssociationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanAssociationId); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); + 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.backupPlanAssociationId = reader.string(); + break; + } + case 3: { + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupPlanAssociationRequest.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.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) + if (!$util.isString(message.backupPlanAssociationId)) + return "backupPlanAssociationId: string expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociation); + if (error) + return "backupPlanAssociation." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest + */ + CreateBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupPlanAssociationId != null) + message.backupPlanAssociationId = String(object.backupPlanAssociationId); + if (object.backupPlanAssociation != null) { + if (typeof object.backupPlanAssociation !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.backupPlanAssociation: object expected"); + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociation); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupPlanAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupPlanAssociationId = ""; + object.backupPlanAssociation = null; + object.requestId = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) + object.backupPlanAssociationId = message.backupPlanAssociationId; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociation, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this CreateBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest"; + }; + + return CreateBackupPlanAssociationRequest; + })(); + + v1.ListBackupPlanAssociationsRequest = (function() { + + /** + * Properties of a ListBackupPlanAssociationsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanAssociationsRequest + * @property {string|null} [parent] ListBackupPlanAssociationsRequest parent + * @property {number|null} [pageSize] ListBackupPlanAssociationsRequest pageSize + * @property {string|null} [pageToken] ListBackupPlanAssociationsRequest pageToken + * @property {string|null} [filter] ListBackupPlanAssociationsRequest filter + */ + + /** + * Constructs a new ListBackupPlanAssociationsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanAssociationsRequest. + * @implements IListBackupPlanAssociationsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set + */ + function ListBackupPlanAssociationsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupPlanAssociationsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.parent = ""; + + /** + * ListBackupPlanAssociationsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.pageSize = 0; + + /** + * ListBackupPlanAssociationsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.pageToken = ""; + + /** + * ListBackupPlanAssociationsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + */ + ListBackupPlanAssociationsRequest.prototype.filter = ""; + + /** + * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest instance + */ + ListBackupPlanAssociationsRequest.create = function create(properties) { + return new ListBackupPlanAssociationsRequest(properties); + }; + + /** + * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsRequest.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 ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); + 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 ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanAssociationsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanAssociationsRequest.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 ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest + */ + ListBackupPlanAssociationsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); + 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 ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanAssociationsRequest.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 ListBackupPlanAssociationsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanAssociationsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanAssociationsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest"; + }; + + return ListBackupPlanAssociationsRequest; + })(); + + v1.ListBackupPlanAssociationsResponse = (function() { + + /** + * Properties of a ListBackupPlanAssociationsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupPlanAssociationsResponse + * @property {Array.|null} [backupPlanAssociations] ListBackupPlanAssociationsResponse backupPlanAssociations + * @property {string|null} [nextPageToken] ListBackupPlanAssociationsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupPlanAssociationsResponse unreachable + */ + + /** + * Constructs a new ListBackupPlanAssociationsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupPlanAssociationsResponse. + * @implements IListBackupPlanAssociationsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set + */ + function ListBackupPlanAssociationsResponse(properties) { + this.backupPlanAssociations = []; + 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]]; + } + + /** + * ListBackupPlanAssociationsResponse backupPlanAssociations. + * @member {Array.} backupPlanAssociations + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.backupPlanAssociations = $util.emptyArray; + + /** + * ListBackupPlanAssociationsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupPlanAssociationsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + */ + ListBackupPlanAssociationsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse instance + */ + ListBackupPlanAssociationsResponse.create = function create(properties) { + return new ListBackupPlanAssociationsResponse(properties); + }; + + /** + * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlanAssociations != null && message.backupPlanAssociations.length) + for (var i = 0; i < message.backupPlanAssociations.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociations[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 ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupPlanAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlanAssociations && message.backupPlanAssociations.length)) + message.backupPlanAssociations = []; + message.backupPlanAssociations.push($root.google.cloud.backupdr.v1.BackupPlanAssociation.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 ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupPlanAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupPlanAssociationsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupPlanAssociationsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlanAssociations != null && message.hasOwnProperty("backupPlanAssociations")) { + if (!Array.isArray(message.backupPlanAssociations)) + return "backupPlanAssociations: array expected"; + for (var i = 0; i < message.backupPlanAssociations.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociations[i]); + if (error) + return "backupPlanAssociations." + 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 ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse + */ + ListBackupPlanAssociationsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); + if (object.backupPlanAssociations) { + if (!Array.isArray(object.backupPlanAssociations)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: array expected"); + message.backupPlanAssociations = []; + for (var i = 0; i < object.backupPlanAssociations.length; ++i) { + if (typeof object.backupPlanAssociations[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: object expected"); + message.backupPlanAssociations[i] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.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 ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupPlanAssociationsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupPlanAssociations = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlanAssociations && message.backupPlanAssociations.length) { + object.backupPlanAssociations = []; + for (var j = 0; j < message.backupPlanAssociations.length; ++j) + object.backupPlanAssociations[j] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociations[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 ListBackupPlanAssociationsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupPlanAssociationsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupPlanAssociationsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupPlanAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse"; + }; + + return ListBackupPlanAssociationsResponse; + })(); + + v1.FetchBackupPlanAssociationsForResourceTypeRequest = (function() { + + /** + * Properties of a FetchBackupPlanAssociationsForResourceTypeRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchBackupPlanAssociationsForResourceTypeRequest + * @property {string|null} [parent] FetchBackupPlanAssociationsForResourceTypeRequest parent + * @property {string|null} [resourceType] FetchBackupPlanAssociationsForResourceTypeRequest resourceType + * @property {number|null} [pageSize] FetchBackupPlanAssociationsForResourceTypeRequest pageSize + * @property {string|null} [pageToken] FetchBackupPlanAssociationsForResourceTypeRequest pageToken + * @property {string|null} [filter] FetchBackupPlanAssociationsForResourceTypeRequest filter + * @property {string|null} [orderBy] FetchBackupPlanAssociationsForResourceTypeRequest orderBy + */ + + /** + * Constructs a new FetchBackupPlanAssociationsForResourceTypeRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchBackupPlanAssociationsForResourceTypeRequest. + * @implements IFetchBackupPlanAssociationsForResourceTypeRequest + * @constructor + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest=} [properties] Properties to set + */ + function FetchBackupPlanAssociationsForResourceTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchBackupPlanAssociationsForResourceTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.parent = ""; + + /** + * FetchBackupPlanAssociationsForResourceTypeRequest resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.resourceType = ""; + + /** + * FetchBackupPlanAssociationsForResourceTypeRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.pageSize = 0; + + /** + * FetchBackupPlanAssociationsForResourceTypeRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.pageToken = ""; + + /** + * FetchBackupPlanAssociationsForResourceTypeRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.filter = ""; + + /** + * FetchBackupPlanAssociationsForResourceTypeRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.orderBy = ""; + + /** + * Creates a new FetchBackupPlanAssociationsForResourceTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest instance + */ + FetchBackupPlanAssociationsForResourceTypeRequest.create = function create(properties) { + return new FetchBackupPlanAssociationsForResourceTypeRequest(properties); + }; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupPlanAssociationsForResourceTypeRequest.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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupPlanAssociationsForResourceTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupPlanAssociationsForResourceTypeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest(); + 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.resourceType = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupPlanAssociationsForResourceTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchBackupPlanAssociationsForResourceTypeRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchBackupPlanAssociationsForResourceTypeRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: 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 FetchBackupPlanAssociationsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest + */ + FetchBackupPlanAssociationsForResourceTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + 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 FetchBackupPlanAssociationsForResourceTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} message FetchBackupPlanAssociationsForResourceTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchBackupPlanAssociationsForResourceTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceType = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + 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 FetchBackupPlanAssociationsForResourceTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @instance + * @returns {Object.} JSON object + */ + FetchBackupPlanAssociationsForResourceTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchBackupPlanAssociationsForResourceTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest"; + }; + + return FetchBackupPlanAssociationsForResourceTypeRequest; + })(); + + v1.FetchBackupPlanAssociationsForResourceTypeResponse = (function() { + + /** + * Properties of a FetchBackupPlanAssociationsForResourceTypeResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchBackupPlanAssociationsForResourceTypeResponse + * @property {Array.|null} [backupPlanAssociations] FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations + * @property {string|null} [nextPageToken] FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken + */ + + /** + * Constructs a new FetchBackupPlanAssociationsForResourceTypeResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchBackupPlanAssociationsForResourceTypeResponse. + * @implements IFetchBackupPlanAssociationsForResourceTypeResponse + * @constructor + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse=} [properties] Properties to set + */ + function FetchBackupPlanAssociationsForResourceTypeResponse(properties) { + this.backupPlanAssociations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations. + * @member {Array.} backupPlanAssociations + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeResponse.prototype.backupPlanAssociations = $util.emptyArray; + + /** + * FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @instance + */ + FetchBackupPlanAssociationsForResourceTypeResponse.prototype.nextPageToken = ""; + + /** + * Creates a new FetchBackupPlanAssociationsForResourceTypeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse instance + */ + FetchBackupPlanAssociationsForResourceTypeResponse.create = function create(properties) { + return new FetchBackupPlanAssociationsForResourceTypeResponse(properties); + }; + + /** + * Encodes the specified FetchBackupPlanAssociationsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse} message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupPlanAssociationsForResourceTypeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlanAssociations != null && message.backupPlanAssociations.length) + for (var i = 0; i < message.backupPlanAssociations.length; ++i) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociations[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 FetchBackupPlanAssociationsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse} message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupPlanAssociationsForResourceTypeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupPlanAssociationsForResourceTypeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupPlanAssociations && message.backupPlanAssociations.length)) + message.backupPlanAssociations = []; + message.backupPlanAssociations.push($root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupPlanAssociationsForResourceTypeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchBackupPlanAssociationsForResourceTypeResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchBackupPlanAssociationsForResourceTypeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlanAssociations != null && message.hasOwnProperty("backupPlanAssociations")) { + if (!Array.isArray(message.backupPlanAssociations)) + return "backupPlanAssociations: array expected"; + for (var i = 0; i < message.backupPlanAssociations.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociations[i]); + if (error) + return "backupPlanAssociations." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a FetchBackupPlanAssociationsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse + */ + FetchBackupPlanAssociationsForResourceTypeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse(); + if (object.backupPlanAssociations) { + if (!Array.isArray(object.backupPlanAssociations)) + throw TypeError(".google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.backupPlanAssociations: array expected"); + message.backupPlanAssociations = []; + for (var i = 0; i < object.backupPlanAssociations.length; ++i) { + if (typeof object.backupPlanAssociations[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.backupPlanAssociations: object expected"); + message.backupPlanAssociations[i] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociations[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a FetchBackupPlanAssociationsForResourceTypeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} message FetchBackupPlanAssociationsForResourceTypeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchBackupPlanAssociationsForResourceTypeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupPlanAssociations = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backupPlanAssociations && message.backupPlanAssociations.length) { + object.backupPlanAssociations = []; + for (var j = 0; j < message.backupPlanAssociations.length; ++j) + object.backupPlanAssociations[j] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociations[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this FetchBackupPlanAssociationsForResourceTypeResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @instance + * @returns {Object.} JSON object + */ + FetchBackupPlanAssociationsForResourceTypeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchBackupPlanAssociationsForResourceTypeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse"; + }; + + return FetchBackupPlanAssociationsForResourceTypeResponse; + })(); + + v1.GetBackupPlanAssociationRequest = (function() { + + /** + * Properties of a GetBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupPlanAssociationRequest + * @property {string|null} [name] GetBackupPlanAssociationRequest name + */ + + /** + * Constructs a new GetBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupPlanAssociationRequest. + * @implements IGetBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set + */ + function GetBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupPlanAssociationRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @instance + */ + GetBackupPlanAssociationRequest.prototype.name = ""; + + /** + * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest instance + */ + GetBackupPlanAssociationRequest.create = function create(properties) { + return new GetBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanAssociationRequest.encode = function encode(message, writer) { + 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 GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); + 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 GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupPlanAssociationRequest.verify = function verify(message) { + if (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 GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest + */ + GetBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupPlanAssociationRequest.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 GetBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanAssociationRequest"; + }; + + return GetBackupPlanAssociationRequest; + })(); + + v1.DeleteBackupPlanAssociationRequest = (function() { + + /** + * Properties of a DeleteBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupPlanAssociationRequest + * @property {string|null} [name] DeleteBackupPlanAssociationRequest name + * @property {string|null} [requestId] DeleteBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new DeleteBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupPlanAssociationRequest. + * @implements IDeleteBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set + */ + function DeleteBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupPlanAssociationRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + */ + DeleteBackupPlanAssociationRequest.prototype.name = ""; + + /** + * DeleteBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + */ + DeleteBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest instance + */ + DeleteBackupPlanAssociationRequest.create = function create(properties) { + return new DeleteBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanAssociationRequest.encode = function encode(message, writer) { + if (!writer) + 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 DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); + 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 DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupPlanAssociationRequest.verify = function verify(message) { + if (typeof message !== "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 DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest + */ + DeleteBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); + 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 DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupPlanAssociationRequest.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 DeleteBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest"; + }; + + return DeleteBackupPlanAssociationRequest; + })(); + + v1.UpdateBackupPlanAssociationRequest = (function() { + + /** + * Properties of an UpdateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupPlanAssociationRequest + * @property {google.cloud.backupdr.v1.IBackupPlanAssociation|null} [backupPlanAssociation] UpdateBackupPlanAssociationRequest backupPlanAssociation + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupPlanAssociationRequest updateMask + * @property {string|null} [requestId] UpdateBackupPlanAssociationRequest requestId + */ + + /** + * Constructs a new UpdateBackupPlanAssociationRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupPlanAssociationRequest. + * @implements IUpdateBackupPlanAssociationRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest=} [properties] Properties to set + */ + function UpdateBackupPlanAssociationRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupPlanAssociationRequest backupPlanAssociation. + * @member {google.cloud.backupdr.v1.IBackupPlanAssociation|null|undefined} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @instance + */ + UpdateBackupPlanAssociationRequest.prototype.backupPlanAssociation = null; + + /** + * UpdateBackupPlanAssociationRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @instance + */ + UpdateBackupPlanAssociationRequest.prototype.updateMask = null; + + /** + * UpdateBackupPlanAssociationRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @instance + */ + UpdateBackupPlanAssociationRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateBackupPlanAssociationRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest instance + */ + UpdateBackupPlanAssociationRequest.create = function create(properties) { + return new UpdateBackupPlanAssociationRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} message UpdateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupPlanAssociationRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified UpdateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} message UpdateBackupPlanAssociationRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupPlanAssociationRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32()); + break; + } + case 2: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupPlanAssociationRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupPlanAssociationRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) { + var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociation); + if (error) + return "backupPlanAssociation." + 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 UpdateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest + */ + UpdateBackupPlanAssociationRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest(); + if (object.backupPlanAssociation != null) { + if (typeof object.backupPlanAssociation !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.backupPlanAssociation: object expected"); + message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociation); + } + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.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 UpdateBackupPlanAssociationRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} message UpdateBackupPlanAssociationRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupPlanAssociationRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupPlanAssociation = null; + object.updateMask = null; + object.requestId = ""; + } + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociation, options); + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateBackupPlanAssociationRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupPlanAssociationRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest"; + }; + + return UpdateBackupPlanAssociationRequest; + })(); + + v1.TriggerBackupRequest = (function() { + + /** + * Properties of a TriggerBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ITriggerBackupRequest + * @property {string|null} [name] TriggerBackupRequest name + * @property {string|null} [ruleId] TriggerBackupRequest ruleId + * @property {string|null} [requestId] TriggerBackupRequest requestId + */ + + /** + * Constructs a new TriggerBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a TriggerBackupRequest. + * @implements ITriggerBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set + */ + function TriggerBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TriggerBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.name = ""; + + /** + * TriggerBackupRequest ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.ruleId = ""; + + /** + * TriggerBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + */ + TriggerBackupRequest.prototype.requestId = ""; + + /** + * Creates a new TriggerBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest instance + */ + TriggerBackupRequest.create = function create(properties) { + return new TriggerBackupRequest(properties); + }; + + /** + * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); + return writer; + }; + + /** + * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TriggerBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); + 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.ruleId = reader.string(); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TriggerBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TriggerBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TriggerBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest + */ + TriggerBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.TriggerBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {google.cloud.backupdr.v1.TriggerBackupRequest} message TriggerBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TriggerBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.ruleId = ""; + object.requestId = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this TriggerBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @instance + * @returns {Object.} JSON object + */ + TriggerBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TriggerBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.TriggerBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TriggerBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.TriggerBackupRequest"; + }; + + return TriggerBackupRequest; + })(); + + v1.CloudSqlInstanceDataSourceProperties = (function() { + + /** + * Properties of a CloudSqlInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @interface ICloudSqlInstanceDataSourceProperties + * @property {string|null} [name] CloudSqlInstanceDataSourceProperties name + * @property {string|null} [databaseInstalledVersion] CloudSqlInstanceDataSourceProperties databaseInstalledVersion + * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceDataSourceProperties instanceCreateTime + * @property {string|null} [instanceTier] CloudSqlInstanceDataSourceProperties instanceTier + */ + + /** + * Constructs a new CloudSqlInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CloudSqlInstanceDataSourceProperties. + * @implements ICloudSqlInstanceDataSourceProperties + * @constructor + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties=} [properties] Properties to set + */ + function CloudSqlInstanceDataSourceProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlInstanceDataSourceProperties name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @instance + */ + CloudSqlInstanceDataSourceProperties.prototype.name = ""; + + /** + * CloudSqlInstanceDataSourceProperties databaseInstalledVersion. + * @member {string} databaseInstalledVersion + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @instance + */ + CloudSqlInstanceDataSourceProperties.prototype.databaseInstalledVersion = ""; + + /** + * CloudSqlInstanceDataSourceProperties instanceCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @instance + */ + CloudSqlInstanceDataSourceProperties.prototype.instanceCreateTime = null; + + /** + * CloudSqlInstanceDataSourceProperties instanceTier. + * @member {string} instanceTier + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @instance + */ + CloudSqlInstanceDataSourceProperties.prototype.instanceTier = ""; + + /** + * Creates a new CloudSqlInstanceDataSourceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties instance + */ + CloudSqlInstanceDataSourceProperties.create = function create(properties) { + return new CloudSqlInstanceDataSourceProperties(properties); + }; + + /** + * Encodes the specified CloudSqlInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties} message CloudSqlInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceDataSourceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseInstalledVersion); + if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) + $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.instanceTier != null && Object.hasOwnProperty.call(message, "instanceTier")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.instanceTier); + return writer; + }; + + /** + * Encodes the specified CloudSqlInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties} message CloudSqlInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceDataSourceProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties(); + 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.databaseInstalledVersion = reader.string(); + break; + } + case 3: { + message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.instanceTier = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlInstanceDataSourceProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlInstanceDataSourceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (!$util.isString(message.databaseInstalledVersion)) + return "databaseInstalledVersion: string expected"; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); + if (error) + return "instanceCreateTime." + error; + } + if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) + if (!$util.isString(message.instanceTier)) + return "instanceTier: string expected"; + return null; + }; + + /** + * Creates a CloudSqlInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties + */ + CloudSqlInstanceDataSourceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.databaseInstalledVersion != null) + message.databaseInstalledVersion = String(object.databaseInstalledVersion); + if (object.instanceCreateTime != null) { + if (typeof object.instanceCreateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.instanceCreateTime: object expected"); + message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); + } + if (object.instanceTier != null) + message.instanceTier = String(object.instanceTier); + return message; + }; + + /** + * Creates a plain object from a CloudSqlInstanceDataSourceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} message CloudSqlInstanceDataSourceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlInstanceDataSourceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.databaseInstalledVersion = ""; + object.instanceCreateTime = null; + object.instanceTier = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + object.databaseInstalledVersion = message.databaseInstalledVersion; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) + object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); + if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) + object.instanceTier = message.instanceTier; + return object; + }; + + /** + * Converts this CloudSqlInstanceDataSourceProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @instance + * @returns {Object.} JSON object + */ + CloudSqlInstanceDataSourceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlInstanceDataSourceProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlInstanceDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties"; + }; + + return CloudSqlInstanceDataSourceProperties; + })(); + + v1.CloudSqlInstanceBackupProperties = (function() { + + /** + * Properties of a CloudSqlInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface ICloudSqlInstanceBackupProperties + * @property {string|null} [databaseInstalledVersion] CloudSqlInstanceBackupProperties databaseInstalledVersion + * @property {boolean|null} [finalBackup] CloudSqlInstanceBackupProperties finalBackup + * @property {string|null} [sourceInstance] CloudSqlInstanceBackupProperties sourceInstance + * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceBackupProperties instanceCreateTime + * @property {string|null} [instanceTier] CloudSqlInstanceBackupProperties instanceTier + * @property {google.protobuf.ITimestamp|null} [instanceDeleteTime] CloudSqlInstanceBackupProperties instanceDeleteTime + */ + + /** + * Constructs a new CloudSqlInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CloudSqlInstanceBackupProperties. + * @implements ICloudSqlInstanceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties=} [properties] Properties to set + */ + function CloudSqlInstanceBackupProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlInstanceBackupProperties databaseInstalledVersion. + * @member {string} databaseInstalledVersion + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + */ + CloudSqlInstanceBackupProperties.prototype.databaseInstalledVersion = ""; + + /** + * CloudSqlInstanceBackupProperties finalBackup. + * @member {boolean} finalBackup + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + */ + CloudSqlInstanceBackupProperties.prototype.finalBackup = false; + + /** + * CloudSqlInstanceBackupProperties sourceInstance. + * @member {string} sourceInstance + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + */ + CloudSqlInstanceBackupProperties.prototype.sourceInstance = ""; + + /** + * CloudSqlInstanceBackupProperties instanceCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + */ + CloudSqlInstanceBackupProperties.prototype.instanceCreateTime = null; + + /** + * CloudSqlInstanceBackupProperties instanceTier. + * @member {string} instanceTier + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + */ + CloudSqlInstanceBackupProperties.prototype.instanceTier = ""; + + /** + * CloudSqlInstanceBackupProperties instanceDeleteTime. + * @member {google.protobuf.ITimestamp|null|undefined} instanceDeleteTime + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + */ + CloudSqlInstanceBackupProperties.prototype.instanceDeleteTime = null; + + /** + * Creates a new CloudSqlInstanceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties instance + */ + CloudSqlInstanceBackupProperties.create = function create(properties) { + return new CloudSqlInstanceBackupProperties(properties); + }; + + /** + * Encodes the specified CloudSqlInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties} message CloudSqlInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseInstalledVersion); + if (message.finalBackup != null && Object.hasOwnProperty.call(message, "finalBackup")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.finalBackup); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceInstance); + if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) + $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.instanceTier != null && Object.hasOwnProperty.call(message, "instanceTier")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.instanceTier); + if (message.instanceDeleteTime != null && Object.hasOwnProperty.call(message, "instanceDeleteTime")) + $root.google.protobuf.Timestamp.encode(message.instanceDeleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudSqlInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties} message CloudSqlInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceBackupProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 2: { + message.databaseInstalledVersion = reader.string(); + break; + } + case 3: { + message.finalBackup = reader.bool(); + break; + } + case 4: { + message.sourceInstance = reader.string(); + break; + } + case 5: { + message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.instanceTier = reader.string(); + break; + } + case 8: { + message.instanceDeleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlInstanceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlInstanceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (!$util.isString(message.databaseInstalledVersion)) + return "databaseInstalledVersion: string expected"; + if (message.finalBackup != null && message.hasOwnProperty("finalBackup")) + if (typeof message.finalBackup !== "boolean") + return "finalBackup: boolean expected"; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: string expected"; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); + if (error) + return "instanceCreateTime." + error; + } + if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) + if (!$util.isString(message.instanceTier)) + return "instanceTier: string expected"; + if (message.instanceDeleteTime != null && message.hasOwnProperty("instanceDeleteTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceDeleteTime); + if (error) + return "instanceDeleteTime." + error; + } + return null; + }; + + /** + * Creates a CloudSqlInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties + */ + CloudSqlInstanceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties(); + if (object.databaseInstalledVersion != null) + message.databaseInstalledVersion = String(object.databaseInstalledVersion); + if (object.finalBackup != null) + message.finalBackup = Boolean(object.finalBackup); + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.instanceCreateTime != null) { + if (typeof object.instanceCreateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.instanceCreateTime: object expected"); + message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); + } + if (object.instanceTier != null) + message.instanceTier = String(object.instanceTier); + if (object.instanceDeleteTime != null) { + if (typeof object.instanceDeleteTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.instanceDeleteTime: object expected"); + message.instanceDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.instanceDeleteTime); + } + return message; + }; + + /** + * Creates a plain object from a CloudSqlInstanceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} message CloudSqlInstanceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlInstanceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.databaseInstalledVersion = ""; + object.finalBackup = false; + object.sourceInstance = ""; + object.instanceCreateTime = null; + object.instanceTier = ""; + object.instanceDeleteTime = null; + } + if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + object.databaseInstalledVersion = message.databaseInstalledVersion; + if (message.finalBackup != null && message.hasOwnProperty("finalBackup")) + object.finalBackup = message.finalBackup; + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) + object.sourceInstance = message.sourceInstance; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) + object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); + if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) + object.instanceTier = message.instanceTier; + if (message.instanceDeleteTime != null && message.hasOwnProperty("instanceDeleteTime")) + object.instanceDeleteTime = $root.google.protobuf.Timestamp.toObject(message.instanceDeleteTime, options); + return object; + }; + + /** + * Converts this CloudSqlInstanceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + CloudSqlInstanceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlInstanceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlInstanceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties"; + }; + + return CloudSqlInstanceBackupProperties; + })(); + + v1.CloudSqlInstanceDataSourceReferenceProperties = (function() { + + /** + * Properties of a CloudSqlInstanceDataSourceReferenceProperties. + * @memberof google.cloud.backupdr.v1 + * @interface ICloudSqlInstanceDataSourceReferenceProperties + * @property {string|null} [name] CloudSqlInstanceDataSourceReferenceProperties name + * @property {string|null} [databaseInstalledVersion] CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion + * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime + * @property {string|null} [instanceTier] CloudSqlInstanceDataSourceReferenceProperties instanceTier + */ + + /** + * Constructs a new CloudSqlInstanceDataSourceReferenceProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CloudSqlInstanceDataSourceReferenceProperties. + * @implements ICloudSqlInstanceDataSourceReferenceProperties + * @constructor + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties=} [properties] Properties to set + */ + function CloudSqlInstanceDataSourceReferenceProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlInstanceDataSourceReferenceProperties name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @instance + */ + CloudSqlInstanceDataSourceReferenceProperties.prototype.name = ""; + + /** + * CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion. + * @member {string} databaseInstalledVersion + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @instance + */ + CloudSqlInstanceDataSourceReferenceProperties.prototype.databaseInstalledVersion = ""; + + /** + * CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @instance + */ + CloudSqlInstanceDataSourceReferenceProperties.prototype.instanceCreateTime = null; + + /** + * CloudSqlInstanceDataSourceReferenceProperties instanceTier. + * @member {string} instanceTier + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @instance + */ + CloudSqlInstanceDataSourceReferenceProperties.prototype.instanceTier = ""; + + /** + * Creates a new CloudSqlInstanceDataSourceReferenceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties instance + */ + CloudSqlInstanceDataSourceReferenceProperties.create = function create(properties) { + return new CloudSqlInstanceDataSourceReferenceProperties(properties); + }; + + /** + * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties} message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceDataSourceReferenceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseInstalledVersion); + if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) + $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.instanceTier != null && Object.hasOwnProperty.call(message, "instanceTier")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.instanceTier); + return writer; + }; + + /** + * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties} message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceDataSourceReferenceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceDataSourceReferenceProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties(); + 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.databaseInstalledVersion = reader.string(); + break; + } + case 3: { + message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.instanceTier = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceDataSourceReferenceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlInstanceDataSourceReferenceProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlInstanceDataSourceReferenceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + if (!$util.isString(message.databaseInstalledVersion)) + return "databaseInstalledVersion: string expected"; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); + if (error) + return "instanceCreateTime." + error; + } + if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) + if (!$util.isString(message.instanceTier)) + return "instanceTier: string expected"; + return null; + }; + + /** + * Creates a CloudSqlInstanceDataSourceReferenceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties + */ + CloudSqlInstanceDataSourceReferenceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.databaseInstalledVersion != null) + message.databaseInstalledVersion = String(object.databaseInstalledVersion); + if (object.instanceCreateTime != null) { + if (typeof object.instanceCreateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.instanceCreateTime: object expected"); + message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); + } + if (object.instanceTier != null) + message.instanceTier = String(object.instanceTier); + return message; + }; + + /** + * Creates a plain object from a CloudSqlInstanceDataSourceReferenceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} message CloudSqlInstanceDataSourceReferenceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlInstanceDataSourceReferenceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.databaseInstalledVersion = ""; + object.instanceCreateTime = null; + object.instanceTier = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) + object.databaseInstalledVersion = message.databaseInstalledVersion; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) + object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); + if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) + object.instanceTier = message.instanceTier; + return object; + }; + + /** + * Converts this CloudSqlInstanceDataSourceReferenceProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @instance + * @returns {Object.} JSON object + */ + CloudSqlInstanceDataSourceReferenceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlInstanceDataSourceReferenceProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlInstanceDataSourceReferenceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties"; + }; + + return CloudSqlInstanceDataSourceReferenceProperties; + })(); + + v1.CloudSqlInstanceInitializationConfig = (function() { + + /** + * Properties of a CloudSqlInstanceInitializationConfig. + * @memberof google.cloud.backupdr.v1 + * @interface ICloudSqlInstanceInitializationConfig + * @property {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|null} [edition] CloudSqlInstanceInitializationConfig edition + */ + + /** + * Constructs a new CloudSqlInstanceInitializationConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CloudSqlInstanceInitializationConfig. + * @implements ICloudSqlInstanceInitializationConfig + * @constructor + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig=} [properties] Properties to set + */ + function CloudSqlInstanceInitializationConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlInstanceInitializationConfig edition. + * @member {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition} edition + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @instance + */ + CloudSqlInstanceInitializationConfig.prototype.edition = 0; + + /** + * Creates a new CloudSqlInstanceInitializationConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig instance + */ + CloudSqlInstanceInitializationConfig.create = function create(properties) { + return new CloudSqlInstanceInitializationConfig(properties); + }; + + /** + * Encodes the specified CloudSqlInstanceInitializationConfig message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig} message CloudSqlInstanceInitializationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceInitializationConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified CloudSqlInstanceInitializationConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig} message CloudSqlInstanceInitializationConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceInitializationConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceInitializationConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.edition = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceInitializationConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlInstanceInitializationConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlInstanceInitializationConfig.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 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a CloudSqlInstanceInitializationConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig + */ + CloudSqlInstanceInitializationConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig(); + switch (object.edition) { + default: + if (typeof object.edition === "number") { + message.edition = object.edition; + break; + } + break; + case "EDITION_UNSPECIFIED": + case 0: + message.edition = 0; + break; + case "ENTERPRISE": + case 1: + message.edition = 1; + break; + case "ENTERPRISE_PLUS": + case 2: + message.edition = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a CloudSqlInstanceInitializationConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} message CloudSqlInstanceInitializationConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlInstanceInitializationConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; + if (message.edition != null && message.hasOwnProperty("edition")) + object.edition = options.enums === String ? $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition[message.edition] === undefined ? message.edition : $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition[message.edition] : message.edition; + return object; + }; + + /** + * Converts this CloudSqlInstanceInitializationConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @instance + * @returns {Object.} JSON object + */ + CloudSqlInstanceInitializationConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlInstanceInitializationConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlInstanceInitializationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig"; + }; + + /** + * Edition enum. + * @name google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition + * @enum {number} + * @property {number} EDITION_UNSPECIFIED=0 EDITION_UNSPECIFIED value + * @property {number} ENTERPRISE=1 ENTERPRISE value + * @property {number} ENTERPRISE_PLUS=2 ENTERPRISE_PLUS value + */ + CloudSqlInstanceInitializationConfig.Edition = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "EDITION_UNSPECIFIED"] = 0; + values[valuesById[1] = "ENTERPRISE"] = 1; + values[valuesById[2] = "ENTERPRISE_PLUS"] = 2; + return values; + })(); + + return CloudSqlInstanceInitializationConfig; + })(); + + v1.CloudSqlInstanceBackupPlanAssociationProperties = (function() { + + /** + * Properties of a CloudSqlInstanceBackupPlanAssociationProperties. + * @memberof google.cloud.backupdr.v1 + * @interface ICloudSqlInstanceBackupPlanAssociationProperties + * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime + */ + + /** + * Constructs a new CloudSqlInstanceBackupPlanAssociationProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CloudSqlInstanceBackupPlanAssociationProperties. + * @implements ICloudSqlInstanceBackupPlanAssociationProperties + * @constructor + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties=} [properties] Properties to set + */ + function CloudSqlInstanceBackupPlanAssociationProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime. + * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @instance + */ + CloudSqlInstanceBackupPlanAssociationProperties.prototype.instanceCreateTime = null; + + /** + * Creates a new CloudSqlInstanceBackupPlanAssociationProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties instance + */ + CloudSqlInstanceBackupPlanAssociationProperties.create = function create(properties) { + return new CloudSqlInstanceBackupPlanAssociationProperties(properties); + }; + + /** + * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties} message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceBackupPlanAssociationProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) + $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties} message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CloudSqlInstanceBackupPlanAssociationProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceBackupPlanAssociationProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CloudSqlInstanceBackupPlanAssociationProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CloudSqlInstanceBackupPlanAssociationProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CloudSqlInstanceBackupPlanAssociationProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); + if (error) + return "instanceCreateTime." + error; + } + return null; + }; + + /** + * Creates a CloudSqlInstanceBackupPlanAssociationProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties + */ + CloudSqlInstanceBackupPlanAssociationProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties(); + if (object.instanceCreateTime != null) { + if (typeof object.instanceCreateTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.instanceCreateTime: object expected"); + message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); + } + return message; + }; + + /** + * Creates a plain object from a CloudSqlInstanceBackupPlanAssociationProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} message CloudSqlInstanceBackupPlanAssociationProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CloudSqlInstanceBackupPlanAssociationProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.instanceCreateTime = null; + if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) + object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); + return object; + }; + + /** + * Converts this CloudSqlInstanceBackupPlanAssociationProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @instance + * @returns {Object.} JSON object + */ + CloudSqlInstanceBackupPlanAssociationProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CloudSqlInstanceBackupPlanAssociationProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CloudSqlInstanceBackupPlanAssociationProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties"; + }; + + return CloudSqlInstanceBackupPlanAssociationProperties; + })(); + + v1.BackupVault = (function() { + + /** + * Properties of a BackupVault. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupVault + * @property {string|null} [name] BackupVault name + * @property {string|null} [description] BackupVault description + * @property {Object.|null} [labels] BackupVault labels + * @property {google.protobuf.ITimestamp|null} [createTime] BackupVault createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] BackupVault updateTime + * @property {google.protobuf.IDuration|null} [backupMinimumEnforcedRetentionDuration] BackupVault backupMinimumEnforcedRetentionDuration + * @property {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null} [backupRetentionInheritance] BackupVault backupRetentionInheritance + * @property {boolean|null} [deletable] BackupVault deletable + * @property {string|null} [etag] BackupVault etag + * @property {google.cloud.backupdr.v1.BackupVault.State|null} [state] BackupVault state + * @property {google.protobuf.ITimestamp|null} [effectiveTime] BackupVault effectiveTime + * @property {number|Long|null} [backupCount] BackupVault backupCount + * @property {string|null} [serviceAccount] BackupVault serviceAccount + * @property {number|Long|null} [totalStoredBytes] BackupVault totalStoredBytes + * @property {string|null} [uid] BackupVault uid + * @property {Object.|null} [annotations] BackupVault annotations + * @property {google.cloud.backupdr.v1.BackupVault.AccessRestriction|null} [accessRestriction] BackupVault accessRestriction + * @property {google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null} [encryptionConfig] BackupVault encryptionConfig + */ + + /** + * Constructs a new BackupVault. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupVault. + * @implements IBackupVault + * @constructor + * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set + */ + function BackupVault(properties) { + this.labels = {}; + this.annotations = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupVault name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.name = ""; + + /** + * BackupVault description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.description = null; + + /** + * BackupVault labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.labels = $util.emptyObject; + + /** + * BackupVault createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.createTime = null; + + /** + * BackupVault updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.updateTime = null; + + /** + * BackupVault backupMinimumEnforcedRetentionDuration. + * @member {google.protobuf.IDuration|null|undefined} backupMinimumEnforcedRetentionDuration + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupMinimumEnforcedRetentionDuration = null; + + /** + * BackupVault backupRetentionInheritance. + * @member {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null|undefined} backupRetentionInheritance + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupRetentionInheritance = null; + + /** + * BackupVault deletable. + * @member {boolean|null|undefined} deletable + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.deletable = null; + + /** + * BackupVault etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.etag = null; + + /** + * BackupVault state. + * @member {google.cloud.backupdr.v1.BackupVault.State} state + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.state = 0; + + /** + * BackupVault effectiveTime. + * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.effectiveTime = null; + + /** + * BackupVault backupCount. + * @member {number|Long} backupCount + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.backupCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupVault serviceAccount. + * @member {string} serviceAccount + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.serviceAccount = ""; + + /** + * BackupVault totalStoredBytes. + * @member {number|Long} totalStoredBytes + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.totalStoredBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupVault uid. + * @member {string} uid + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.uid = ""; + + /** + * BackupVault annotations. + * @member {Object.} annotations + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.annotations = $util.emptyObject; + + /** + * BackupVault accessRestriction. + * @member {google.cloud.backupdr.v1.BackupVault.AccessRestriction} accessRestriction + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.accessRestriction = 0; + + /** + * BackupVault encryptionConfig. + * @member {google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null|undefined} encryptionConfig + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + */ + BackupVault.prototype.encryptionConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_backupMinimumEnforcedRetentionDuration", { + get: $util.oneOfGetter($oneOfFields = ["backupMinimumEnforcedRetentionDuration"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_backupRetentionInheritance", { + get: $util.oneOfGetter($oneOfFields = ["backupRetentionInheritance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_deletable", { + get: $util.oneOfGetter($oneOfFields = ["deletable"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_effectiveTime", { + get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupVault.prototype, "_encryptionConfig", { + get: $util.oneOfGetter($oneOfFields = ["encryptionConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupVault instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault instance + */ + BackupVault.create = function create(properties) { + return new BackupVault(properties); + }; + + /** + * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupVault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); + 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.deletable != null && Object.hasOwnProperty.call(message, "deletable")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.deletable); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); + if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) + $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) + writer.uint32(/* id 17, wireType 0 =*/136).int64(message.backupCount); + if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 19, wireType 0 =*/152).int64(message.totalStoredBytes); + if (message.backupMinimumEnforcedRetentionDuration != null && Object.hasOwnProperty.call(message, "backupMinimumEnforcedRetentionDuration")) + $root.google.protobuf.Duration.encode(message.backupMinimumEnforcedRetentionDuration, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 21, wireType 2 =*/170).string(message.uid); + if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) + for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); + if (message.accessRestriction != null && Object.hasOwnProperty.call(message, "accessRestriction")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.accessRestriction); + if (message.backupRetentionInheritance != null && Object.hasOwnProperty.call(message, "backupRetentionInheritance")) + writer.uint32(/* id 27, wireType 0 =*/216).int32(message.backupRetentionInheritance); + if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) + $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupVault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupVault message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupVault.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupVault(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 20: { + message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); + break; + } + case 27: { + message.backupRetentionInheritance = reader.int32(); + break; + } + case 8: { + message.deletable = reader.bool(); + break; + } + case 9: { + message.etag = reader.string(); + break; + } + case 10: { + message.state = reader.int32(); + break; + } + case 12: { + message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 17: { + message.backupCount = reader.int64(); + break; + } + case 18: { + message.serviceAccount = reader.string(); + break; + } + case 19: { + message.totalStoredBytes = reader.int64(); + break; + } + case 21: { + message.uid = reader.string(); + break; + } + case 22: { + if (message.annotations === $util.emptyObject) + message.annotations = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.annotations[key] = value; + break; + } + case 24: { + message.accessRestriction = reader.int32(); + break; + } + case 29: { + message.encryptionConfig = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupVault message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupVault.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupVault message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupVault.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")) { + properties._description = 1; + 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.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { + properties._backupMinimumEnforcedRetentionDuration = 1; + { + var error = $root.google.protobuf.Duration.verify(message.backupMinimumEnforcedRetentionDuration); + if (error) + return "backupMinimumEnforcedRetentionDuration." + error; + } + } + if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { + properties._backupRetentionInheritance = 1; + switch (message.backupRetentionInheritance) { + default: + return "backupRetentionInheritance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.deletable != null && message.hasOwnProperty("deletable")) { + properties._deletable = 1; + if (typeof message.deletable !== "boolean") + return "deletable: boolean expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: 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.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + properties._effectiveTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); + if (error) + return "effectiveTime." + error; + } + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) + if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) + return "backupCount: integer|Long expected"; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + if (!$util.isString(message.serviceAccount)) + return "serviceAccount: string expected"; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.annotations != null && message.hasOwnProperty("annotations")) { + if (!$util.isObject(message.annotations)) + return "annotations: object expected"; + var key = Object.keys(message.annotations); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.annotations[key[i]])) + return "annotations: string{k:string} expected"; + } + if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) + switch (message.accessRestriction) { + default: + return "accessRestriction: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + properties._encryptionConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.verify(message.encryptionConfig); + if (error) + return "encryptionConfig." + error; + } + } + return null; + }; + + /** + * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault + */ + BackupVault.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupVault) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupVault(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupMinimumEnforcedRetentionDuration != null) { + if (typeof object.backupMinimumEnforcedRetentionDuration !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.backupMinimumEnforcedRetentionDuration: object expected"); + message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.fromObject(object.backupMinimumEnforcedRetentionDuration); + } + switch (object.backupRetentionInheritance) { + default: + if (typeof object.backupRetentionInheritance === "number") { + message.backupRetentionInheritance = object.backupRetentionInheritance; + break; + } + break; + case "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED": + case 0: + message.backupRetentionInheritance = 0; + break; + case "INHERIT_VAULT_RETENTION": + case 1: + message.backupRetentionInheritance = 1; + break; + case "MATCH_BACKUP_EXPIRE_TIME": + case 2: + message.backupRetentionInheritance = 2; + break; + } + if (object.deletable != null) + message.deletable = Boolean(object.deletable); + if (object.etag != null) + message.etag = String(object.etag); + 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 "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + case "UPDATING": + case 5: + message.state = 5; + break; + } + if (object.effectiveTime != null) { + if (typeof object.effectiveTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.effectiveTime: object expected"); + message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); + } + if (object.backupCount != null) + if ($util.Long) + (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; + else if (typeof object.backupCount === "string") + message.backupCount = parseInt(object.backupCount, 10); + else if (typeof object.backupCount === "number") + message.backupCount = object.backupCount; + else if (typeof object.backupCount === "object") + message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); + if (object.serviceAccount != null) + message.serviceAccount = String(object.serviceAccount); + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + if (object.uid != null) + message.uid = String(object.uid); + if (object.annotations) { + if (typeof object.annotations !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.annotations: object expected"); + message.annotations = {}; + for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) + message.annotations[keys[i]] = String(object.annotations[keys[i]]); + } + switch (object.accessRestriction) { + default: + if (typeof object.accessRestriction === "number") { + message.accessRestriction = object.accessRestriction; + break; + } + break; + case "ACCESS_RESTRICTION_UNSPECIFIED": + case 0: + message.accessRestriction = 0; + break; + case "WITHIN_PROJECT": + case 1: + message.accessRestriction = 1; + break; + case "WITHIN_ORGANIZATION": + case 2: + message.accessRestriction = 2; + break; + case "UNRESTRICTED": + case 3: + message.accessRestriction = 3; + break; + case "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA": + case 4: + message.accessRestriction = 4; + break; + } + if (object.encryptionConfig != null) { + if (typeof object.encryptionConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupVault.encryptionConfig: object expected"); + message.encryptionConfig = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.fromObject(object.encryptionConfig); + } + return message; + }; + + /** + * Creates a plain object from a BackupVault message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {google.cloud.backupdr.v1.BackupVault} message BackupVault + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupVault.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) { + object.labels = {}; + object.annotations = {}; + } + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupCount = options.longs === String ? "0" : 0; + object.serviceAccount = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalStoredBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalStoredBytes = options.longs === String ? "0" : 0; + object.uid = ""; + object.accessRestriction = options.enums === String ? "ACCESS_RESTRICTION_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "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.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + if (message.deletable != null && message.hasOwnProperty("deletable")) { + object.deletable = message.deletable; + if (options.oneofs) + object._deletable = "deletable"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupVault.State[message.state] : message.state; + if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { + object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); + if (options.oneofs) + object._effectiveTime = "effectiveTime"; + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) + if (typeof message.backupCount === "number") + object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; + else + object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) + object.serviceAccount = message.serviceAccount; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { + object.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.toObject(message.backupMinimumEnforcedRetentionDuration, options); + if (options.oneofs) + object._backupMinimumEnforcedRetentionDuration = "backupMinimumEnforcedRetentionDuration"; + } + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { + object.annotations = {}; + for (var j = 0; j < keys2.length; ++j) + object.annotations[keys2[j]] = message.annotations[keys2[j]]; + } + if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) + object.accessRestriction = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] === undefined ? message.accessRestriction : $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] : message.accessRestriction; + if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { + object.backupRetentionInheritance = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] === undefined ? message.backupRetentionInheritance : $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] : message.backupRetentionInheritance; + if (options.oneofs) + object._backupRetentionInheritance = "backupRetentionInheritance"; + } + if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { + object.encryptionConfig = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.toObject(message.encryptionConfig, options); + if (options.oneofs) + object._encryptionConfig = "encryptionConfig"; + } + return object; + }; + + /** + * Converts this BackupVault to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupVault + * @instance + * @returns {Object.} JSON object + */ + BackupVault.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupVault + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupVault + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupVault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupVault"; + }; + + /** + * BackupRetentionInheritance enum. + * @name google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance + * @enum {number} + * @property {number} BACKUP_RETENTION_INHERITANCE_UNSPECIFIED=0 BACKUP_RETENTION_INHERITANCE_UNSPECIFIED value + * @property {number} INHERIT_VAULT_RETENTION=1 INHERIT_VAULT_RETENTION value + * @property {number} MATCH_BACKUP_EXPIRE_TIME=2 MATCH_BACKUP_EXPIRE_TIME value + */ + BackupVault.BackupRetentionInheritance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "INHERIT_VAULT_RETENTION"] = 1; + values[valuesById[2] = "MATCH_BACKUP_EXPIRE_TIME"] = 2; + return values; + })(); + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupVault.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} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + * @property {number} UPDATING=5 UPDATING value + */ + BackupVault.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] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + values[valuesById[5] = "UPDATING"] = 5; + return values; + })(); + + /** + * AccessRestriction enum. + * @name google.cloud.backupdr.v1.BackupVault.AccessRestriction + * @enum {number} + * @property {number} ACCESS_RESTRICTION_UNSPECIFIED=0 ACCESS_RESTRICTION_UNSPECIFIED value + * @property {number} WITHIN_PROJECT=1 WITHIN_PROJECT value + * @property {number} WITHIN_ORGANIZATION=2 WITHIN_ORGANIZATION value + * @property {number} UNRESTRICTED=3 UNRESTRICTED value + * @property {number} WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA=4 WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA value + */ + BackupVault.AccessRestriction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_RESTRICTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "WITHIN_PROJECT"] = 1; + values[valuesById[2] = "WITHIN_ORGANIZATION"] = 2; + values[valuesById[3] = "UNRESTRICTED"] = 3; + values[valuesById[4] = "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA"] = 4; + return values; + })(); + + BackupVault.EncryptionConfig = (function() { + + /** + * Properties of an EncryptionConfig. + * @memberof google.cloud.backupdr.v1.BackupVault + * @interface IEncryptionConfig + * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName + */ + + /** + * Constructs a new EncryptionConfig. + * @memberof google.cloud.backupdr.v1.BackupVault + * @classdesc Represents an EncryptionConfig. + * @implements IEncryptionConfig + * @constructor + * @param {google.cloud.backupdr.v1.BackupVault.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 kmsKeyName. + * @member {string|null|undefined} kmsKeyName + * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig + * @instance + */ + EncryptionConfig.prototype.kmsKeyName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(EncryptionConfig.prototype, "_kmsKeyName", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new EncryptionConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {google.cloud.backupdr.v1.BackupVault.IEncryptionConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupVault.EncryptionConfig} EncryptionConfig instance + */ + EncryptionConfig.create = function create(properties) { + return new EncryptionConfig(properties); + }; + + /** + * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.EncryptionConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {google.cloud.backupdr.v1.BackupVault.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.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); + return writer; + }; + + /** + * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.EncryptionConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.EncryptionConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.kmsKeyName = 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.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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"; + var properties = {}; + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + properties._kmsKeyName = 1; + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: 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.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupVault.EncryptionConfig} EncryptionConfig + */ + EncryptionConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig(); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + return message; + }; + + /** + * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig + * @static + * @param {google.cloud.backupdr.v1.BackupVault.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 (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + object.kmsKeyName = message.kmsKeyName; + if (options.oneofs) + object._kmsKeyName = "kmsKeyName"; + } + return object; + }; + + /** + * Converts this EncryptionConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.EncryptionConfig"; + }; + + return EncryptionConfig; + })(); + + return BackupVault; + })(); + + v1.DataSource = (function() { + + /** + * Properties of a DataSource. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSource + * @property {string|null} [name] DataSource name + * @property {google.cloud.backupdr.v1.DataSource.State|null} [state] DataSource state + * @property {Object.|null} [labels] DataSource labels + * @property {google.protobuf.ITimestamp|null} [createTime] DataSource createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] DataSource updateTime + * @property {number|Long|null} [backupCount] DataSource backupCount + * @property {string|null} [etag] DataSource etag + * @property {number|Long|null} [totalStoredBytes] DataSource totalStoredBytes + * @property {google.cloud.backupdr.v1.BackupConfigState|null} [configState] DataSource configState + * @property {google.cloud.backupdr.v1.IBackupConfigInfo|null} [backupConfigInfo] DataSource backupConfigInfo + * @property {google.cloud.backupdr.v1.IDataSourceGcpResource|null} [dataSourceGcpResource] DataSource dataSourceGcpResource + * @property {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null} [dataSourceBackupApplianceApplication] DataSource dataSourceBackupApplianceApplication + * @property {boolean|null} [backupBlockedByVaultAccessRestriction] DataSource backupBlockedByVaultAccessRestriction + */ + + /** + * Constructs a new DataSource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSource. + * @implements IDataSource + * @constructor + * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set + */ + function DataSource(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]]; + } + + /** + * DataSource name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.name = ""; + + /** + * DataSource state. + * @member {google.cloud.backupdr.v1.DataSource.State} state + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.state = 0; + + /** + * DataSource labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.labels = $util.emptyObject; + + /** + * DataSource createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.createTime = null; + + /** + * DataSource updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.updateTime = null; + + /** + * DataSource backupCount. + * @member {number|Long|null|undefined} backupCount + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupCount = null; + + /** + * DataSource etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.etag = null; + + /** + * DataSource totalStoredBytes. + * @member {number|Long|null|undefined} totalStoredBytes + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.totalStoredBytes = null; + + /** + * DataSource configState. + * @member {google.cloud.backupdr.v1.BackupConfigState} configState + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.configState = 0; + + /** + * DataSource backupConfigInfo. + * @member {google.cloud.backupdr.v1.IBackupConfigInfo|null|undefined} backupConfigInfo + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupConfigInfo = null; + + /** + * DataSource dataSourceGcpResource. + * @member {google.cloud.backupdr.v1.IDataSourceGcpResource|null|undefined} dataSourceGcpResource + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceGcpResource = null; + + /** + * DataSource dataSourceBackupApplianceApplication. + * @member {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null|undefined} dataSourceBackupApplianceApplication + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.dataSourceBackupApplianceApplication = null; + + /** + * DataSource backupBlockedByVaultAccessRestriction. + * @member {boolean} backupBlockedByVaultAccessRestriction + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + DataSource.prototype.backupBlockedByVaultAccessRestriction = false; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSource.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSource.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSource.prototype, "_backupCount", { + get: $util.oneOfGetter($oneOfFields = ["backupCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSource.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSource.prototype, "_totalStoredBytes", { + get: $util.oneOfGetter($oneOfFields = ["totalStoredBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * DataSource sourceResource. + * @member {"dataSourceGcpResource"|"dataSourceBackupApplianceApplication"|undefined} sourceResource + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + */ + Object.defineProperty(DataSource.prototype, "sourceResource", { + get: $util.oneOfGetter($oneOfFields = ["dataSourceGcpResource", "dataSourceBackupApplianceApplication"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSource} DataSource instance + */ + DataSource.create = function create(properties) { + return new DataSource(properties); + }; + + /** + * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) + $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.backupCount); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 21, wireType 0 =*/168).int32(message.state); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.totalStoredBytes); + if (message.configState != null && Object.hasOwnProperty.call(message, "configState")) + writer.uint32(/* id 24, wireType 0 =*/192).int32(message.configState); + if (message.backupConfigInfo != null && Object.hasOwnProperty.call(message, "backupConfigInfo")) + $root.google.cloud.backupdr.v1.BackupConfigInfo.encode(message.backupConfigInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); + if (message.dataSourceGcpResource != null && Object.hasOwnProperty.call(message, "dataSourceGcpResource")) + $root.google.cloud.backupdr.v1.DataSourceGcpResource.encode(message.dataSourceGcpResource, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.dataSourceBackupApplianceApplication != null && Object.hasOwnProperty.call(message, "dataSourceBackupApplianceApplication")) + $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.encode(message.dataSourceBackupApplianceApplication, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); + if (message.backupBlockedByVaultAccessRestriction != null && Object.hasOwnProperty.call(message, "backupBlockedByVaultAccessRestriction")) + writer.uint32(/* id 28, wireType 0 =*/224).bool(message.backupBlockedByVaultAccessRestriction); + return writer; + }; + + /** + * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSource(), 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 21: { + message.state = reader.int32(); + break; + } + case 4: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 5: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 6: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.backupCount = reader.int64(); + break; + } + case 14: { + message.etag = reader.string(); + break; + } + case 23: { + message.totalStoredBytes = reader.int64(); + break; + } + case 24: { + message.configState = reader.int32(); + break; + } + case 25: { + message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.decode(reader, reader.uint32()); + break; + } + case 26: { + message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.decode(reader, reader.uint32()); + break; + } + case 27: { + message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.decode(reader, reader.uint32()); + break; + } + case 28: { + message.backupBlockedByVaultAccessRestriction = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSource message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSource.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.state != null && message.hasOwnProperty("state")) + switch (message.state) { + default: + return "state: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.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.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.updateTime); + if (error) + return "updateTime." + error; + } + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) { + properties._backupCount = 1; + if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) + return "backupCount: integer|Long expected"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: string expected"; + } + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + properties._totalStoredBytes = 1; + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + } + if (message.configState != null && message.hasOwnProperty("configState")) + switch (message.configState) { + default: + return "configState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) { + var error = $root.google.cloud.backupdr.v1.BackupConfigInfo.verify(message.backupConfigInfo); + if (error) + return "backupConfigInfo." + error; + } + if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.DataSourceGcpResource.verify(message.dataSourceGcpResource); + if (error) + return "dataSourceGcpResource." + error; + } + } + if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { + if (properties.sourceResource === 1) + return "sourceResource: multiple values"; + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify(message.dataSourceBackupApplianceApplication); + if (error) + return "dataSourceBackupApplianceApplication." + error; + } + } + if (message.backupBlockedByVaultAccessRestriction != null && message.hasOwnProperty("backupBlockedByVaultAccessRestriction")) + if (typeof message.backupBlockedByVaultAccessRestriction !== "boolean") + return "backupBlockedByVaultAccessRestriction: boolean expected"; + return null; + }; + + /** + * Creates a DataSource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSource} DataSource + */ + DataSource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSource) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSource(); + 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 "CREATING": + case 1: + message.state = 1; + break; + case "ACTIVE": + case 2: + message.state = 2; + break; + case "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.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.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.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.backupdr.v1.DataSource.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.backupCount != null) + if ($util.Long) + (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; + else if (typeof object.backupCount === "string") + message.backupCount = parseInt(object.backupCount, 10); + else if (typeof object.backupCount === "number") + message.backupCount = object.backupCount; + else if (typeof object.backupCount === "object") + message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); + if (object.etag != null) + message.etag = String(object.etag); + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + switch (object.configState) { + default: + if (typeof object.configState === "number") { + message.configState = object.configState; + break; + } + break; + case "BACKUP_CONFIG_STATE_UNSPECIFIED": + case 0: + message.configState = 0; + break; + case "ACTIVE": + case 1: + message.configState = 1; + break; + case "PASSIVE": + case 2: + message.configState = 2; + break; + } + if (object.backupConfigInfo != null) { + if (typeof object.backupConfigInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.backupConfigInfo: object expected"); + message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.fromObject(object.backupConfigInfo); + } + if (object.dataSourceGcpResource != null) { + if (typeof object.dataSourceGcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceGcpResource: object expected"); + message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.fromObject(object.dataSourceGcpResource); + } + if (object.dataSourceBackupApplianceApplication != null) { + if (typeof object.dataSourceBackupApplianceApplication !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceBackupApplianceApplication: object expected"); + message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.fromObject(object.dataSourceBackupApplianceApplication); + } + if (object.backupBlockedByVaultAccessRestriction != null) + message.backupBlockedByVaultAccessRestriction = Boolean(object.backupBlockedByVaultAccessRestriction); + return message; + }; + + /** + * Creates a plain object from a DataSource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {google.cloud.backupdr.v1.DataSource} message DataSource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.configState = options.enums === String ? "BACKUP_CONFIG_STATE_UNSPECIFIED" : 0; + object.backupConfigInfo = null; + object.backupBlockedByVaultAccessRestriction = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + 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.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + if (message.backupCount != null && message.hasOwnProperty("backupCount")) { + if (typeof message.backupCount === "number") + object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; + else + object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; + if (options.oneofs) + object._backupCount = "backupCount"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.DataSource.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.DataSource.State[message.state] : message.state; + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (options.oneofs) + object._totalStoredBytes = "totalStoredBytes"; + } + if (message.configState != null && message.hasOwnProperty("configState")) + object.configState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] === undefined ? message.configState : $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] : message.configState; + if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) + object.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.toObject(message.backupConfigInfo, options); + if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { + object.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.toObject(message.dataSourceGcpResource, options); + if (options.oneofs) + object.sourceResource = "dataSourceGcpResource"; + } + if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { + object.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.toObject(message.dataSourceBackupApplianceApplication, options); + if (options.oneofs) + object.sourceResource = "dataSourceBackupApplianceApplication"; + } + if (message.backupBlockedByVaultAccessRestriction != null && message.hasOwnProperty("backupBlockedByVaultAccessRestriction")) + object.backupBlockedByVaultAccessRestriction = message.backupBlockedByVaultAccessRestriction; + return object; + }; + + /** + * Converts this DataSource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSource + * @instance + * @returns {Object.} JSON object + */ + DataSource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSource"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.DataSource.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} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + */ + DataSource.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] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + return values; + })(); + + return DataSource; + })(); + + v1.BackupConfigInfo = (function() { + + /** + * Properties of a BackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupConfigInfo + * @property {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null} [lastBackupState] BackupConfigInfo lastBackupState + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] BackupConfigInfo lastSuccessfulBackupConsistencyTime + * @property {google.rpc.IStatus|null} [lastBackupError] BackupConfigInfo lastBackupError + * @property {google.cloud.backupdr.v1.IGcpBackupConfig|null} [gcpBackupConfig] BackupConfigInfo gcpBackupConfig + * @property {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null} [backupApplianceBackupConfig] BackupConfigInfo backupApplianceBackupConfig + */ + + /** + * Constructs a new BackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupConfigInfo. + * @implements IBackupConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set + */ + function BackupConfigInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastBackupState = 0; + + /** + * BackupConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * BackupConfigInfo lastBackupError. + * @member {google.rpc.IStatus|null|undefined} lastBackupError + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.lastBackupError = null; + + /** + * BackupConfigInfo gcpBackupConfig. + * @member {google.cloud.backupdr.v1.IGcpBackupConfig|null|undefined} gcpBackupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.gcpBackupConfig = null; + + /** + * BackupConfigInfo backupApplianceBackupConfig. + * @member {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null|undefined} backupApplianceBackupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + BackupConfigInfo.prototype.backupApplianceBackupConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupConfigInfo backupConfig. + * @member {"gcpBackupConfig"|"backupApplianceBackupConfig"|undefined} backupConfig + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + */ + Object.defineProperty(BackupConfigInfo.prototype, "backupConfig", { + get: $util.oneOfGetter($oneOfFields = ["gcpBackupConfig", "backupApplianceBackupConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo instance + */ + BackupConfigInfo.create = function create(properties) { + return new BackupConfigInfo(properties); + }; + + /** + * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lastBackupState); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) + $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.gcpBackupConfig != null && Object.hasOwnProperty.call(message, "gcpBackupConfig")) + $root.google.cloud.backupdr.v1.GcpBackupConfig.encode(message.gcpBackupConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.backupApplianceBackupConfig != null && Object.hasOwnProperty.call(message, "backupApplianceBackupConfig")) + $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.encode(message.backupApplianceBackupConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lastBackupState = reader.int32(); + break; + } + case 2: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); + break; + } + case 4: { + message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { + var error = $root.google.rpc.Status.verify(message.lastBackupError); + if (error) + return "lastBackupError." + error; + } + if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { + properties.backupConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.GcpBackupConfig.verify(message.gcpBackupConfig); + if (error) + return "gcpBackupConfig." + error; + } + } + if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { + if (properties.backupConfig === 1) + return "backupConfig: multiple values"; + properties.backupConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify(message.backupApplianceBackupConfig); + if (error) + return "backupApplianceBackupConfig." + error; + } + } + return null; + }; + + /** + * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo + */ + BackupConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "SUCCEEDED": + case 2: + message.lastBackupState = 2; + break; + case "FAILED": + case 3: + message.lastBackupState = 3; + break; + case "PERMISSION_DENIED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + if (object.lastBackupError != null) { + if (typeof object.lastBackupError !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastBackupError: object expected"); + message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); + } + if (object.gcpBackupConfig != null) { + if (typeof object.gcpBackupConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.gcpBackupConfig: object expected"); + message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.fromObject(object.gcpBackupConfig); + } + if (object.backupApplianceBackupConfig != null) { + if (typeof object.backupApplianceBackupConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.backupApplianceBackupConfig: object expected"); + message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.fromObject(object.backupApplianceBackupConfig); + } + return message; + }; + + /** + * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.BackupConfigInfo} message BackupConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastSuccessfulBackupConsistencyTime = null; + object.lastBackupError = null; + } + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) + object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); + if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { + object.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.toObject(message.gcpBackupConfig, options); + if (options.oneofs) + object.backupConfig = "gcpBackupConfig"; + } + if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { + object.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.toObject(message.backupApplianceBackupConfig, options); + if (options.oneofs) + object.backupConfig = "backupApplianceBackupConfig"; + } + return object; + }; + + /** + * Converts this BackupConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @instance + * @returns {Object.} JSON object + */ + BackupConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigInfo"; + }; + + /** + * LastBackupState enum. + * @name google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState + * @enum {number} + * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value + * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value + * @property {number} SUCCEEDED=2 SUCCEEDED value + * @property {number} FAILED=3 FAILED value + * @property {number} PERMISSION_DENIED=4 PERMISSION_DENIED value + */ + BackupConfigInfo.LastBackupState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; + values[valuesById[2] = "SUCCEEDED"] = 2; + values[valuesById[3] = "FAILED"] = 3; + values[valuesById[4] = "PERMISSION_DENIED"] = 4; + return values; + })(); + + return BackupConfigInfo; + })(); + + v1.GcpBackupConfig = (function() { + + /** + * Properties of a GcpBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IGcpBackupConfig + * @property {string|null} [backupPlan] GcpBackupConfig backupPlan + * @property {string|null} [backupPlanDescription] GcpBackupConfig backupPlanDescription + * @property {string|null} [backupPlanAssociation] GcpBackupConfig backupPlanAssociation + * @property {Array.|null} [backupPlanRules] GcpBackupConfig backupPlanRules + * @property {string|null} [backupPlanRevisionName] GcpBackupConfig backupPlanRevisionName + * @property {string|null} [backupPlanRevisionId] GcpBackupConfig backupPlanRevisionId + */ + + /** + * Constructs a new GcpBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GcpBackupConfig. + * @implements IGcpBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set + */ + function GcpBackupConfig(properties) { + this.backupPlanRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcpBackupConfig backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlan = ""; + + /** + * GcpBackupConfig backupPlanDescription. + * @member {string} backupPlanDescription + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanDescription = ""; + + /** + * GcpBackupConfig backupPlanAssociation. + * @member {string} backupPlanAssociation + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanAssociation = ""; + + /** + * GcpBackupConfig backupPlanRules. + * @member {Array.} backupPlanRules + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanRules = $util.emptyArray; + + /** + * GcpBackupConfig backupPlanRevisionName. + * @member {string} backupPlanRevisionName + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanRevisionName = ""; + + /** + * GcpBackupConfig backupPlanRevisionId. + * @member {string} backupPlanRevisionId + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + */ + GcpBackupConfig.prototype.backupPlanRevisionId = ""; + + /** + * Creates a new GcpBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig instance + */ + GcpBackupConfig.create = function create(properties) { + return new GcpBackupConfig(properties); + }; + + /** + * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); + if (message.backupPlanDescription != null && Object.hasOwnProperty.call(message, "backupPlanDescription")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanDescription); + if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanAssociation); + if (message.backupPlanRules != null && message.backupPlanRules.length) + for (var i = 0; i < message.backupPlanRules.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlanRules[i]); + if (message.backupPlanRevisionName != null && Object.hasOwnProperty.call(message, "backupPlanRevisionName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.backupPlanRevisionName); + if (message.backupPlanRevisionId != null && Object.hasOwnProperty.call(message, "backupPlanRevisionId")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.backupPlanRevisionId); + return writer; + }; + + /** + * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupPlan = reader.string(); + break; + } + case 2: { + message.backupPlanDescription = reader.string(); + break; + } + case 3: { + message.backupPlanAssociation = reader.string(); + break; + } + case 4: { + if (!(message.backupPlanRules && message.backupPlanRules.length)) + message.backupPlanRules = []; + message.backupPlanRules.push(reader.string()); + break; + } + case 5: { + message.backupPlanRevisionName = reader.string(); + break; + } + case 6: { + message.backupPlanRevisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) + if (!$util.isString(message.backupPlanDescription)) + return "backupPlanDescription: string expected"; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + if (!$util.isString(message.backupPlanAssociation)) + return "backupPlanAssociation: string expected"; + if (message.backupPlanRules != null && message.hasOwnProperty("backupPlanRules")) { + if (!Array.isArray(message.backupPlanRules)) + return "backupPlanRules: array expected"; + for (var i = 0; i < message.backupPlanRules.length; ++i) + if (!$util.isString(message.backupPlanRules[i])) + return "backupPlanRules: string[] expected"; + } + if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) + if (!$util.isString(message.backupPlanRevisionName)) + return "backupPlanRevisionName: string expected"; + if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) + if (!$util.isString(message.backupPlanRevisionId)) + return "backupPlanRevisionId: string expected"; + return null; + }; + + /** + * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig + */ + GcpBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GcpBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.backupPlanDescription != null) + message.backupPlanDescription = String(object.backupPlanDescription); + if (object.backupPlanAssociation != null) + message.backupPlanAssociation = String(object.backupPlanAssociation); + if (object.backupPlanRules) { + if (!Array.isArray(object.backupPlanRules)) + throw TypeError(".google.cloud.backupdr.v1.GcpBackupConfig.backupPlanRules: array expected"); + message.backupPlanRules = []; + for (var i = 0; i < object.backupPlanRules.length; ++i) + message.backupPlanRules[i] = String(object.backupPlanRules[i]); + } + if (object.backupPlanRevisionName != null) + message.backupPlanRevisionName = String(object.backupPlanRevisionName); + if (object.backupPlanRevisionId != null) + message.backupPlanRevisionId = String(object.backupPlanRevisionId); + return message; + }; + + /** + * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {google.cloud.backupdr.v1.GcpBackupConfig} message GcpBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupPlanRules = []; + if (options.defaults) { + object.backupPlan = ""; + object.backupPlanDescription = ""; + object.backupPlanAssociation = ""; + object.backupPlanRevisionName = ""; + object.backupPlanRevisionId = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) + object.backupPlanDescription = message.backupPlanDescription; + if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) + object.backupPlanAssociation = message.backupPlanAssociation; + if (message.backupPlanRules && message.backupPlanRules.length) { + object.backupPlanRules = []; + for (var j = 0; j < message.backupPlanRules.length; ++j) + object.backupPlanRules[j] = message.backupPlanRules[j]; + } + if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) + object.backupPlanRevisionName = message.backupPlanRevisionName; + if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) + object.backupPlanRevisionId = message.backupPlanRevisionId; + return object; + }; + + /** + * Converts this GcpBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @instance + * @returns {Object.} JSON object + */ + GcpBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GcpBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpBackupConfig"; + }; + + return GcpBackupConfig; + })(); + + v1.BackupApplianceBackupConfig = (function() { + + /** + * Properties of a BackupApplianceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceBackupConfig + * @property {string|null} [backupApplianceName] BackupApplianceBackupConfig backupApplianceName + * @property {number|Long|null} [backupApplianceId] BackupApplianceBackupConfig backupApplianceId + * @property {number|Long|null} [slaId] BackupApplianceBackupConfig slaId + * @property {string|null} [applicationName] BackupApplianceBackupConfig applicationName + * @property {string|null} [hostName] BackupApplianceBackupConfig hostName + * @property {string|null} [sltName] BackupApplianceBackupConfig sltName + * @property {string|null} [slpName] BackupApplianceBackupConfig slpName + */ + + /** + * Constructs a new BackupApplianceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceBackupConfig. + * @implements IBackupApplianceBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set + */ + function BackupApplianceBackupConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupApplianceBackupConfig backupApplianceName. + * @member {string} backupApplianceName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.backupApplianceName = ""; + + /** + * BackupApplianceBackupConfig backupApplianceId. + * @member {number|Long} backupApplianceId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceBackupConfig slaId. + * @member {number|Long} slaId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.slaId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceBackupConfig applicationName. + * @member {string} applicationName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.applicationName = ""; + + /** + * BackupApplianceBackupConfig hostName. + * @member {string} hostName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.hostName = ""; + + /** + * BackupApplianceBackupConfig sltName. + * @member {string} sltName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.sltName = ""; + + /** + * BackupApplianceBackupConfig slpName. + * @member {string} slpName + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + */ + BackupApplianceBackupConfig.prototype.slpName = ""; + + /** + * Creates a new BackupApplianceBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig instance + */ + BackupApplianceBackupConfig.create = function create(properties) { + return new BackupApplianceBackupConfig(properties); + }; + + /** + * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupApplianceName); + if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.backupApplianceId); + if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.slaId); + if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.applicationName); + if (message.hostName != null && Object.hasOwnProperty.call(message, "hostName")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostName); + if (message.sltName != null && Object.hasOwnProperty.call(message, "sltName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.sltName); + if (message.slpName != null && Object.hasOwnProperty.call(message, "slpName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.slpName); + return writer; + }; + + /** + * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupApplianceName = reader.string(); + break; + } + case 2: { + message.backupApplianceId = reader.int64(); + break; + } + case 3: { + message.slaId = reader.int64(); + break; + } + case 4: { + message.applicationName = reader.string(); + break; + } + case 5: { + message.hostName = reader.string(); + break; + } + case 6: { + message.sltName = reader.string(); + break; + } + case 7: { + message.slpName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + if (!$util.isString(message.backupApplianceName)) + return "backupApplianceName: string expected"; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) + return "backupApplianceId: integer|Long expected"; + if (message.slaId != null && message.hasOwnProperty("slaId")) + if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) + return "slaId: integer|Long expected"; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + if (!$util.isString(message.applicationName)) + return "applicationName: string expected"; + if (message.hostName != null && message.hasOwnProperty("hostName")) + if (!$util.isString(message.hostName)) + return "hostName: string expected"; + if (message.sltName != null && message.hasOwnProperty("sltName")) + if (!$util.isString(message.sltName)) + return "sltName: string expected"; + if (message.slpName != null && message.hasOwnProperty("slpName")) + if (!$util.isString(message.slpName)) + return "slpName: string expected"; + return null; + }; + + /** + * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig + */ + BackupApplianceBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); + if (object.backupApplianceName != null) + message.backupApplianceName = String(object.backupApplianceName); + if (object.backupApplianceId != null) + if ($util.Long) + (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; + else if (typeof object.backupApplianceId === "string") + message.backupApplianceId = parseInt(object.backupApplianceId, 10); + else if (typeof object.backupApplianceId === "number") + message.backupApplianceId = object.backupApplianceId; + else if (typeof object.backupApplianceId === "object") + message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); + if (object.slaId != null) + if ($util.Long) + (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; + else if (typeof object.slaId === "string") + message.slaId = parseInt(object.slaId, 10); + else if (typeof object.slaId === "number") + message.slaId = object.slaId; + else if (typeof object.slaId === "object") + message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); + if (object.applicationName != null) + message.applicationName = String(object.applicationName); + if (object.hostName != null) + message.hostName = String(object.hostName); + if (object.sltName != null) + message.sltName = String(object.sltName); + if (object.slpName != null) + message.slpName = String(object.slpName); + return message; + }; + + /** + * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceBackupConfig} message BackupApplianceBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupApplianceName = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupApplianceId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.slaId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.slaId = options.longs === String ? "0" : 0; + object.applicationName = ""; + object.hostName = ""; + object.sltName = ""; + object.slpName = ""; + } + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + object.backupApplianceName = message.backupApplianceName; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (typeof message.backupApplianceId === "number") + object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; + else + object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; + if (message.slaId != null && message.hasOwnProperty("slaId")) + if (typeof message.slaId === "number") + object.slaId = options.longs === String ? String(message.slaId) : message.slaId; + else + object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + object.applicationName = message.applicationName; + if (message.hostName != null && message.hasOwnProperty("hostName")) + object.hostName = message.hostName; + if (message.sltName != null && message.hasOwnProperty("sltName")) + object.sltName = message.sltName; + if (message.slpName != null && message.hasOwnProperty("slpName")) + object.slpName = message.slpName; + return object; + }; + + /** + * Converts this BackupApplianceBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupConfig"; + }; + + return BackupApplianceBackupConfig; + })(); + + v1.DataSourceGcpResource = (function() { + + /** + * Properties of a DataSourceGcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceGcpResource + * @property {string|null} [gcpResourcename] DataSourceGcpResource gcpResourcename + * @property {string|null} [location] DataSourceGcpResource location + * @property {string|null} [type] DataSourceGcpResource type + * @property {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null} [computeInstanceDatasourceProperties] DataSourceGcpResource computeInstanceDatasourceProperties + * @property {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null} [cloudSqlInstanceDatasourceProperties] DataSourceGcpResource cloudSqlInstanceDatasourceProperties + * @property {google.cloud.backupdr.v1.IDiskDataSourceProperties|null} [diskDatasourceProperties] DataSourceGcpResource diskDatasourceProperties + */ + + /** + * Constructs a new DataSourceGcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceGcpResource. + * @implements IDataSourceGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set + */ + function DataSourceGcpResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceGcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.gcpResourcename = ""; + + /** + * DataSourceGcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.location = ""; + + /** + * DataSourceGcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.type = ""; + + /** + * DataSourceGcpResource computeInstanceDatasourceProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null|undefined} computeInstanceDatasourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.computeInstanceDatasourceProperties = null; + + /** + * DataSourceGcpResource cloudSqlInstanceDatasourceProperties. + * @member {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null|undefined} cloudSqlInstanceDatasourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.cloudSqlInstanceDatasourceProperties = null; + + /** + * DataSourceGcpResource diskDatasourceProperties. + * @member {google.cloud.backupdr.v1.IDiskDataSourceProperties|null|undefined} diskDatasourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + DataSourceGcpResource.prototype.diskDatasourceProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataSourceGcpResource gcpResourceProperties. + * @member {"computeInstanceDatasourceProperties"|"cloudSqlInstanceDatasourceProperties"|"diskDatasourceProperties"|undefined} gcpResourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + */ + Object.defineProperty(DataSourceGcpResource.prototype, "gcpResourceProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceDatasourceProperties", "cloudSqlInstanceDatasourceProperties", "diskDatasourceProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSourceGcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource instance + */ + DataSourceGcpResource.create = function create(properties) { + return new DataSourceGcpResource(properties); + }; + + /** + * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.computeInstanceDatasourceProperties != null && Object.hasOwnProperty.call(message, "computeInstanceDatasourceProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.encode(message.computeInstanceDatasourceProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.cloudSqlInstanceDatasourceProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceDatasourceProperties")) + $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.encode(message.cloudSqlInstanceDatasourceProperties, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.diskDatasourceProperties != null && Object.hasOwnProperty.call(message, "diskDatasourceProperties")) + $root.google.cloud.backupdr.v1.DiskDataSourceProperties.encode(message.diskDatasourceProperties, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.decode(reader, reader.uint32()); + break; + } + case 5: { + message.cloudSqlInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + message.diskDatasourceProperties = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceGcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceGcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { + properties.gcpResourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify(message.computeInstanceDatasourceProperties); + if (error) + return "computeInstanceDatasourceProperties." + error; + } + } + if (message.cloudSqlInstanceDatasourceProperties != null && message.hasOwnProperty("cloudSqlInstanceDatasourceProperties")) { + if (properties.gcpResourceProperties === 1) + return "gcpResourceProperties: multiple values"; + properties.gcpResourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify(message.cloudSqlInstanceDatasourceProperties); + if (error) + return "cloudSqlInstanceDatasourceProperties." + error; + } + } + if (message.diskDatasourceProperties != null && message.hasOwnProperty("diskDatasourceProperties")) { + if (properties.gcpResourceProperties === 1) + return "gcpResourceProperties: multiple values"; + properties.gcpResourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.verify(message.diskDatasourceProperties); + if (error) + return "diskDatasourceProperties." + error; + } + } + return null; + }; + + /** + * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource + */ + DataSourceGcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceGcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + if (object.computeInstanceDatasourceProperties != null) { + if (typeof object.computeInstanceDatasourceProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.computeInstanceDatasourceProperties: object expected"); + message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.fromObject(object.computeInstanceDatasourceProperties); + } + if (object.cloudSqlInstanceDatasourceProperties != null) { + if (typeof object.cloudSqlInstanceDatasourceProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.cloudSqlInstanceDatasourceProperties: object expected"); + message.cloudSqlInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.fromObject(object.cloudSqlInstanceDatasourceProperties); + } + if (object.diskDatasourceProperties != null) { + if (typeof object.diskDatasourceProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.diskDatasourceProperties: object expected"); + message.diskDatasourceProperties = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.fromObject(object.diskDatasourceProperties); + } + return message; + }; + + /** + * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {google.cloud.backupdr.v1.DataSourceGcpResource} message DataSourceGcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceGcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { + object.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.toObject(message.computeInstanceDatasourceProperties, options); + if (options.oneofs) + object.gcpResourceProperties = "computeInstanceDatasourceProperties"; + } + if (message.cloudSqlInstanceDatasourceProperties != null && message.hasOwnProperty("cloudSqlInstanceDatasourceProperties")) { + object.cloudSqlInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.toObject(message.cloudSqlInstanceDatasourceProperties, options); + if (options.oneofs) + object.gcpResourceProperties = "cloudSqlInstanceDatasourceProperties"; + } + if (message.diskDatasourceProperties != null && message.hasOwnProperty("diskDatasourceProperties")) { + object.diskDatasourceProperties = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.toObject(message.diskDatasourceProperties, options); + if (options.oneofs) + object.gcpResourceProperties = "diskDatasourceProperties"; + } + return object; + }; + + /** + * Converts this DataSourceGcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @instance + * @returns {Object.} JSON object + */ + DataSourceGcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceGcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceGcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceGcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceGcpResource"; + }; + + return DataSourceGcpResource; + })(); + + v1.DataSourceBackupApplianceApplication = (function() { + + /** + * Properties of a DataSourceBackupApplianceApplication. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceBackupApplianceApplication + * @property {string|null} [applicationName] DataSourceBackupApplianceApplication applicationName + * @property {string|null} [backupAppliance] DataSourceBackupApplianceApplication backupAppliance + * @property {number|Long|null} [applianceId] DataSourceBackupApplianceApplication applianceId + * @property {string|null} [type] DataSourceBackupApplianceApplication type + * @property {number|Long|null} [applicationId] DataSourceBackupApplianceApplication applicationId + * @property {string|null} [hostname] DataSourceBackupApplianceApplication hostname + * @property {number|Long|null} [hostId] DataSourceBackupApplianceApplication hostId + */ + + /** + * Constructs a new DataSourceBackupApplianceApplication. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceBackupApplianceApplication. + * @implements IDataSourceBackupApplianceApplication + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set + */ + function DataSourceBackupApplianceApplication(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceBackupApplianceApplication applicationName. + * @member {string} applicationName + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applicationName = ""; + + /** + * DataSourceBackupApplianceApplication backupAppliance. + * @member {string} backupAppliance + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.backupAppliance = ""; + + /** + * DataSourceBackupApplianceApplication applianceId. + * @member {number|Long} applianceId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceBackupApplianceApplication type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.type = ""; + + /** + * DataSourceBackupApplianceApplication applicationId. + * @member {number|Long} applicationId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.applicationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceBackupApplianceApplication hostname. + * @member {string} hostname + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.hostname = ""; + + /** + * DataSourceBackupApplianceApplication hostId. + * @member {number|Long} hostId + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + */ + DataSourceBackupApplianceApplication.prototype.hostId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication instance + */ + DataSourceBackupApplianceApplication.create = function create(properties) { + return new DataSourceBackupApplianceApplication(properties); + }; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupApplianceApplication.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.applicationName); + if (message.backupAppliance != null && Object.hasOwnProperty.call(message, "backupAppliance")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupAppliance); + if (message.applianceId != null && Object.hasOwnProperty.call(message, "applianceId")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.applianceId); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.hostname); + if (message.hostId != null && Object.hasOwnProperty.call(message, "hostId")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.hostId); + if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.applicationId); + return writer; + }; + + /** + * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupApplianceApplication.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupApplianceApplication.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.applicationName = reader.string(); + break; + } + case 2: { + message.backupAppliance = reader.string(); + break; + } + case 3: { + message.applianceId = reader.int64(); + break; + } + case 4: { + message.type = reader.string(); + break; + } + case 8: { + message.applicationId = reader.int64(); + break; + } + case 6: { + message.hostname = reader.string(); + break; + } + case 7: { + message.hostId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupApplianceApplication.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceBackupApplianceApplication message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceBackupApplianceApplication.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + if (!$util.isString(message.applicationName)) + return "applicationName: string expected"; + if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) + if (!$util.isString(message.backupAppliance)) + return "backupAppliance: string expected"; + if (message.applianceId != null && message.hasOwnProperty("applianceId")) + if (!$util.isInteger(message.applianceId) && !(message.applianceId && $util.isInteger(message.applianceId.low) && $util.isInteger(message.applianceId.high))) + return "applianceId: integer|Long expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (!$util.isInteger(message.applicationId) && !(message.applicationId && $util.isInteger(message.applicationId.low) && $util.isInteger(message.applicationId.high))) + return "applicationId: integer|Long expected"; + if (message.hostname != null && message.hasOwnProperty("hostname")) + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + if (message.hostId != null && message.hasOwnProperty("hostId")) + if (!$util.isInteger(message.hostId) && !(message.hostId && $util.isInteger(message.hostId.low) && $util.isInteger(message.hostId.high))) + return "hostId: integer|Long expected"; + return null; + }; + + /** + * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication + */ + DataSourceBackupApplianceApplication.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); + if (object.applicationName != null) + message.applicationName = String(object.applicationName); + if (object.backupAppliance != null) + message.backupAppliance = String(object.backupAppliance); + if (object.applianceId != null) + if ($util.Long) + (message.applianceId = $util.Long.fromValue(object.applianceId)).unsigned = false; + else if (typeof object.applianceId === "string") + message.applianceId = parseInt(object.applianceId, 10); + else if (typeof object.applianceId === "number") + message.applianceId = object.applianceId; + else if (typeof object.applianceId === "object") + message.applianceId = new $util.LongBits(object.applianceId.low >>> 0, object.applianceId.high >>> 0).toNumber(); + if (object.type != null) + message.type = String(object.type); + if (object.applicationId != null) + if ($util.Long) + (message.applicationId = $util.Long.fromValue(object.applicationId)).unsigned = false; + else if (typeof object.applicationId === "string") + message.applicationId = parseInt(object.applicationId, 10); + else if (typeof object.applicationId === "number") + message.applicationId = object.applicationId; + else if (typeof object.applicationId === "object") + message.applicationId = new $util.LongBits(object.applicationId.low >>> 0, object.applicationId.high >>> 0).toNumber(); + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.hostId != null) + if ($util.Long) + (message.hostId = $util.Long.fromValue(object.hostId)).unsigned = false; + else if (typeof object.hostId === "string") + message.hostId = parseInt(object.hostId, 10); + else if (typeof object.hostId === "number") + message.hostId = object.hostId; + else if (typeof object.hostId === "object") + message.hostId = new $util.LongBits(object.hostId.low >>> 0, object.hostId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceBackupApplianceApplication.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.applicationName = ""; + object.backupAppliance = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applianceId = options.longs === String ? "0" : 0; + object.type = ""; + object.hostname = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.hostId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.hostId = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.applicationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.applicationId = options.longs === String ? "0" : 0; + } + if (message.applicationName != null && message.hasOwnProperty("applicationName")) + object.applicationName = message.applicationName; + if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) + object.backupAppliance = message.backupAppliance; + if (message.applianceId != null && message.hasOwnProperty("applianceId")) + if (typeof message.applianceId === "number") + object.applianceId = options.longs === String ? String(message.applianceId) : message.applianceId; + else + object.applianceId = options.longs === String ? $util.Long.prototype.toString.call(message.applianceId) : options.longs === Number ? new $util.LongBits(message.applianceId.low >>> 0, message.applianceId.high >>> 0).toNumber() : message.applianceId; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.hostname != null && message.hasOwnProperty("hostname")) + object.hostname = message.hostname; + if (message.hostId != null && message.hasOwnProperty("hostId")) + if (typeof message.hostId === "number") + object.hostId = options.longs === String ? String(message.hostId) : message.hostId; + else + object.hostId = options.longs === String ? $util.Long.prototype.toString.call(message.hostId) : options.longs === Number ? new $util.LongBits(message.hostId.low >>> 0, message.hostId.high >>> 0).toNumber() : message.hostId; + if (message.applicationId != null && message.hasOwnProperty("applicationId")) + if (typeof message.applicationId === "number") + object.applicationId = options.longs === String ? String(message.applicationId) : message.applicationId; + else + object.applicationId = options.longs === String ? $util.Long.prototype.toString.call(message.applicationId) : options.longs === Number ? new $util.LongBits(message.applicationId.low >>> 0, message.applicationId.high >>> 0).toNumber() : message.applicationId; + return object; + }; + + /** + * Converts this DataSourceBackupApplianceApplication to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @instance + * @returns {Object.} JSON object + */ + DataSourceBackupApplianceApplication.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceBackupApplianceApplication + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceBackupApplianceApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceBackupApplianceApplication"; + }; + + return DataSourceBackupApplianceApplication; + })(); + + v1.ServiceLockInfo = (function() { + + /** + * Properties of a ServiceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IServiceLockInfo + * @property {string|null} [operation] ServiceLockInfo operation + */ + + /** + * Constructs a new ServiceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ServiceLockInfo. + * @implements IServiceLockInfo + * @constructor + * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set + */ + function ServiceLockInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceLockInfo operation. + * @member {string} operation + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @instance + */ + ServiceLockInfo.prototype.operation = ""; + + /** + * Creates a new ServiceLockInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo instance + */ + ServiceLockInfo.create = function create(properties) { + return new ServiceLockInfo(properties); + }; + + /** + * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLockInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); + return writer; + }; + + /** + * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLockInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.operation = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceLockInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceLockInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceLockInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.operation != null && message.hasOwnProperty("operation")) + if (!$util.isString(message.operation)) + return "operation: string expected"; + return null; + }; + + /** + * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo + */ + ServiceLockInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ServiceLockInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); + if (object.operation != null) + message.operation = String(object.operation); + return message; + }; + + /** + * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {google.cloud.backupdr.v1.ServiceLockInfo} message ServiceLockInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceLockInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.operation = ""; + if (message.operation != null && message.hasOwnProperty("operation")) + object.operation = message.operation; + return object; + }; + + /** + * Converts this ServiceLockInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @instance + * @returns {Object.} JSON object + */ + ServiceLockInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceLockInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ServiceLockInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceLockInfo"; + }; + + return ServiceLockInfo; + })(); + + v1.BackupApplianceLockInfo = (function() { + + /** + * Properties of a BackupApplianceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceLockInfo + * @property {number|Long|null} [backupApplianceId] BackupApplianceLockInfo backupApplianceId + * @property {string|null} [backupApplianceName] BackupApplianceLockInfo backupApplianceName + * @property {string|null} [lockReason] BackupApplianceLockInfo lockReason + * @property {string|null} [jobName] BackupApplianceLockInfo jobName + * @property {string|null} [backupImage] BackupApplianceLockInfo backupImage + * @property {number|Long|null} [slaId] BackupApplianceLockInfo slaId + */ + + /** + * Constructs a new BackupApplianceLockInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceLockInfo. + * @implements IBackupApplianceLockInfo + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set + */ + function BackupApplianceLockInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupApplianceLockInfo backupApplianceId. + * @member {number|Long} backupApplianceId + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * BackupApplianceLockInfo backupApplianceName. + * @member {string} backupApplianceName + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupApplianceName = ""; + + /** + * BackupApplianceLockInfo lockReason. + * @member {string} lockReason + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.lockReason = ""; + + /** + * BackupApplianceLockInfo jobName. + * @member {string|null|undefined} jobName + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.jobName = null; + + /** + * BackupApplianceLockInfo backupImage. + * @member {string|null|undefined} backupImage + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.backupImage = null; + + /** + * BackupApplianceLockInfo slaId. + * @member {number|Long|null|undefined} slaId + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + BackupApplianceLockInfo.prototype.slaId = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupApplianceLockInfo lockSource. + * @member {"jobName"|"backupImage"|"slaId"|undefined} lockSource + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + */ + Object.defineProperty(BackupApplianceLockInfo.prototype, "lockSource", { + get: $util.oneOfGetter($oneOfFields = ["jobName", "backupImage", "slaId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupApplianceLockInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo instance + */ + BackupApplianceLockInfo.create = function create(properties) { + return new BackupApplianceLockInfo(properties); + }; + + /** + * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceLockInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.backupApplianceId); + if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupApplianceName); + if (message.lockReason != null && Object.hasOwnProperty.call(message, "lockReason")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.lockReason); + if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.jobName); + if (message.backupImage != null && Object.hasOwnProperty.call(message, "backupImage")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.backupImage); + if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.slaId); + return writer; + }; + + /** + * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceLockInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupApplianceId = reader.int64(); + break; + } + case 2: { + message.backupApplianceName = reader.string(); + break; + } + case 5: { + message.lockReason = reader.string(); + break; + } + case 6: { + message.jobName = reader.string(); + break; + } + case 7: { + message.backupImage = reader.string(); + break; + } + case 8: { + message.slaId = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceLockInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceLockInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceLockInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) + return "backupApplianceId: integer|Long expected"; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + if (!$util.isString(message.backupApplianceName)) + return "backupApplianceName: string expected"; + if (message.lockReason != null && message.hasOwnProperty("lockReason")) + if (!$util.isString(message.lockReason)) + return "lockReason: string expected"; + if (message.jobName != null && message.hasOwnProperty("jobName")) { + properties.lockSource = 1; + if (!$util.isString(message.jobName)) + return "jobName: string expected"; + } + if (message.backupImage != null && message.hasOwnProperty("backupImage")) { + if (properties.lockSource === 1) + return "lockSource: multiple values"; + properties.lockSource = 1; + if (!$util.isString(message.backupImage)) + return "backupImage: string expected"; + } + if (message.slaId != null && message.hasOwnProperty("slaId")) { + if (properties.lockSource === 1) + return "lockSource: multiple values"; + properties.lockSource = 1; + if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) + return "slaId: integer|Long expected"; + } + return null; + }; + + /** + * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo + */ + BackupApplianceLockInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceLockInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); + if (object.backupApplianceId != null) + if ($util.Long) + (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; + else if (typeof object.backupApplianceId === "string") + message.backupApplianceId = parseInt(object.backupApplianceId, 10); + else if (typeof object.backupApplianceId === "number") + message.backupApplianceId = object.backupApplianceId; + else if (typeof object.backupApplianceId === "object") + message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); + if (object.backupApplianceName != null) + message.backupApplianceName = String(object.backupApplianceName); + if (object.lockReason != null) + message.lockReason = String(object.lockReason); + if (object.jobName != null) + message.jobName = String(object.jobName); + if (object.backupImage != null) + message.backupImage = String(object.backupImage); + if (object.slaId != null) + if ($util.Long) + (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; + else if (typeof object.slaId === "string") + message.slaId = parseInt(object.slaId, 10); + else if (typeof object.slaId === "number") + message.slaId = object.slaId; + else if (typeof object.slaId === "object") + message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceLockInfo} message BackupApplianceLockInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceLockInfo.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.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.backupApplianceId = options.longs === String ? "0" : 0; + object.backupApplianceName = ""; + object.lockReason = ""; + } + if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) + if (typeof message.backupApplianceId === "number") + object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; + else + object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; + if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) + object.backupApplianceName = message.backupApplianceName; + if (message.lockReason != null && message.hasOwnProperty("lockReason")) + object.lockReason = message.lockReason; + if (message.jobName != null && message.hasOwnProperty("jobName")) { + object.jobName = message.jobName; + if (options.oneofs) + object.lockSource = "jobName"; + } + if (message.backupImage != null && message.hasOwnProperty("backupImage")) { + object.backupImage = message.backupImage; + if (options.oneofs) + object.lockSource = "backupImage"; + } + if (message.slaId != null && message.hasOwnProperty("slaId")) { + if (typeof message.slaId === "number") + object.slaId = options.longs === String ? String(message.slaId) : message.slaId; + else + object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; + if (options.oneofs) + object.lockSource = "slaId"; + } + return object; + }; + + /** + * Converts this BackupApplianceLockInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceLockInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceLockInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceLockInfo"; + }; + + return BackupApplianceLockInfo; + })(); + + v1.BackupLock = (function() { + + /** + * Properties of a BackupLock. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupLock + * @property {google.protobuf.ITimestamp|null} [lockUntilTime] BackupLock lockUntilTime + * @property {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null} [backupApplianceLockInfo] BackupLock backupApplianceLockInfo + * @property {google.cloud.backupdr.v1.IServiceLockInfo|null} [serviceLockInfo] BackupLock serviceLockInfo + */ + + /** + * Constructs a new BackupLock. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupLock. + * @implements IBackupLock + * @constructor + * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set + */ + function BackupLock(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupLock lockUntilTime. + * @member {google.protobuf.ITimestamp|null|undefined} lockUntilTime + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.lockUntilTime = null; + + /** + * BackupLock backupApplianceLockInfo. + * @member {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null|undefined} backupApplianceLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.backupApplianceLockInfo = null; + + /** + * BackupLock serviceLockInfo. + * @member {google.cloud.backupdr.v1.IServiceLockInfo|null|undefined} serviceLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + BackupLock.prototype.serviceLockInfo = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupLock ClientLockInfo. + * @member {"backupApplianceLockInfo"|"serviceLockInfo"|undefined} ClientLockInfo + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + */ + Object.defineProperty(BackupLock.prototype, "ClientLockInfo", { + get: $util.oneOfGetter($oneOfFields = ["backupApplianceLockInfo", "serviceLockInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupLock instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock instance + */ + BackupLock.create = function create(properties) { + return new BackupLock(properties); + }; + + /** + * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLock.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lockUntilTime != null && Object.hasOwnProperty.call(message, "lockUntilTime")) + $root.google.protobuf.Timestamp.encode(message.lockUntilTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backupApplianceLockInfo != null && Object.hasOwnProperty.call(message, "backupApplianceLockInfo")) + $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.encode(message.backupApplianceLockInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.serviceLockInfo != null && Object.hasOwnProperty.call(message, "serviceLockInfo")) + $root.google.cloud.backupdr.v1.ServiceLockInfo.encode(message.serviceLockInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLock.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupLock message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLock.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLock(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lockUntilTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.decode(reader, reader.uint32()); + break; + } + case 4: { + message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupLock message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLock.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupLock message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupLock.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lockUntilTime); + if (error) + return "lockUntilTime." + error; + } + if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { + properties.ClientLockInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.verify(message.backupApplianceLockInfo); + if (error) + return "backupApplianceLockInfo." + error; + } + } + if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { + if (properties.ClientLockInfo === 1) + return "ClientLockInfo: multiple values"; + properties.ClientLockInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.ServiceLockInfo.verify(message.serviceLockInfo); + if (error) + return "serviceLockInfo." + error; + } + } + return null; + }; + + /** + * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock + */ + BackupLock.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupLock) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupLock(); + if (object.lockUntilTime != null) { + if (typeof object.lockUntilTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.lockUntilTime: object expected"); + message.lockUntilTime = $root.google.protobuf.Timestamp.fromObject(object.lockUntilTime); + } + if (object.backupApplianceLockInfo != null) { + if (typeof object.backupApplianceLockInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.backupApplianceLockInfo: object expected"); + message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.fromObject(object.backupApplianceLockInfo); + } + if (object.serviceLockInfo != null) { + if (typeof object.serviceLockInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupLock.serviceLockInfo: object expected"); + message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.fromObject(object.serviceLockInfo); + } + return message; + }; + + /** + * Creates a plain object from a BackupLock message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {google.cloud.backupdr.v1.BackupLock} message BackupLock + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupLock.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.lockUntilTime = null; + if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) + object.lockUntilTime = $root.google.protobuf.Timestamp.toObject(message.lockUntilTime, options); + if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { + object.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.toObject(message.backupApplianceLockInfo, options); + if (options.oneofs) + object.ClientLockInfo = "backupApplianceLockInfo"; + } + if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { + object.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.toObject(message.serviceLockInfo, options); + if (options.oneofs) + object.ClientLockInfo = "serviceLockInfo"; + } + return object; + }; + + /** + * Converts this BackupLock to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupLock + * @instance + * @returns {Object.} JSON object + */ + BackupLock.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupLock + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupLock + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupLock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLock"; + }; + + return BackupLock; + })(); + + v1.Backup = (function() { + + /** + * Properties of a Backup. + * @memberof google.cloud.backupdr.v1 + * @interface IBackup + * @property {string|null} [name] Backup name + * @property {string|null} [description] Backup description + * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime + * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime + * @property {Object.|null} [labels] Backup labels + * @property {google.protobuf.ITimestamp|null} [enforcedRetentionEndTime] Backup enforcedRetentionEndTime + * @property {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null} [backupRetentionInheritance] Backup backupRetentionInheritance + * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime + * @property {google.protobuf.ITimestamp|null} [consistencyTime] Backup consistencyTime + * @property {string|null} [etag] Backup etag + * @property {google.cloud.backupdr.v1.Backup.State|null} [state] Backup state + * @property {Array.|null} [serviceLocks] Backup serviceLocks + * @property {Array.|null} [backupApplianceLocks] Backup backupApplianceLocks + * @property {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null} [computeInstanceBackupProperties] Backup computeInstanceBackupProperties + * @property {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null} [cloudSqlInstanceBackupProperties] Backup cloudSqlInstanceBackupProperties + * @property {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null} [backupApplianceBackupProperties] Backup backupApplianceBackupProperties + * @property {google.cloud.backupdr.v1.IDiskBackupProperties|null} [diskBackupProperties] Backup diskBackupProperties + * @property {google.cloud.backupdr.v1.Backup.BackupType|null} [backupType] Backup backupType + * @property {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null} [gcpBackupPlanInfo] Backup gcpBackupPlanInfo + * @property {number|Long|null} [resourceSizeBytes] Backup resourceSizeBytes + * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs + * @property {boolean|null} [satisfiesPzi] Backup satisfiesPzi + * @property {google.cloud.backupdr.v1.IBackupGcpResource|null} [gcpResource] Backup gcpResource + * @property {Array.|null} [kmsKeyVersions] Backup kmsKeyVersions + */ + + /** + * Constructs a new Backup. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Backup. + * @implements IBackup + * @constructor + * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set + */ + function Backup(properties) { + this.labels = {}; + this.serviceLocks = []; + this.backupApplianceLocks = []; + this.kmsKeyVersions = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Backup name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.name = ""; + + /** + * Backup description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.description = null; + + /** + * Backup createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.createTime = null; + + /** + * Backup updateTime. + * @member {google.protobuf.ITimestamp|null|undefined} updateTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.updateTime = null; + + /** + * Backup labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.labels = $util.emptyObject; + + /** + * Backup enforcedRetentionEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} enforcedRetentionEndTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.enforcedRetentionEndTime = null; + + /** + * Backup backupRetentionInheritance. + * @member {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null|undefined} backupRetentionInheritance + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupRetentionInheritance = null; + + /** + * Backup expireTime. + * @member {google.protobuf.ITimestamp|null|undefined} expireTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.expireTime = null; + + /** + * Backup consistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} consistencyTime + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.consistencyTime = null; + + /** + * Backup etag. + * @member {string|null|undefined} etag + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.etag = null; + + /** + * Backup state. + * @member {google.cloud.backupdr.v1.Backup.State} state + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.state = 0; + + /** + * Backup serviceLocks. + * @member {Array.} serviceLocks + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.serviceLocks = $util.emptyArray; + + /** + * Backup backupApplianceLocks. + * @member {Array.} backupApplianceLocks + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupApplianceLocks = $util.emptyArray; + + /** + * Backup computeInstanceBackupProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null|undefined} computeInstanceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.computeInstanceBackupProperties = null; + + /** + * Backup cloudSqlInstanceBackupProperties. + * @member {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null|undefined} cloudSqlInstanceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.cloudSqlInstanceBackupProperties = null; + + /** + * Backup backupApplianceBackupProperties. + * @member {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null|undefined} backupApplianceBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupApplianceBackupProperties = null; + + /** + * Backup diskBackupProperties. + * @member {google.cloud.backupdr.v1.IDiskBackupProperties|null|undefined} diskBackupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.diskBackupProperties = null; + + /** + * Backup backupType. + * @member {google.cloud.backupdr.v1.Backup.BackupType} backupType + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.backupType = 0; + + /** + * Backup gcpBackupPlanInfo. + * @member {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null|undefined} gcpBackupPlanInfo + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.gcpBackupPlanInfo = null; + + /** + * Backup resourceSizeBytes. + * @member {number|Long} resourceSizeBytes + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.resourceSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Backup satisfiesPzs. + * @member {boolean|null|undefined} satisfiesPzs + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.satisfiesPzs = null; + + /** + * Backup satisfiesPzi. + * @member {boolean|null|undefined} satisfiesPzi + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.satisfiesPzi = null; + + /** + * Backup gcpResource. + * @member {google.cloud.backupdr.v1.IBackupGcpResource|null|undefined} gcpResource + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.gcpResource = null; + + /** + * Backup kmsKeyVersions. + * @member {Array.} kmsKeyVersions + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Backup.prototype.kmsKeyVersions = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_createTime", { + get: $util.oneOfGetter($oneOfFields = ["createTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_updateTime", { + get: $util.oneOfGetter($oneOfFields = ["updateTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_enforcedRetentionEndTime", { + get: $util.oneOfGetter($oneOfFields = ["enforcedRetentionEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_backupRetentionInheritance", { + get: $util.oneOfGetter($oneOfFields = ["backupRetentionInheritance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_expireTime", { + get: $util.oneOfGetter($oneOfFields = ["expireTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_consistencyTime", { + get: $util.oneOfGetter($oneOfFields = ["consistencyTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_etag", { + get: $util.oneOfGetter($oneOfFields = ["etag"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup backupProperties. + * @member {"computeInstanceBackupProperties"|"cloudSqlInstanceBackupProperties"|"backupApplianceBackupProperties"|"diskBackupProperties"|undefined} backupProperties + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "backupProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceBackupProperties", "cloudSqlInstanceBackupProperties", "backupApplianceBackupProperties", "diskBackupProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup planInfo. + * @member {"gcpBackupPlanInfo"|undefined} planInfo + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "planInfo", { + get: $util.oneOfGetter($oneOfFields = ["gcpBackupPlanInfo"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_satisfiesPzs", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Backup.prototype, "_satisfiesPzi", { + get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Backup sourceResource. + * @member {"gcpResource"|undefined} sourceResource + * @memberof google.cloud.backupdr.v1.Backup + * @instance + */ + Object.defineProperty(Backup.prototype, "sourceResource", { + get: $util.oneOfGetter($oneOfFields = ["gcpResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Backup instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Backup} Backup instance + */ + Backup.create = function create(properties) { + return new Backup(properties); + }; + + /** + * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) + $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) + for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.enforcedRetentionEndTime != null && Object.hasOwnProperty.call(message, "enforcedRetentionEndTime")) + $root.google.protobuf.Timestamp.encode(message.enforcedRetentionEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) + $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.consistencyTime != null && Object.hasOwnProperty.call(message, "consistencyTime")) + $root.google.protobuf.Timestamp.encode(message.consistencyTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); + if (message.serviceLocks != null && message.serviceLocks.length) + for (var i = 0; i < message.serviceLocks.length; ++i) + $root.google.cloud.backupdr.v1.BackupLock.encode(message.serviceLocks[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.backupApplianceLocks != null && message.backupApplianceLocks.length) + for (var i = 0; i < message.backupApplianceLocks.length; ++i) + $root.google.cloud.backupdr.v1.BackupLock.encode(message.backupApplianceLocks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.computeInstanceBackupProperties != null && Object.hasOwnProperty.call(message, "computeInstanceBackupProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.encode(message.computeInstanceBackupProperties, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.backupType); + if (message.backupApplianceBackupProperties != null && Object.hasOwnProperty.call(message, "backupApplianceBackupProperties")) + $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.encode(message.backupApplianceBackupProperties, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.gcpBackupPlanInfo != null && Object.hasOwnProperty.call(message, "gcpBackupPlanInfo")) + $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.encode(message.gcpBackupPlanInfo, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); + if (message.resourceSizeBytes != null && Object.hasOwnProperty.call(message, "resourceSizeBytes")) + writer.uint32(/* id 23, wireType 0 =*/184).int64(message.resourceSizeBytes); + if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) + writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); + if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) + writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzi); + if (message.cloudSqlInstanceBackupProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceBackupProperties")) + $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.encode(message.cloudSqlInstanceBackupProperties, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + if (message.diskBackupProperties != null && Object.hasOwnProperty.call(message, "diskBackupProperties")) + $root.google.cloud.backupdr.v1.DiskBackupProperties.encode(message.diskBackupProperties, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); + if (message.backupRetentionInheritance != null && Object.hasOwnProperty.call(message, "backupRetentionInheritance")) + writer.uint32(/* id 30, wireType 0 =*/240).int32(message.backupRetentionInheritance); + if (message.gcpResource != null && Object.hasOwnProperty.call(message, "gcpResource")) + $root.google.cloud.backupdr.v1.BackupGcpResource.encode(message.gcpResource, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); + if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + writer.uint32(/* id 33, wireType 2 =*/266).string(message.kmsKeyVersions[i]); + return writer; + }; + + /** + * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Backup.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Backup message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 5: { + if (message.labels === $util.emptyObject) + message.labels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.labels[key] = value; + break; + } + case 6: { + message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 30: { + message.backupRetentionInheritance = reader.int32(); + break; + } + case 7: { + message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 9: { + message.consistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 11: { + message.etag = reader.string(); + break; + } + case 15: { + message.state = reader.int32(); + break; + } + case 17: { + if (!(message.serviceLocks && message.serviceLocks.length)) + message.serviceLocks = []; + message.serviceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); + break; + } + case 18: { + if (!(message.backupApplianceLocks && message.backupApplianceLocks.length)) + message.backupApplianceLocks = []; + message.backupApplianceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); + break; + } + case 19: { + message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 26: { + message.cloudSqlInstanceBackupProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 21: { + message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.decode(reader, reader.uint32()); + break; + } + case 28: { + message.diskBackupProperties = $root.google.cloud.backupdr.v1.DiskBackupProperties.decode(reader, reader.uint32()); + break; + } + case 20: { + message.backupType = reader.int32(); + break; + } + case 22: { + message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.decode(reader, reader.uint32()); + break; + } + case 23: { + message.resourceSizeBytes = reader.int64(); + break; + } + case 24: { + message.satisfiesPzs = reader.bool(); + break; + } + case 25: { + message.satisfiesPzi = reader.bool(); + break; + } + case 31: { + message.gcpResource = $root.google.cloud.backupdr.v1.BackupGcpResource.decode(reader, reader.uint32()); + break; + } + case 33: { + if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) + message.kmsKeyVersions = []; + message.kmsKeyVersions.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Backup message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Backup} Backup + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Backup.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Backup message. + * @function verify + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Backup.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")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + properties._createTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.createTime); + if (error) + return "createTime." + error; + } + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + properties._updateTime = 1; + { + 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.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { + properties._enforcedRetentionEndTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.enforcedRetentionEndTime); + if (error) + return "enforcedRetentionEndTime." + error; + } + } + if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { + properties._backupRetentionInheritance = 1; + switch (message.backupRetentionInheritance) { + default: + return "backupRetentionInheritance: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + properties._expireTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.expireTime); + if (error) + return "expireTime." + error; + } + } + if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { + properties._consistencyTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.consistencyTime); + if (error) + return "consistencyTime." + error; + } + } + if (message.etag != null && message.hasOwnProperty("etag")) { + properties._etag = 1; + if (!$util.isString(message.etag)) + return "etag: 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.serviceLocks != null && message.hasOwnProperty("serviceLocks")) { + if (!Array.isArray(message.serviceLocks)) + return "serviceLocks: array expected"; + for (var i = 0; i < message.serviceLocks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.serviceLocks[i]); + if (error) + return "serviceLocks." + error; + } + } + if (message.backupApplianceLocks != null && message.hasOwnProperty("backupApplianceLocks")) { + if (!Array.isArray(message.backupApplianceLocks)) + return "backupApplianceLocks: array expected"; + for (var i = 0; i < message.backupApplianceLocks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.backupApplianceLocks[i]); + if (error) + return "backupApplianceLocks." + error; + } + } + if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify(message.computeInstanceBackupProperties); + if (error) + return "computeInstanceBackupProperties." + error; + } + } + if (message.cloudSqlInstanceBackupProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupProperties")) { + if (properties.backupProperties === 1) + return "backupProperties: multiple values"; + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify(message.cloudSqlInstanceBackupProperties); + if (error) + return "cloudSqlInstanceBackupProperties." + error; + } + } + if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { + if (properties.backupProperties === 1) + return "backupProperties: multiple values"; + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify(message.backupApplianceBackupProperties); + if (error) + return "backupApplianceBackupProperties." + error; + } + } + if (message.diskBackupProperties != null && message.hasOwnProperty("diskBackupProperties")) { + if (properties.backupProperties === 1) + return "backupProperties: multiple values"; + properties.backupProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.DiskBackupProperties.verify(message.diskBackupProperties); + if (error) + return "diskBackupProperties." + error; + } + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + switch (message.backupType) { + default: + return "backupType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { + properties.planInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify(message.gcpBackupPlanInfo); + if (error) + return "gcpBackupPlanInfo." + error; + } + } + if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) + if (!$util.isInteger(message.resourceSizeBytes) && !(message.resourceSizeBytes && $util.isInteger(message.resourceSizeBytes.low) && $util.isInteger(message.resourceSizeBytes.high))) + return "resourceSizeBytes: integer|Long expected"; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + properties._satisfiesPzs = 1; + if (typeof message.satisfiesPzs !== "boolean") + return "satisfiesPzs: boolean expected"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + properties._satisfiesPzi = 1; + if (typeof message.satisfiesPzi !== "boolean") + return "satisfiesPzi: boolean expected"; + } + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + properties.sourceResource = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupGcpResource.verify(message.gcpResource); + if (error) + return "gcpResource." + error; + } + } + if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { + if (!Array.isArray(message.kmsKeyVersions)) + return "kmsKeyVersions: array expected"; + for (var i = 0; i < message.kmsKeyVersions.length; ++i) + if (!$util.isString(message.kmsKeyVersions[i])) + return "kmsKeyVersions: string[] expected"; + } + return null; + }; + + /** + * Creates a Backup message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Backup} Backup + */ + Backup.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Backup) + return object; + var message = new $root.google.cloud.backupdr.v1.Backup(); + 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.backupdr.v1.Backup.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.backupdr.v1.Backup.updateTime: object expected"); + message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.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.enforcedRetentionEndTime != null) { + if (typeof object.enforcedRetentionEndTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.enforcedRetentionEndTime: object expected"); + message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.fromObject(object.enforcedRetentionEndTime); + } + switch (object.backupRetentionInheritance) { + default: + if (typeof object.backupRetentionInheritance === "number") { + message.backupRetentionInheritance = object.backupRetentionInheritance; + break; + } + break; + case "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED": + case 0: + message.backupRetentionInheritance = 0; + break; + case "INHERIT_VAULT_RETENTION": + case 1: + message.backupRetentionInheritance = 1; + break; + case "MATCH_BACKUP_EXPIRE_TIME": + case 2: + message.backupRetentionInheritance = 2; + break; + } + if (object.expireTime != null) { + if (typeof object.expireTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.expireTime: object expected"); + message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); + } + if (object.consistencyTime != null) { + if (typeof object.consistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.consistencyTime: object expected"); + message.consistencyTime = $root.google.protobuf.Timestamp.fromObject(object.consistencyTime); + } + if (object.etag != null) + message.etag = String(object.etag); + 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 "DELETING": + case 3: + message.state = 3; + break; + case "ERROR": + case 4: + message.state = 4; + break; + case "UPLOADING": + case 5: + message.state = 5; + break; + } + if (object.serviceLocks) { + if (!Array.isArray(object.serviceLocks)) + throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: array expected"); + message.serviceLocks = []; + for (var i = 0; i < object.serviceLocks.length; ++i) { + if (typeof object.serviceLocks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: object expected"); + message.serviceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.serviceLocks[i]); + } + } + if (object.backupApplianceLocks) { + if (!Array.isArray(object.backupApplianceLocks)) + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: array expected"); + message.backupApplianceLocks = []; + for (var i = 0; i < object.backupApplianceLocks.length; ++i) { + if (typeof object.backupApplianceLocks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: object expected"); + message.backupApplianceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.backupApplianceLocks[i]); + } + } + if (object.computeInstanceBackupProperties != null) { + if (typeof object.computeInstanceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.computeInstanceBackupProperties: object expected"); + message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.fromObject(object.computeInstanceBackupProperties); + } + if (object.cloudSqlInstanceBackupProperties != null) { + if (typeof object.cloudSqlInstanceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.cloudSqlInstanceBackupProperties: object expected"); + message.cloudSqlInstanceBackupProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.fromObject(object.cloudSqlInstanceBackupProperties); + } + if (object.backupApplianceBackupProperties != null) { + if (typeof object.backupApplianceBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceBackupProperties: object expected"); + message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.fromObject(object.backupApplianceBackupProperties); + } + if (object.diskBackupProperties != null) { + if (typeof object.diskBackupProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.diskBackupProperties: object expected"); + message.diskBackupProperties = $root.google.cloud.backupdr.v1.DiskBackupProperties.fromObject(object.diskBackupProperties); + } + switch (object.backupType) { + default: + if (typeof object.backupType === "number") { + message.backupType = object.backupType; + break; + } + break; + case "BACKUP_TYPE_UNSPECIFIED": + case 0: + message.backupType = 0; + break; + case "SCHEDULED": + case 1: + message.backupType = 1; + break; + case "ON_DEMAND": + case 2: + message.backupType = 2; + break; + case "ON_DEMAND_OPERATIONAL": + case 3: + message.backupType = 3; + break; + } + if (object.gcpBackupPlanInfo != null) { + if (typeof object.gcpBackupPlanInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.gcpBackupPlanInfo: object expected"); + message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.fromObject(object.gcpBackupPlanInfo); + } + if (object.resourceSizeBytes != null) + if ($util.Long) + (message.resourceSizeBytes = $util.Long.fromValue(object.resourceSizeBytes)).unsigned = false; + else if (typeof object.resourceSizeBytes === "string") + message.resourceSizeBytes = parseInt(object.resourceSizeBytes, 10); + else if (typeof object.resourceSizeBytes === "number") + message.resourceSizeBytes = object.resourceSizeBytes; + else if (typeof object.resourceSizeBytes === "object") + message.resourceSizeBytes = new $util.LongBits(object.resourceSizeBytes.low >>> 0, object.resourceSizeBytes.high >>> 0).toNumber(); + if (object.satisfiesPzs != null) + message.satisfiesPzs = Boolean(object.satisfiesPzs); + if (object.satisfiesPzi != null) + message.satisfiesPzi = Boolean(object.satisfiesPzi); + if (object.gcpResource != null) { + if (typeof object.gcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.Backup.gcpResource: object expected"); + message.gcpResource = $root.google.cloud.backupdr.v1.BackupGcpResource.fromObject(object.gcpResource); + } + if (object.kmsKeyVersions) { + if (!Array.isArray(object.kmsKeyVersions)) + throw TypeError(".google.cloud.backupdr.v1.Backup.kmsKeyVersions: array expected"); + message.kmsKeyVersions = []; + for (var i = 0; i < object.kmsKeyVersions.length; ++i) + message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); + } + return message; + }; + + /** + * Creates a plain object from a Backup message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {google.cloud.backupdr.v1.Backup} message Backup + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Backup.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.serviceLocks = []; + object.backupApplianceLocks = []; + object.kmsKeyVersions = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (options.defaults) { + object.name = ""; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.backupType = options.enums === String ? "BACKUP_TYPE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.resourceSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.resourceSizeBytes = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.createTime != null && message.hasOwnProperty("createTime")) { + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (options.oneofs) + object._createTime = "createTime"; + } + if (message.updateTime != null && message.hasOwnProperty("updateTime")) { + object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); + if (options.oneofs) + object._updateTime = "updateTime"; + } + 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.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { + object.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.toObject(message.enforcedRetentionEndTime, options); + if (options.oneofs) + object._enforcedRetentionEndTime = "enforcedRetentionEndTime"; + } + if (message.expireTime != null && message.hasOwnProperty("expireTime")) { + object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); + if (options.oneofs) + object._expireTime = "expireTime"; + } + if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { + object.consistencyTime = $root.google.protobuf.Timestamp.toObject(message.consistencyTime, options); + if (options.oneofs) + object._consistencyTime = "consistencyTime"; + } + if (message.etag != null && message.hasOwnProperty("etag")) { + object.etag = message.etag; + if (options.oneofs) + object._etag = "etag"; + } + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.Backup.State[message.state] : message.state; + if (message.serviceLocks && message.serviceLocks.length) { + object.serviceLocks = []; + for (var j = 0; j < message.serviceLocks.length; ++j) + object.serviceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.serviceLocks[j], options); + } + if (message.backupApplianceLocks && message.backupApplianceLocks.length) { + object.backupApplianceLocks = []; + for (var j = 0; j < message.backupApplianceLocks.length; ++j) + object.backupApplianceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.backupApplianceLocks[j], options); + } + if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { + object.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.toObject(message.computeInstanceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "computeInstanceBackupProperties"; + } + if (message.backupType != null && message.hasOwnProperty("backupType")) + object.backupType = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] === undefined ? message.backupType : $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] : message.backupType; + if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { + object.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.toObject(message.backupApplianceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "backupApplianceBackupProperties"; + } + if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { + object.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.toObject(message.gcpBackupPlanInfo, options); + if (options.oneofs) + object.planInfo = "gcpBackupPlanInfo"; + } + if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) + if (typeof message.resourceSizeBytes === "number") + object.resourceSizeBytes = options.longs === String ? String(message.resourceSizeBytes) : message.resourceSizeBytes; + else + object.resourceSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.resourceSizeBytes) : options.longs === Number ? new $util.LongBits(message.resourceSizeBytes.low >>> 0, message.resourceSizeBytes.high >>> 0).toNumber() : message.resourceSizeBytes; + if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { + object.satisfiesPzs = message.satisfiesPzs; + if (options.oneofs) + object._satisfiesPzs = "satisfiesPzs"; + } + if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { + object.satisfiesPzi = message.satisfiesPzi; + if (options.oneofs) + object._satisfiesPzi = "satisfiesPzi"; + } + if (message.cloudSqlInstanceBackupProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupProperties")) { + object.cloudSqlInstanceBackupProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.toObject(message.cloudSqlInstanceBackupProperties, options); + if (options.oneofs) + object.backupProperties = "cloudSqlInstanceBackupProperties"; + } + if (message.diskBackupProperties != null && message.hasOwnProperty("diskBackupProperties")) { + object.diskBackupProperties = $root.google.cloud.backupdr.v1.DiskBackupProperties.toObject(message.diskBackupProperties, options); + if (options.oneofs) + object.backupProperties = "diskBackupProperties"; + } + if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { + object.backupRetentionInheritance = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] === undefined ? message.backupRetentionInheritance : $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] : message.backupRetentionInheritance; + if (options.oneofs) + object._backupRetentionInheritance = "backupRetentionInheritance"; + } + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + object.gcpResource = $root.google.cloud.backupdr.v1.BackupGcpResource.toObject(message.gcpResource, options); + if (options.oneofs) + object.sourceResource = "gcpResource"; + } + if (message.kmsKeyVersions && message.kmsKeyVersions.length) { + object.kmsKeyVersions = []; + for (var j = 0; j < message.kmsKeyVersions.length; ++j) + object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; + } + return object; + }; + + /** + * Converts this Backup to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Backup + * @instance + * @returns {Object.} JSON object + */ + Backup.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Backup + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Backup + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup"; + }; + + /** + * State enum. + * @name google.cloud.backupdr.v1.Backup.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} DELETING=3 DELETING value + * @property {number} ERROR=4 ERROR value + * @property {number} UPLOADING=5 UPLOADING value + */ + Backup.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] = "DELETING"] = 3; + values[valuesById[4] = "ERROR"] = 4; + values[valuesById[5] = "UPLOADING"] = 5; + return values; + })(); + + /** + * BackupType enum. + * @name google.cloud.backupdr.v1.Backup.BackupType + * @enum {number} + * @property {number} BACKUP_TYPE_UNSPECIFIED=0 BACKUP_TYPE_UNSPECIFIED value + * @property {number} SCHEDULED=1 SCHEDULED value + * @property {number} ON_DEMAND=2 ON_DEMAND value + * @property {number} ON_DEMAND_OPERATIONAL=3 ON_DEMAND_OPERATIONAL value + */ + Backup.BackupType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCHEDULED"] = 1; + values[valuesById[2] = "ON_DEMAND"] = 2; + values[valuesById[3] = "ON_DEMAND_OPERATIONAL"] = 3; + return values; + })(); + + Backup.GCPBackupPlanInfo = (function() { + + /** + * Properties of a GCPBackupPlanInfo. + * @memberof google.cloud.backupdr.v1.Backup + * @interface IGCPBackupPlanInfo + * @property {string|null} [backupPlan] GCPBackupPlanInfo backupPlan + * @property {string|null} [backupPlanRuleId] GCPBackupPlanInfo backupPlanRuleId + * @property {string|null} [backupPlanRevisionName] GCPBackupPlanInfo backupPlanRevisionName + * @property {string|null} [backupPlanRevisionId] GCPBackupPlanInfo backupPlanRevisionId + */ + + /** + * Constructs a new GCPBackupPlanInfo. + * @memberof google.cloud.backupdr.v1.Backup + * @classdesc Represents a GCPBackupPlanInfo. + * @implements IGCPBackupPlanInfo + * @constructor + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set + */ + function GCPBackupPlanInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GCPBackupPlanInfo backupPlan. + * @member {string} backupPlan + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlan = ""; + + /** + * GCPBackupPlanInfo backupPlanRuleId. + * @member {string} backupPlanRuleId + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlanRuleId = ""; + + /** + * GCPBackupPlanInfo backupPlanRevisionName. + * @member {string} backupPlanRevisionName + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlanRevisionName = ""; + + /** + * GCPBackupPlanInfo backupPlanRevisionId. + * @member {string} backupPlanRevisionId + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + */ + GCPBackupPlanInfo.prototype.backupPlanRevisionId = ""; + + /** + * Creates a new GCPBackupPlanInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo instance + */ + GCPBackupPlanInfo.create = function create(properties) { + return new GCPBackupPlanInfo(properties); + }; + + /** + * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCPBackupPlanInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); + if (message.backupPlanRuleId != null && Object.hasOwnProperty.call(message, "backupPlanRuleId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanRuleId); + if (message.backupPlanRevisionName != null && Object.hasOwnProperty.call(message, "backupPlanRevisionName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanRevisionName); + if (message.backupPlanRevisionId != null && Object.hasOwnProperty.call(message, "backupPlanRevisionId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlanRevisionId); + return writer; + }; + + /** + * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GCPBackupPlanInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCPBackupPlanInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupPlan = reader.string(); + break; + } + case 2: { + message.backupPlanRuleId = reader.string(); + break; + } + case 3: { + message.backupPlanRevisionName = reader.string(); + break; + } + case 4: { + message.backupPlanRevisionId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GCPBackupPlanInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GCPBackupPlanInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GCPBackupPlanInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + if (!$util.isString(message.backupPlan)) + return "backupPlan: string expected"; + if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) + if (!$util.isString(message.backupPlanRuleId)) + return "backupPlanRuleId: string expected"; + if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) + if (!$util.isString(message.backupPlanRevisionName)) + return "backupPlanRevisionName: string expected"; + if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) + if (!$util.isString(message.backupPlanRevisionId)) + return "backupPlanRevisionId: string expected"; + return null; + }; + + /** + * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo + */ + GCPBackupPlanInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); + if (object.backupPlan != null) + message.backupPlan = String(object.backupPlan); + if (object.backupPlanRuleId != null) + message.backupPlanRuleId = String(object.backupPlanRuleId); + if (object.backupPlanRevisionName != null) + message.backupPlanRevisionName = String(object.backupPlanRevisionName); + if (object.backupPlanRevisionId != null) + message.backupPlanRevisionId = String(object.backupPlanRevisionId); + return message; + }; + + /** + * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} message GCPBackupPlanInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GCPBackupPlanInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.backupPlan = ""; + object.backupPlanRuleId = ""; + object.backupPlanRevisionName = ""; + object.backupPlanRevisionId = ""; + } + if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) + object.backupPlan = message.backupPlan; + if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) + object.backupPlanRuleId = message.backupPlanRuleId; + if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) + object.backupPlanRevisionName = message.backupPlanRevisionName; + if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) + object.backupPlanRevisionId = message.backupPlanRevisionId; + return object; + }; + + /** + * Converts this GCPBackupPlanInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @instance + * @returns {Object.} JSON object + */ + GCPBackupPlanInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GCPBackupPlanInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GCPBackupPlanInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo"; + }; + + return GCPBackupPlanInfo; + })(); + + return Backup; + })(); + + v1.CreateBackupVaultRequest = (function() { + + /** + * Properties of a CreateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface ICreateBackupVaultRequest + * @property {string|null} [parent] CreateBackupVaultRequest parent + * @property {string|null} [backupVaultId] CreateBackupVaultRequest backupVaultId + * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] CreateBackupVaultRequest backupVault + * @property {string|null} [requestId] CreateBackupVaultRequest requestId + * @property {boolean|null} [validateOnly] CreateBackupVaultRequest validateOnly + */ + + /** + * Constructs a new CreateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CreateBackupVaultRequest. + * @implements ICreateBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set + */ + function CreateBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CreateBackupVaultRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.parent = ""; + + /** + * CreateBackupVaultRequest backupVaultId. + * @member {string} backupVaultId + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.backupVaultId = ""; + + /** + * CreateBackupVaultRequest backupVault. + * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.backupVault = null; + + /** + * CreateBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.requestId = ""; + + /** + * CreateBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + */ + CreateBackupVaultRequest.prototype.validateOnly = false; + + /** + * Creates a new CreateBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest instance + */ + CreateBackupVaultRequest.create = function create(properties) { + return new CreateBackupVaultRequest(properties); + }; + + /** + * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupVaultRequest.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.backupVaultId != null && Object.hasOwnProperty.call(message, "backupVaultId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupVaultId); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + return writer; + }; + + /** + * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CreateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupVaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); + 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.backupVaultId = reader.string(); + break; + } + case 3: { + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); + break; + } + case 4: { + message.requestId = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CreateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CreateBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CreateBackupVaultRequest.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.backupVaultId != null && message.hasOwnProperty("backupVaultId")) + if (!$util.isString(message.backupVaultId)) + return "backupVaultId: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); + if (error) + return "backupVault." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + return null; + }; + + /** + * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest + */ + CreateBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.backupVaultId != null) + message.backupVaultId = String(object.backupVaultId); + if (object.backupVault != null) { + if (typeof object.backupVault !== "object") + throw TypeError(".google.cloud.backupdr.v1.CreateBackupVaultRequest.backupVault: object expected"); + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + return message; + }; + + /** + * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.CreateBackupVaultRequest} message CreateBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CreateBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.backupVaultId = ""; + object.backupVault = null; + object.requestId = ""; + object.validateOnly = false; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.backupVaultId != null && message.hasOwnProperty("backupVaultId")) + object.backupVaultId = message.backupVaultId; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + return object; + }; + + /** + * Converts this CreateBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + CreateBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CreateBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CreateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupVaultRequest"; + }; + + return CreateBackupVaultRequest; + })(); + + v1.ListBackupVaultsRequest = (function() { + + /** + * Properties of a ListBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupVaultsRequest + * @property {string|null} [parent] ListBackupVaultsRequest parent + * @property {number|null} [pageSize] ListBackupVaultsRequest pageSize + * @property {string|null} [pageToken] ListBackupVaultsRequest pageToken + * @property {string|null} [filter] ListBackupVaultsRequest filter + * @property {string|null} [orderBy] ListBackupVaultsRequest orderBy + * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] ListBackupVaultsRequest view + */ + + /** + * Constructs a new ListBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupVaultsRequest. + * @implements IListBackupVaultsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set + */ + function ListBackupVaultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupVaultsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.parent = ""; + + /** + * ListBackupVaultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.pageSize = 0; + + /** + * ListBackupVaultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.pageToken = ""; + + /** + * ListBackupVaultsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.filter = ""; + + /** + * ListBackupVaultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.orderBy = ""; + + /** + * ListBackupVaultsRequest view. + * @member {google.cloud.backupdr.v1.BackupVaultView} view + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + */ + ListBackupVaultsRequest.prototype.view = 0; + + /** + * Creates a new ListBackupVaultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest instance + */ + ListBackupVaultsRequest.create = function create(properties) { + return new ListBackupVaultsRequest(properties); + }; + + /** + * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsRequest.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); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); + 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; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupVaultsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupVaultsRequest.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"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest + */ + ListBackupVaultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VAULT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VAULT_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VAULT_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupVaultsRequest} message ListBackupVaultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupVaultsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; + } + 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; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListBackupVaultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupVaultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupVaultsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsRequest"; + }; + + return ListBackupVaultsRequest; + })(); + + v1.ListBackupVaultsResponse = (function() { + + /** + * Properties of a ListBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupVaultsResponse + * @property {Array.|null} [backupVaults] ListBackupVaultsResponse backupVaults + * @property {string|null} [nextPageToken] ListBackupVaultsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupVaultsResponse unreachable + */ + + /** + * Constructs a new ListBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupVaultsResponse. + * @implements IListBackupVaultsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set + */ + function ListBackupVaultsResponse(properties) { + this.backupVaults = []; + 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]]; + } + + /** + * ListBackupVaultsResponse backupVaults. + * @member {Array.} backupVaults + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; + + /** + * ListBackupVaultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupVaultsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + */ + ListBackupVaultsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupVaultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse instance + */ + ListBackupVaultsResponse.create = function create(properties) { + return new ListBackupVaultsResponse(properties); + }; + + /** + * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaults != null && message.backupVaults.length) + for (var i = 0; i < message.backupVaults.length; ++i) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[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 ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupVaults && message.backupVaults.length)) + message.backupVaults = []; + message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.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 ListBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupVaultsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupVaultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { + if (!Array.isArray(message.backupVaults)) + return "backupVaults: array expected"; + for (var i = 0; i < message.backupVaults.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); + if (error) + return "backupVaults." + 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 ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse + */ + ListBackupVaultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); + if (object.backupVaults) { + if (!Array.isArray(object.backupVaults)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: array expected"); + message.backupVaults = []; + for (var i = 0; i < object.backupVaults.length; ++i) { + if (typeof object.backupVaults[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: object expected"); + message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.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 ListBackupVaultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} message ListBackupVaultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupVaultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupVaults = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupVaults && message.backupVaults.length) { + object.backupVaults = []; + for (var j = 0; j < message.backupVaults.length; ++j) + object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[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 ListBackupVaultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupVaultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupVaultsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsResponse"; + }; + + return ListBackupVaultsResponse; + })(); + + v1.FetchUsableBackupVaultsRequest = (function() { + + /** + * Properties of a FetchUsableBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchUsableBackupVaultsRequest + * @property {string|null} [parent] FetchUsableBackupVaultsRequest parent + * @property {number|null} [pageSize] FetchUsableBackupVaultsRequest pageSize + * @property {string|null} [pageToken] FetchUsableBackupVaultsRequest pageToken + * @property {string|null} [filter] FetchUsableBackupVaultsRequest filter + * @property {string|null} [orderBy] FetchUsableBackupVaultsRequest orderBy + */ + + /** + * Constructs a new FetchUsableBackupVaultsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchUsableBackupVaultsRequest. + * @implements IFetchUsableBackupVaultsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set + */ + function FetchUsableBackupVaultsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchUsableBackupVaultsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.parent = ""; + + /** + * FetchUsableBackupVaultsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.pageSize = 0; + + /** + * FetchUsableBackupVaultsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.pageToken = ""; + + /** + * FetchUsableBackupVaultsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.filter = ""; + + /** + * FetchUsableBackupVaultsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + */ + FetchUsableBackupVaultsRequest.prototype.orderBy = ""; + + /** + * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest instance + */ + FetchUsableBackupVaultsRequest.create = function create(properties) { + return new FetchUsableBackupVaultsRequest(properties); + }; + + /** + * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsRequest.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 FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); + 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 FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchUsableBackupVaultsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchUsableBackupVaultsRequest.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 FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest + */ + FetchUsableBackupVaultsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); + 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 FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchUsableBackupVaultsRequest.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 FetchUsableBackupVaultsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @instance + * @returns {Object.} JSON object + */ + FetchUsableBackupVaultsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchUsableBackupVaultsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchUsableBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest"; + }; + + return FetchUsableBackupVaultsRequest; + })(); + + v1.FetchUsableBackupVaultsResponse = (function() { + + /** + * Properties of a FetchUsableBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchUsableBackupVaultsResponse + * @property {Array.|null} [backupVaults] FetchUsableBackupVaultsResponse backupVaults + * @property {string|null} [nextPageToken] FetchUsableBackupVaultsResponse nextPageToken + * @property {Array.|null} [unreachable] FetchUsableBackupVaultsResponse unreachable + */ + + /** + * Constructs a new FetchUsableBackupVaultsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchUsableBackupVaultsResponse. + * @implements IFetchUsableBackupVaultsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set + */ + function FetchUsableBackupVaultsResponse(properties) { + this.backupVaults = []; + 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]]; + } + + /** + * FetchUsableBackupVaultsResponse backupVaults. + * @member {Array.} backupVaults + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; + + /** + * FetchUsableBackupVaultsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.nextPageToken = ""; + + /** + * FetchUsableBackupVaultsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + */ + FetchUsableBackupVaultsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse instance + */ + FetchUsableBackupVaultsResponse.create = function create(properties) { + return new FetchUsableBackupVaultsResponse(properties); + }; + + /** + * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupVaults != null && message.backupVaults.length) + for (var i = 0; i < message.backupVaults.length; ++i) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[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 FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchUsableBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupVaults && message.backupVaults.length)) + message.backupVaults = []; + message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.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 FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchUsableBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchUsableBackupVaultsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchUsableBackupVaultsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { + if (!Array.isArray(message.backupVaults)) + return "backupVaults: array expected"; + for (var i = 0; i < message.backupVaults.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); + if (error) + return "backupVaults." + 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 FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse + */ + FetchUsableBackupVaultsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); + if (object.backupVaults) { + if (!Array.isArray(object.backupVaults)) + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: array expected"); + message.backupVaults = []; + for (var i = 0; i < object.backupVaults.length; ++i) { + if (typeof object.backupVaults[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: object expected"); + message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.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 FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchUsableBackupVaultsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backupVaults = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backupVaults && message.backupVaults.length) { + object.backupVaults = []; + for (var j = 0; j < message.backupVaults.length; ++j) + object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[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 FetchUsableBackupVaultsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @instance + * @returns {Object.} JSON object + */ + FetchUsableBackupVaultsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchUsableBackupVaultsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchUsableBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse"; + }; + + return FetchUsableBackupVaultsResponse; + })(); + + v1.FetchBackupsForResourceTypeRequest = (function() { + + /** + * Properties of a FetchBackupsForResourceTypeRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchBackupsForResourceTypeRequest + * @property {string|null} [parent] FetchBackupsForResourceTypeRequest parent + * @property {string|null} [resourceType] FetchBackupsForResourceTypeRequest resourceType + * @property {number|null} [pageSize] FetchBackupsForResourceTypeRequest pageSize + * @property {string|null} [pageToken] FetchBackupsForResourceTypeRequest pageToken + * @property {string|null} [filter] FetchBackupsForResourceTypeRequest filter + * @property {string|null} [orderBy] FetchBackupsForResourceTypeRequest orderBy + * @property {google.cloud.backupdr.v1.BackupView|null} [view] FetchBackupsForResourceTypeRequest view + */ + + /** + * Constructs a new FetchBackupsForResourceTypeRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchBackupsForResourceTypeRequest. + * @implements IFetchBackupsForResourceTypeRequest + * @constructor + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest=} [properties] Properties to set + */ + function FetchBackupsForResourceTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchBackupsForResourceTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.parent = ""; + + /** + * FetchBackupsForResourceTypeRequest resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.resourceType = ""; + + /** + * FetchBackupsForResourceTypeRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.pageSize = 0; + + /** + * FetchBackupsForResourceTypeRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.pageToken = ""; + + /** + * FetchBackupsForResourceTypeRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.filter = ""; + + /** + * FetchBackupsForResourceTypeRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.orderBy = ""; + + /** + * FetchBackupsForResourceTypeRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + */ + FetchBackupsForResourceTypeRequest.prototype.view = 0; + + /** + * Creates a new FetchBackupsForResourceTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest instance + */ + FetchBackupsForResourceTypeRequest.create = function create(properties) { + return new FetchBackupsForResourceTypeRequest(properties); + }; + + /** + * Encodes the specified FetchBackupsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} message FetchBackupsForResourceTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupsForResourceTypeRequest.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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.view); + return writer; + }; + + /** + * Encodes the specified FetchBackupsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} message FetchBackupsForResourceTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupsForResourceTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupsForResourceTypeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest(); + 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.resourceType = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + case 7: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupsForResourceTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchBackupsForResourceTypeRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchBackupsForResourceTypeRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: 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"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a FetchBackupsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest + */ + FetchBackupsForResourceTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a FetchBackupsForResourceTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} message FetchBackupsForResourceTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchBackupsForResourceTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceType = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + 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; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this FetchBackupsForResourceTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @instance + * @returns {Object.} JSON object + */ + FetchBackupsForResourceTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchBackupsForResourceTypeRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchBackupsForResourceTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest"; + }; + + return FetchBackupsForResourceTypeRequest; + })(); + + v1.FetchBackupsForResourceTypeResponse = (function() { + + /** + * Properties of a FetchBackupsForResourceTypeResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchBackupsForResourceTypeResponse + * @property {Array.|null} [backups] FetchBackupsForResourceTypeResponse backups + * @property {string|null} [nextPageToken] FetchBackupsForResourceTypeResponse nextPageToken + */ + + /** + * Constructs a new FetchBackupsForResourceTypeResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchBackupsForResourceTypeResponse. + * @implements IFetchBackupsForResourceTypeResponse + * @constructor + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse=} [properties] Properties to set + */ + function FetchBackupsForResourceTypeResponse(properties) { + this.backups = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchBackupsForResourceTypeResponse backups. + * @member {Array.} backups + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @instance + */ + FetchBackupsForResourceTypeResponse.prototype.backups = $util.emptyArray; + + /** + * FetchBackupsForResourceTypeResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @instance + */ + FetchBackupsForResourceTypeResponse.prototype.nextPageToken = ""; + + /** + * Creates a new FetchBackupsForResourceTypeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse instance + */ + FetchBackupsForResourceTypeResponse.create = function create(properties) { + return new FetchBackupsForResourceTypeResponse(properties); + }; + + /** + * Encodes the specified FetchBackupsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse} message FetchBackupsForResourceTypeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupsForResourceTypeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.backupdr.v1.Backup.encode(message.backups[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 FetchBackupsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse} message FetchBackupsForResourceTypeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchBackupsForResourceTypeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupsForResourceTypeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchBackupsForResourceTypeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchBackupsForResourceTypeResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchBackupsForResourceTypeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a FetchBackupsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse + */ + FetchBackupsForResourceTypeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a FetchBackupsForResourceTypeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} message FetchBackupsForResourceTypeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchBackupsForResourceTypeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backups = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.backupdr.v1.Backup.toObject(message.backups[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this FetchBackupsForResourceTypeResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @instance + * @returns {Object.} JSON object + */ + FetchBackupsForResourceTypeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchBackupsForResourceTypeResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchBackupsForResourceTypeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse"; + }; + + return FetchBackupsForResourceTypeResponse; + })(); + + v1.GetBackupVaultRequest = (function() { + + /** + * Properties of a GetBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupVaultRequest + * @property {string|null} [name] GetBackupVaultRequest name + * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] GetBackupVaultRequest view + */ + + /** + * Constructs a new GetBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupVaultRequest. + * @implements IGetBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set + */ + function GetBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupVaultRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + */ + GetBackupVaultRequest.prototype.name = ""; + + /** + * GetBackupVaultRequest view. + * @member {google.cloud.backupdr.v1.BackupVaultView} view + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + */ + GetBackupVaultRequest.prototype.view = 0; + + /** + * Creates a new GetBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest instance + */ + GetBackupVaultRequest.create = function create(properties) { + return new GetBackupVaultRequest(properties); + }; + + /** + * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupVaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); + 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.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest + */ + GetBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VAULT_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VAULT_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VAULT_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupVaultRequest} message GetBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupVaultRequest"; + }; + + return GetBackupVaultRequest; + })(); + + v1.UpdateBackupVaultRequest = (function() { + + /** + * Properties of an UpdateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupVaultRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupVaultRequest updateMask + * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] UpdateBackupVaultRequest backupVault + * @property {string|null} [requestId] UpdateBackupVaultRequest requestId + * @property {boolean|null} [validateOnly] UpdateBackupVaultRequest validateOnly + * @property {boolean|null} [force] UpdateBackupVaultRequest force + * @property {boolean|null} [forceUpdateAccessRestriction] UpdateBackupVaultRequest forceUpdateAccessRestriction + */ + + /** + * Constructs a new UpdateBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupVaultRequest. + * @implements IUpdateBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set + */ + function UpdateBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupVaultRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.updateMask = null; + + /** + * UpdateBackupVaultRequest backupVault. + * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.backupVault = null; + + /** + * UpdateBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.requestId = ""; + + /** + * UpdateBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.validateOnly = false; + + /** + * UpdateBackupVaultRequest force. + * @member {boolean} force + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.force = false; + + /** + * UpdateBackupVaultRequest forceUpdateAccessRestriction. + * @member {boolean} forceUpdateAccessRestriction + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + */ + UpdateBackupVaultRequest.prototype.forceUpdateAccessRestriction = false; + + /** + * Creates a new UpdateBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest instance + */ + UpdateBackupVaultRequest.create = function create(properties) { + return new UpdateBackupVaultRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, 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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); + if (message.forceUpdateAccessRestriction != null && Object.hasOwnProperty.call(message, "forceUpdateAccessRestriction")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.forceUpdateAccessRestriction); + return writer; + }; + + /** + * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupVaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.validateOnly = reader.bool(); + break; + } + case 5: { + message.force = reader.bool(); + break; + } + case 6: { + message.forceUpdateAccessRestriction = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backupVault != null && message.hasOwnProperty("backupVault")) { + var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); + if (error) + return "backupVault." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.forceUpdateAccessRestriction != null && message.hasOwnProperty("forceUpdateAccessRestriction")) + if (typeof message.forceUpdateAccessRestriction !== "boolean") + return "forceUpdateAccessRestriction: boolean expected"; + return null; + }; + + /** + * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest + */ + UpdateBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backupVault != null) { + if (typeof object.backupVault !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.backupVault: object expected"); + message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.force != null) + message.force = Boolean(object.force); + if (object.forceUpdateAccessRestriction != null) + message.forceUpdateAccessRestriction = Boolean(object.forceUpdateAccessRestriction); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupVaultRequest} message UpdateBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backupVault = null; + object.requestId = ""; + object.validateOnly = false; + object.force = false; + object.forceUpdateAccessRestriction = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.forceUpdateAccessRestriction != null && message.hasOwnProperty("forceUpdateAccessRestriction")) + object.forceUpdateAccessRestriction = message.forceUpdateAccessRestriction; + return object; + }; + + /** + * Converts this UpdateBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupVaultRequest"; + }; + + return UpdateBackupVaultRequest; + })(); + + v1.DeleteBackupVaultRequest = (function() { + + /** + * Properties of a DeleteBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupVaultRequest + * @property {string|null} [name] DeleteBackupVaultRequest name + * @property {string|null} [requestId] DeleteBackupVaultRequest requestId + * @property {boolean|null} [force] DeleteBackupVaultRequest force + * @property {string|null} [etag] DeleteBackupVaultRequest etag + * @property {boolean|null} [validateOnly] DeleteBackupVaultRequest validateOnly + * @property {boolean|null} [allowMissing] DeleteBackupVaultRequest allowMissing + * @property {boolean|null} [ignoreBackupPlanReferences] DeleteBackupVaultRequest ignoreBackupPlanReferences + */ + + /** + * Constructs a new DeleteBackupVaultRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupVaultRequest. + * @implements IDeleteBackupVaultRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set + */ + function DeleteBackupVaultRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupVaultRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.name = ""; + + /** + * DeleteBackupVaultRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.requestId = ""; + + /** + * DeleteBackupVaultRequest force. + * @member {boolean} force + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.force = false; + + /** + * DeleteBackupVaultRequest etag. + * @member {string} etag + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.etag = ""; + + /** + * DeleteBackupVaultRequest validateOnly. + * @member {boolean} validateOnly + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.validateOnly = false; + + /** + * DeleteBackupVaultRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.allowMissing = false; + + /** + * DeleteBackupVaultRequest ignoreBackupPlanReferences. + * @member {boolean} ignoreBackupPlanReferences + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + */ + DeleteBackupVaultRequest.prototype.ignoreBackupPlanReferences = false; + + /** + * Creates a new DeleteBackupVaultRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest instance + */ + DeleteBackupVaultRequest.create = function create(properties) { + return new DeleteBackupVaultRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupVaultRequest.encode = function encode(message, writer) { + if (!writer) + 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); + if (message.force != null && Object.hasOwnProperty.call(message, "force")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); + if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); + if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); + if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); + if (message.ignoreBackupPlanReferences != null && Object.hasOwnProperty.call(message, "ignoreBackupPlanReferences")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreBackupPlanReferences); + return writer; + }; + + /** + * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupVaultRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); + 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; + } + case 3: { + message.force = reader.bool(); + break; + } + case 4: { + message.etag = reader.string(); + break; + } + case 5: { + message.validateOnly = reader.bool(); + break; + } + case 6: { + message.allowMissing = reader.bool(); + break; + } + case 7: { + message.ignoreBackupPlanReferences = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupVaultRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupVaultRequest.verify = function verify(message) { + if (typeof message !== "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"; + if (message.force != null && message.hasOwnProperty("force")) + if (typeof message.force !== "boolean") + return "force: boolean expected"; + if (message.etag != null && message.hasOwnProperty("etag")) + if (!$util.isString(message.etag)) + return "etag: string expected"; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + if (typeof message.validateOnly !== "boolean") + return "validateOnly: boolean expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + if (message.ignoreBackupPlanReferences != null && message.hasOwnProperty("ignoreBackupPlanReferences")) + if (typeof message.ignoreBackupPlanReferences !== "boolean") + return "ignoreBackupPlanReferences: boolean expected"; + return null; + }; + + /** + * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest + */ + DeleteBackupVaultRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.force != null) + message.force = Boolean(object.force); + if (object.etag != null) + message.etag = String(object.etag); + if (object.validateOnly != null) + message.validateOnly = Boolean(object.validateOnly); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + if (object.ignoreBackupPlanReferences != null) + message.ignoreBackupPlanReferences = Boolean(object.ignoreBackupPlanReferences); + return message; + }; + + /** + * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupVaultRequest} message DeleteBackupVaultRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupVaultRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.requestId = ""; + object.force = false; + object.etag = ""; + object.validateOnly = false; + object.allowMissing = false; + object.ignoreBackupPlanReferences = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.force != null && message.hasOwnProperty("force")) + object.force = message.force; + if (message.etag != null && message.hasOwnProperty("etag")) + object.etag = message.etag; + if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) + object.validateOnly = message.validateOnly; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + if (message.ignoreBackupPlanReferences != null && message.hasOwnProperty("ignoreBackupPlanReferences")) + object.ignoreBackupPlanReferences = message.ignoreBackupPlanReferences; + return object; + }; + + /** + * Converts this DeleteBackupVaultRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupVaultRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupVaultRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupVaultRequest"; + }; + + return DeleteBackupVaultRequest; + })(); + + v1.ListDataSourcesRequest = (function() { + + /** + * Properties of a ListDataSourcesRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourcesRequest + * @property {string|null} [parent] ListDataSourcesRequest parent + * @property {number|null} [pageSize] ListDataSourcesRequest pageSize + * @property {string|null} [pageToken] ListDataSourcesRequest pageToken + * @property {string|null} [filter] ListDataSourcesRequest filter + * @property {string|null} [orderBy] ListDataSourcesRequest orderBy + */ + + /** + * Constructs a new ListDataSourcesRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourcesRequest. + * @implements IListDataSourcesRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set + */ + function ListDataSourcesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourcesRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.parent = ""; + + /** + * ListDataSourcesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageSize = 0; + + /** + * ListDataSourcesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.pageToken = ""; + + /** + * ListDataSourcesRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.filter = ""; + + /** + * ListDataSourcesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + */ + ListDataSourcesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDataSourcesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest instance + */ + ListDataSourcesRequest.create = function create(properties) { + return new ListDataSourcesRequest(properties); + }; + + /** + * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.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 ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); + 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 ListDataSourcesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesRequest.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 ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest + */ + ListDataSourcesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); + 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 ListDataSourcesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {google.cloud.backupdr.v1.ListDataSourcesRequest} message ListDataSourcesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesRequest.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 ListDataSourcesRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesRequest"; + }; + + return ListDataSourcesRequest; + })(); + + v1.ListDataSourcesResponse = (function() { + + /** + * Properties of a ListDataSourcesResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourcesResponse + * @property {Array.|null} [dataSources] ListDataSourcesResponse dataSources + * @property {string|null} [nextPageToken] ListDataSourcesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDataSourcesResponse unreachable + */ + + /** + * Constructs a new ListDataSourcesResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourcesResponse. + * @implements IListDataSourcesResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set + */ + function ListDataSourcesResponse(properties) { + this.dataSources = []; + 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]]; + } + + /** + * ListDataSourcesResponse dataSources. + * @member {Array.} dataSources + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.dataSources = $util.emptyArray; + + /** + * ListDataSourcesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.nextPageToken = ""; + + /** + * ListDataSourcesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + */ + ListDataSourcesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDataSourcesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse instance + */ + ListDataSourcesResponse.create = function create(properties) { + return new ListDataSourcesResponse(properties); + }; + + /** + * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSources != null && message.dataSources.length) + for (var i = 0; i < message.dataSources.length; ++i) + $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSources[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 ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourcesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataSources && message.dataSources.length)) + message.dataSources = []; + message.dataSources.push($root.google.cloud.backupdr.v1.DataSource.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 ListDataSourcesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourcesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourcesResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourcesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSources != null && message.hasOwnProperty("dataSources")) { + if (!Array.isArray(message.dataSources)) + return "dataSources: array expected"; + for (var i = 0; i < message.dataSources.length; ++i) { + var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSources[i]); + if (error) + return "dataSources." + 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 ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse + */ + ListDataSourcesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); + if (object.dataSources) { + if (!Array.isArray(object.dataSources)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: array expected"); + message.dataSources = []; + for (var i = 0; i < object.dataSources.length; ++i) { + if (typeof object.dataSources[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: object expected"); + message.dataSources[i] = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSources[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.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 ListDataSourcesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} message ListDataSourcesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourcesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataSources = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSources && message.dataSources.length) { + object.dataSources = []; + for (var j = 0; j < message.dataSources.length; ++j) + object.dataSources[j] = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSources[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 ListDataSourcesResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSourcesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourcesResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesResponse"; + }; + + return ListDataSourcesResponse; + })(); + + v1.GetDataSourceRequest = (function() { + + /** + * Properties of a GetDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetDataSourceRequest + * @property {string|null} [name] GetDataSourceRequest name + */ + + /** + * Constructs a new GetDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetDataSourceRequest. + * @implements IGetDataSourceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set + */ + function GetDataSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataSourceRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @instance + */ + GetDataSourceRequest.prototype.name = ""; + + /** + * Creates a new GetDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest instance + */ + GetDataSourceRequest.create = function create(properties) { + return new GetDataSourceRequest(properties); + }; + + /** + * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encode = function encode(message, writer) { + 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 GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); + 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 GetDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSourceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSourceRequest.verify = function verify(message) { + if (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 GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest + */ + GetDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetDataSourceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.GetDataSourceRequest} message GetDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSourceRequest.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 GetDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetDataSourceRequest"; + }; + + return GetDataSourceRequest; + })(); + + v1.UpdateDataSourceRequest = (function() { + + /** + * Properties of an UpdateDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateDataSourceRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataSourceRequest updateMask + * @property {google.cloud.backupdr.v1.IDataSource|null} [dataSource] UpdateDataSourceRequest dataSource + * @property {string|null} [requestId] UpdateDataSourceRequest requestId + * @property {boolean|null} [allowMissing] UpdateDataSourceRequest allowMissing + */ + + /** + * Constructs a new UpdateDataSourceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateDataSourceRequest. + * @implements IUpdateDataSourceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set + */ + function UpdateDataSourceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateDataSourceRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.updateMask = null; + + /** + * UpdateDataSourceRequest dataSource. + * @member {google.cloud.backupdr.v1.IDataSource|null|undefined} dataSource + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.dataSource = null; + + /** + * UpdateDataSourceRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.requestId = ""; + + /** + * UpdateDataSourceRequest allowMissing. + * @member {boolean} allowMissing + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + */ + UpdateDataSourceRequest.prototype.allowMissing = false; + + /** + * Creates a new UpdateDataSourceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest instance + */ + UpdateDataSourceRequest.create = function create(properties) { + return new UpdateDataSourceRequest(properties); + }; + + /** + * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSourceRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSource, 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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); + return writer; + }; + + /** + * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSourceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.dataSource = $root.google.cloud.backupdr.v1.DataSource.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + case 4: { + message.allowMissing = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateDataSourceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateDataSourceRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.dataSource != null && message.hasOwnProperty("dataSource")) { + var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSource); + if (error) + return "dataSource." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + if (typeof message.allowMissing !== "boolean") + return "allowMissing: boolean expected"; + return null; + }; + + /** + * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest + */ + UpdateDataSourceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateDataSourceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.dataSource != null) { + if (typeof object.dataSource !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.dataSource: object expected"); + message.dataSource = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSource); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.allowMissing != null) + message.allowMissing = Boolean(object.allowMissing); + return message; + }; + + /** + * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateDataSourceRequest} message UpdateDataSourceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateDataSourceRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.dataSource = null; + object.requestId = ""; + object.allowMissing = false; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSource, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) + object.allowMissing = message.allowMissing; + return object; + }; + + /** + * Converts this UpdateDataSourceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateDataSourceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateDataSourceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateDataSourceRequest"; + }; + + return UpdateDataSourceRequest; + })(); + + v1.ListBackupsRequest = (function() { + + /** + * Properties of a ListBackupsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupsRequest + * @property {string|null} [parent] ListBackupsRequest parent + * @property {number|null} [pageSize] ListBackupsRequest pageSize + * @property {string|null} [pageToken] ListBackupsRequest pageToken + * @property {string|null} [filter] ListBackupsRequest filter + * @property {string|null} [orderBy] ListBackupsRequest orderBy + * @property {google.cloud.backupdr.v1.BackupView|null} [view] ListBackupsRequest view + */ + + /** + * Constructs a new ListBackupsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupsRequest. + * @implements IListBackupsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set + */ + function ListBackupsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListBackupsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.parent = ""; + + /** + * ListBackupsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageSize = 0; + + /** + * ListBackupsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.pageToken = ""; + + /** + * ListBackupsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.filter = ""; + + /** + * ListBackupsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.orderBy = ""; + + /** + * ListBackupsRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + */ + ListBackupsRequest.prototype.view = 0; + + /** + * Creates a new ListBackupsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest instance + */ + ListBackupsRequest.create = function create(properties) { + return new ListBackupsRequest(properties); + }; + + /** + * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.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); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); + return writer; + }; + + /** + * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); + 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; + } + case 6: { + message.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsRequest.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"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest + */ + ListBackupsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); + 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); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {google.cloud.backupdr.v1.ListBackupsRequest} message ListBackupsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; + } + 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; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this ListBackupsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @instance + * @returns {Object.} JSON object + */ + ListBackupsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupsRequest"; + }; + + return ListBackupsRequest; + })(); + + v1.ListBackupsResponse = (function() { + + /** + * Properties of a ListBackupsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListBackupsResponse + * @property {Array.|null} [backups] ListBackupsResponse backups + * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken + * @property {Array.|null} [unreachable] ListBackupsResponse unreachable + */ + + /** + * Constructs a new ListBackupsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListBackupsResponse. + * @implements IListBackupsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set + */ + function ListBackupsResponse(properties) { + this.backups = []; + 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]]; + } + + /** + * ListBackupsResponse backups. + * @member {Array.} backups + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.backups = $util.emptyArray; + + /** + * ListBackupsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.nextPageToken = ""; + + /** + * ListBackupsResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + */ + ListBackupsResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListBackupsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse instance + */ + ListBackupsResponse.create = function create(properties) { + return new ListBackupsResponse(properties); + }; + + /** + * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backups != null && message.backups.length) + for (var i = 0; i < message.backups.length; ++i) + $root.google.cloud.backupdr.v1.Backup.encode(message.backups[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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListBackupsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backups && message.backups.length)) + message.backups = []; + message.backups.push($root.google.cloud.backupdr.v1.Backup.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 ListBackupsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListBackupsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListBackupsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backups != null && message.hasOwnProperty("backups")) { + if (!Array.isArray(message.backups)) + return "backups: array expected"; + for (var i = 0; i < message.backups.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backups[i]); + if (error) + return "backups." + 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 ListBackupsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse + */ + ListBackupsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); + if (object.backups) { + if (!Array.isArray(object.backups)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.backups: array expected"); + message.backups = []; + for (var i = 0; i < object.backups.length; ++i) { + if (typeof object.backups[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.backups: object expected"); + message.backups[i] = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backups[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.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 ListBackupsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {google.cloud.backupdr.v1.ListBackupsResponse} message ListBackupsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListBackupsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.backups = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.backups && message.backups.length) { + object.backups = []; + for (var j = 0; j < message.backups.length; ++j) + object.backups[j] = $root.google.cloud.backupdr.v1.Backup.toObject(message.backups[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 ListBackupsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @instance + * @returns {Object.} JSON object + */ + ListBackupsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListBackupsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListBackupsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupsResponse"; + }; + + return ListBackupsResponse; + })(); + + v1.GetBackupRequest = (function() { + + /** + * Properties of a GetBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetBackupRequest + * @property {string|null} [name] GetBackupRequest name + * @property {google.cloud.backupdr.v1.BackupView|null} [view] GetBackupRequest view + */ + + /** + * Constructs a new GetBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetBackupRequest. + * @implements IGetBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set + */ + function GetBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.name = ""; + + /** + * GetBackupRequest view. + * @member {google.cloud.backupdr.v1.BackupView} view + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + */ + GetBackupRequest.prototype.view = 0; + + /** + * Creates a new GetBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest instance + */ + GetBackupRequest.create = function create(properties) { + return new GetBackupRequest(properties); + }; + + /** + * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.view != null && Object.hasOwnProperty.call(message, "view")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); + return writer; + }; + + /** + * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); + 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.view = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.view != null && message.hasOwnProperty("view")) + switch (message.view) { + default: + return "view: enum value expected"; + case 0: + case 1: + case 2: + break; + } + return null; + }; + + /** + * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest + */ + GetBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); + if (object.name != null) + message.name = String(object.name); + switch (object.view) { + default: + if (typeof object.view === "number") { + message.view = object.view; + break; + } + break; + case "BACKUP_VIEW_UNSPECIFIED": + case 0: + message.view = 0; + break; + case "BACKUP_VIEW_BASIC": + case 1: + message.view = 1; + break; + case "BACKUP_VIEW_FULL": + case 2: + message.view = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {google.cloud.backupdr.v1.GetBackupRequest} message GetBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.view != null && message.hasOwnProperty("view")) + object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; + return object; + }; + + /** + * Converts this GetBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @instance + * @returns {Object.} JSON object + */ + GetBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupRequest"; + }; + + return GetBackupRequest; + })(); + + v1.UpdateBackupRequest = (function() { + + /** + * Properties of an UpdateBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IUpdateBackupRequest + * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask + * @property {google.cloud.backupdr.v1.IBackup|null} [backup] UpdateBackupRequest backup + * @property {string|null} [requestId] UpdateBackupRequest requestId + */ + + /** + * Constructs a new UpdateBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an UpdateBackupRequest. + * @implements IUpdateBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set + */ + function UpdateBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * UpdateBackupRequest updateMask. + * @member {google.protobuf.IFieldMask|null|undefined} updateMask + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.updateMask = null; + + /** + * UpdateBackupRequest backup. + * @member {google.cloud.backupdr.v1.IBackup|null|undefined} backup + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.backup = null; + + /** + * UpdateBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + */ + UpdateBackupRequest.prototype.requestId = ""; + + /** + * Creates a new UpdateBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest instance + */ + UpdateBackupRequest.create = function create(properties) { + return new UpdateBackupRequest(properties); + }; + + /** + * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) + $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) + $root.google.cloud.backupdr.v1.Backup.encode(message.backup, 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 UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + case 2: { + message.backup = $root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32()); + break; + } + case 3: { + message.requestId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UpdateBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UpdateBackupRequest.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.updateMask != null && message.hasOwnProperty("updateMask")) { + var error = $root.google.protobuf.FieldMask.verify(message.updateMask); + if (error) + return "updateMask." + error; + } + if (message.backup != null && message.hasOwnProperty("backup")) { + var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backup); + if (error) + return "backup." + error; + } + if (message.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + return null; + }; + + /** + * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest + */ + UpdateBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); + if (object.updateMask != null) { + if (typeof object.updateMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.updateMask: object expected"); + message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); + } + if (object.backup != null) { + if (typeof object.backup !== "object") + throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.backup: object expected"); + message.backup = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backup); + } + if (object.requestId != null) + message.requestId = String(object.requestId); + return message; + }; + + /** + * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {google.cloud.backupdr.v1.UpdateBackupRequest} message UpdateBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UpdateBackupRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.updateMask = null; + object.backup = null; + object.requestId = ""; + } + if (message.updateMask != null && message.hasOwnProperty("updateMask")) + object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); + if (message.backup != null && message.hasOwnProperty("backup")) + object.backup = $root.google.cloud.backupdr.v1.Backup.toObject(message.backup, options); + if (message.requestId != null && message.hasOwnProperty("requestId")) + object.requestId = message.requestId; + return object; + }; + + /** + * Converts this UpdateBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @instance + * @returns {Object.} JSON object + */ + UpdateBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for UpdateBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.UpdateBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupRequest"; + }; + + return UpdateBackupRequest; + })(); + + v1.DeleteBackupRequest = (function() { + + /** + * Properties of a DeleteBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IDeleteBackupRequest + * @property {string|null} [name] DeleteBackupRequest name + * @property {string|null} [requestId] DeleteBackupRequest requestId + */ + + /** + * Constructs a new DeleteBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DeleteBackupRequest. + * @implements IDeleteBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set + */ + function DeleteBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DeleteBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.name = ""; + + /** + * DeleteBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + */ + DeleteBackupRequest.prototype.requestId = ""; + + /** + * Creates a new DeleteBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest instance + */ + DeleteBackupRequest.create = function create(properties) { + return new DeleteBackupRequest(properties); + }; + + /** + * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encode = function encode(message, writer) { + if (!writer) + 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 DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DeleteBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); + 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 DeleteBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DeleteBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DeleteBackupRequest.verify = function verify(message) { + if (typeof message !== "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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest + */ + DeleteBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); + 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 DeleteBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {google.cloud.backupdr.v1.DeleteBackupRequest} message DeleteBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DeleteBackupRequest.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 DeleteBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @instance + * @returns {Object.} JSON object + */ + DeleteBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DeleteBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DeleteBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupRequest"; + }; + + return DeleteBackupRequest; + })(); + + v1.RestoreBackupRequest = (function() { + + /** + * Properties of a RestoreBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IRestoreBackupRequest + * @property {string|null} [name] RestoreBackupRequest name + * @property {string|null} [requestId] RestoreBackupRequest requestId + * @property {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null} [computeInstanceTargetEnvironment] RestoreBackupRequest computeInstanceTargetEnvironment + * @property {google.cloud.backupdr.v1.IDiskTargetEnvironment|null} [diskTargetEnvironment] RestoreBackupRequest diskTargetEnvironment + * @property {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null} [regionDiskTargetEnvironment] RestoreBackupRequest regionDiskTargetEnvironment + * @property {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null} [computeInstanceRestoreProperties] RestoreBackupRequest computeInstanceRestoreProperties + * @property {google.cloud.backupdr.v1.IDiskRestoreProperties|null} [diskRestoreProperties] RestoreBackupRequest diskRestoreProperties + * @property {google.protobuf.IFieldMask|null} [clearOverridesFieldMask] RestoreBackupRequest clearOverridesFieldMask + */ + + /** + * Constructs a new RestoreBackupRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RestoreBackupRequest. + * @implements IRestoreBackupRequest + * @constructor + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set + */ + function RestoreBackupRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreBackupRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.name = ""; + + /** + * RestoreBackupRequest requestId. + * @member {string} requestId + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.requestId = ""; + + /** + * RestoreBackupRequest computeInstanceTargetEnvironment. + * @member {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null|undefined} computeInstanceTargetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.computeInstanceTargetEnvironment = null; + + /** + * RestoreBackupRequest diskTargetEnvironment. + * @member {google.cloud.backupdr.v1.IDiskTargetEnvironment|null|undefined} diskTargetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.diskTargetEnvironment = null; + + /** + * RestoreBackupRequest regionDiskTargetEnvironment. + * @member {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null|undefined} regionDiskTargetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.regionDiskTargetEnvironment = null; + + /** + * RestoreBackupRequest computeInstanceRestoreProperties. + * @member {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null|undefined} computeInstanceRestoreProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.computeInstanceRestoreProperties = null; + + /** + * RestoreBackupRequest diskRestoreProperties. + * @member {google.cloud.backupdr.v1.IDiskRestoreProperties|null|undefined} diskRestoreProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.diskRestoreProperties = null; + + /** + * RestoreBackupRequest clearOverridesFieldMask. + * @member {google.protobuf.IFieldMask|null|undefined} clearOverridesFieldMask + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + RestoreBackupRequest.prototype.clearOverridesFieldMask = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * RestoreBackupRequest targetEnvironment. + * @member {"computeInstanceTargetEnvironment"|"diskTargetEnvironment"|"regionDiskTargetEnvironment"|undefined} targetEnvironment + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + Object.defineProperty(RestoreBackupRequest.prototype, "targetEnvironment", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceTargetEnvironment", "diskTargetEnvironment", "regionDiskTargetEnvironment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * RestoreBackupRequest instanceProperties. + * @member {"computeInstanceRestoreProperties"|"diskRestoreProperties"|undefined} instanceProperties + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + */ + Object.defineProperty(RestoreBackupRequest.prototype, "instanceProperties", { + get: $util.oneOfGetter($oneOfFields = ["computeInstanceRestoreProperties", "diskRestoreProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(RestoreBackupRequest.prototype, "_clearOverridesFieldMask", { + get: $util.oneOfGetter($oneOfFields = ["clearOverridesFieldMask"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new RestoreBackupRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest instance + */ + RestoreBackupRequest.create = function create(properties) { + return new RestoreBackupRequest(properties); + }; + + /** + * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupRequest.encode = function encode(message, writer) { + if (!writer) + 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); + if (message.computeInstanceTargetEnvironment != null && Object.hasOwnProperty.call(message, "computeInstanceTargetEnvironment")) + $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.encode(message.computeInstanceTargetEnvironment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.computeInstanceRestoreProperties != null && Object.hasOwnProperty.call(message, "computeInstanceRestoreProperties")) + $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.encode(message.computeInstanceRestoreProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.diskTargetEnvironment != null && Object.hasOwnProperty.call(message, "diskTargetEnvironment")) + $root.google.cloud.backupdr.v1.DiskTargetEnvironment.encode(message.diskTargetEnvironment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.regionDiskTargetEnvironment != null && Object.hasOwnProperty.call(message, "regionDiskTargetEnvironment")) + $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.encode(message.regionDiskTargetEnvironment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.diskRestoreProperties != null && Object.hasOwnProperty.call(message, "diskRestoreProperties")) + $root.google.cloud.backupdr.v1.DiskRestoreProperties.encode(message.diskRestoreProperties, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.clearOverridesFieldMask != null && Object.hasOwnProperty.call(message, "clearOverridesFieldMask")) + $root.google.protobuf.FieldMask.encode(message.clearOverridesFieldMask, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); + 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; + } + case 3: { + message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.decode(reader, reader.uint32()); + break; + } + case 5: { + message.diskTargetEnvironment = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.decode(reader, reader.uint32()); + break; + } + case 6: { + message.regionDiskTargetEnvironment = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.decode(reader, reader.uint32()); + break; + } + case 4: { + message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.decode(reader, reader.uint32()); + break; + } + case 7: { + message.diskRestoreProperties = $root.google.cloud.backupdr.v1.DiskRestoreProperties.decode(reader, reader.uint32()); + break; + } + case 8: { + message.clearOverridesFieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreBackupRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreBackupRequest.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.requestId != null && message.hasOwnProperty("requestId")) + if (!$util.isString(message.requestId)) + return "requestId: string expected"; + if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { + properties.targetEnvironment = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify(message.computeInstanceTargetEnvironment); + if (error) + return "computeInstanceTargetEnvironment." + error; + } + } + if (message.diskTargetEnvironment != null && message.hasOwnProperty("diskTargetEnvironment")) { + if (properties.targetEnvironment === 1) + return "targetEnvironment: multiple values"; + properties.targetEnvironment = 1; + { + var error = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.verify(message.diskTargetEnvironment); + if (error) + return "diskTargetEnvironment." + error; + } + } + if (message.regionDiskTargetEnvironment != null && message.hasOwnProperty("regionDiskTargetEnvironment")) { + if (properties.targetEnvironment === 1) + return "targetEnvironment: multiple values"; + properties.targetEnvironment = 1; + { + var error = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify(message.regionDiskTargetEnvironment); + if (error) + return "regionDiskTargetEnvironment." + error; + } + } + if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { + properties.instanceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify(message.computeInstanceRestoreProperties); + if (error) + return "computeInstanceRestoreProperties." + error; + } + } + if (message.diskRestoreProperties != null && message.hasOwnProperty("diskRestoreProperties")) { + if (properties.instanceProperties === 1) + return "instanceProperties: multiple values"; + properties.instanceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.DiskRestoreProperties.verify(message.diskRestoreProperties); + if (error) + return "diskRestoreProperties." + error; + } + } + if (message.clearOverridesFieldMask != null && message.hasOwnProperty("clearOverridesFieldMask")) { + properties._clearOverridesFieldMask = 1; + { + var error = $root.google.protobuf.FieldMask.verify(message.clearOverridesFieldMask); + if (error) + return "clearOverridesFieldMask." + error; + } + } + return null; + }; + + /** + * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest + */ + RestoreBackupRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); + if (object.name != null) + message.name = String(object.name); + if (object.requestId != null) + message.requestId = String(object.requestId); + if (object.computeInstanceTargetEnvironment != null) { + if (typeof object.computeInstanceTargetEnvironment !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceTargetEnvironment: object expected"); + message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.fromObject(object.computeInstanceTargetEnvironment); + } + if (object.diskTargetEnvironment != null) { + if (typeof object.diskTargetEnvironment !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.diskTargetEnvironment: object expected"); + message.diskTargetEnvironment = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.fromObject(object.diskTargetEnvironment); + } + if (object.regionDiskTargetEnvironment != null) { + if (typeof object.regionDiskTargetEnvironment !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.regionDiskTargetEnvironment: object expected"); + message.regionDiskTargetEnvironment = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.fromObject(object.regionDiskTargetEnvironment); + } + if (object.computeInstanceRestoreProperties != null) { + if (typeof object.computeInstanceRestoreProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceRestoreProperties: object expected"); + message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.fromObject(object.computeInstanceRestoreProperties); + } + if (object.diskRestoreProperties != null) { + if (typeof object.diskRestoreProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.diskRestoreProperties: object expected"); + message.diskRestoreProperties = $root.google.cloud.backupdr.v1.DiskRestoreProperties.fromObject(object.diskRestoreProperties); + } + if (object.clearOverridesFieldMask != null) { + if (typeof object.clearOverridesFieldMask !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.clearOverridesFieldMask: object expected"); + message.clearOverridesFieldMask = $root.google.protobuf.FieldMask.fromObject(object.clearOverridesFieldMask); + } + return message; + }; + + /** + * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {google.cloud.backupdr.v1.RestoreBackupRequest} message RestoreBackupRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreBackupRequest.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; + if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { + object.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.toObject(message.computeInstanceTargetEnvironment, options); + if (options.oneofs) + object.targetEnvironment = "computeInstanceTargetEnvironment"; + } + if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { + object.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.toObject(message.computeInstanceRestoreProperties, options); + if (options.oneofs) + object.instanceProperties = "computeInstanceRestoreProperties"; + } + if (message.diskTargetEnvironment != null && message.hasOwnProperty("diskTargetEnvironment")) { + object.diskTargetEnvironment = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.toObject(message.diskTargetEnvironment, options); + if (options.oneofs) + object.targetEnvironment = "diskTargetEnvironment"; + } + if (message.regionDiskTargetEnvironment != null && message.hasOwnProperty("regionDiskTargetEnvironment")) { + object.regionDiskTargetEnvironment = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.toObject(message.regionDiskTargetEnvironment, options); + if (options.oneofs) + object.targetEnvironment = "regionDiskTargetEnvironment"; + } + if (message.diskRestoreProperties != null && message.hasOwnProperty("diskRestoreProperties")) { + object.diskRestoreProperties = $root.google.cloud.backupdr.v1.DiskRestoreProperties.toObject(message.diskRestoreProperties, options); + if (options.oneofs) + object.instanceProperties = "diskRestoreProperties"; + } + if (message.clearOverridesFieldMask != null && message.hasOwnProperty("clearOverridesFieldMask")) { + object.clearOverridesFieldMask = $root.google.protobuf.FieldMask.toObject(message.clearOverridesFieldMask, options); + if (options.oneofs) + object._clearOverridesFieldMask = "clearOverridesFieldMask"; + } + return object; + }; + + /** + * Converts this RestoreBackupRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @instance + * @returns {Object.} JSON object + */ + RestoreBackupRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreBackupRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RestoreBackupRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupRequest"; + }; + + return RestoreBackupRequest; + })(); + + v1.RestoreBackupResponse = (function() { + + /** + * Properties of a RestoreBackupResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IRestoreBackupResponse + * @property {google.cloud.backupdr.v1.ITargetResource|null} [targetResource] RestoreBackupResponse targetResource + */ + + /** + * Constructs a new RestoreBackupResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RestoreBackupResponse. + * @implements IRestoreBackupResponse + * @constructor + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set + */ + function RestoreBackupResponse(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RestoreBackupResponse targetResource. + * @member {google.cloud.backupdr.v1.ITargetResource|null|undefined} targetResource + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @instance + */ + RestoreBackupResponse.prototype.targetResource = null; + + /** + * Creates a new RestoreBackupResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse instance + */ + RestoreBackupResponse.create = function create(properties) { + return new RestoreBackupResponse(properties); + }; + + /** + * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + $root.google.cloud.backupdr.v1.TargetResource.encode(message.targetResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RestoreBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RestoreBackupResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RestoreBackupResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RestoreBackupResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) { + var error = $root.google.cloud.backupdr.v1.TargetResource.verify(message.targetResource); + if (error) + return "targetResource." + error; + } + return null; + }; + + /** + * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse + */ + RestoreBackupResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); + if (object.targetResource != null) { + if (typeof object.targetResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.RestoreBackupResponse.targetResource: object expected"); + message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.fromObject(object.targetResource); + } + return message; + }; + + /** + * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {google.cloud.backupdr.v1.RestoreBackupResponse} message RestoreBackupResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RestoreBackupResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.targetResource = null; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + object.targetResource = $root.google.cloud.backupdr.v1.TargetResource.toObject(message.targetResource, options); + return object; + }; + + /** + * Converts this RestoreBackupResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @instance + * @returns {Object.} JSON object + */ + RestoreBackupResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RestoreBackupResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RestoreBackupResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RestoreBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupResponse"; + }; + + return RestoreBackupResponse; + })(); + + v1.TargetResource = (function() { + + /** + * Properties of a TargetResource. + * @memberof google.cloud.backupdr.v1 + * @interface ITargetResource + * @property {google.cloud.backupdr.v1.IGcpResource|null} [gcpResource] TargetResource gcpResource + */ + + /** + * Constructs a new TargetResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a TargetResource. + * @implements ITargetResource + * @constructor + * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set + */ + function TargetResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * TargetResource gcpResource. + * @member {google.cloud.backupdr.v1.IGcpResource|null|undefined} gcpResource + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + */ + TargetResource.prototype.gcpResource = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * TargetResource targetResourceInfo. + * @member {"gcpResource"|undefined} targetResourceInfo + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + */ + Object.defineProperty(TargetResource.prototype, "targetResourceInfo", { + get: $util.oneOfGetter($oneOfFields = ["gcpResource"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new TargetResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource instance + */ + TargetResource.create = function create(properties) { + return new TargetResource(properties); + }; + + /** + * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResource != null && Object.hasOwnProperty.call(message, "gcpResource")) + $root.google.cloud.backupdr.v1.GcpResource.encode(message.gcpResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + TargetResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a TargetResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TargetResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a TargetResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + TargetResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a TargetResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + TargetResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + properties.targetResourceInfo = 1; + { + var error = $root.google.cloud.backupdr.v1.GcpResource.verify(message.gcpResource); + if (error) + return "gcpResource." + error; + } + } + return null; + }; + + /** + * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource + */ + TargetResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.TargetResource) + return object; + var message = new $root.google.cloud.backupdr.v1.TargetResource(); + if (object.gcpResource != null) { + if (typeof object.gcpResource !== "object") + throw TypeError(".google.cloud.backupdr.v1.TargetResource.gcpResource: object expected"); + message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.fromObject(object.gcpResource); + } + return message; + }; + + /** + * Creates a plain object from a TargetResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {google.cloud.backupdr.v1.TargetResource} message TargetResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + TargetResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { + object.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.toObject(message.gcpResource, options); + if (options.oneofs) + object.targetResourceInfo = "gcpResource"; + } + return object; + }; + + /** + * Converts this TargetResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.TargetResource + * @instance + * @returns {Object.} JSON object + */ + TargetResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for TargetResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.TargetResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + TargetResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.TargetResource"; + }; + + return TargetResource; + })(); + + v1.GcpResource = (function() { + + /** + * Properties of a GcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IGcpResource + * @property {string|null} [gcpResourcename] GcpResource gcpResourcename + * @property {string|null} [location] GcpResource location + * @property {string|null} [type] GcpResource type + */ + + /** + * Constructs a new GcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GcpResource. + * @implements IGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set + */ + function GcpResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.gcpResourcename = ""; + + /** + * GcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.location = ""; + + /** + * GcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + */ + GcpResource.prototype.type = ""; + + /** + * Creates a new GcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource instance + */ + GcpResource.create = function create(properties) { + return new GcpResource(properties); + }; + + /** + * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource + */ + GcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.GcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a GcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {google.cloud.backupdr.v1.GcpResource} message GcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this GcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GcpResource + * @instance + * @returns {Object.} JSON object + */ + GcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpResource"; + }; + + return GcpResource; + })(); + + v1.BackupGcpResource = (function() { + + /** + * Properties of a BackupGcpResource. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupGcpResource + * @property {string|null} [gcpResourcename] BackupGcpResource gcpResourcename + * @property {string|null} [location] BackupGcpResource location + * @property {string|null} [type] BackupGcpResource type + */ + + /** + * Constructs a new BackupGcpResource. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupGcpResource. + * @implements IBackupGcpResource + * @constructor + * @param {google.cloud.backupdr.v1.IBackupGcpResource=} [properties] Properties to set + */ + function BackupGcpResource(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupGcpResource gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @instance + */ + BackupGcpResource.prototype.gcpResourcename = ""; + + /** + * BackupGcpResource location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @instance + */ + BackupGcpResource.prototype.location = ""; + + /** + * BackupGcpResource type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @instance + */ + BackupGcpResource.prototype.type = ""; + + /** + * Creates a new BackupGcpResource instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {google.cloud.backupdr.v1.IBackupGcpResource=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource instance + */ + BackupGcpResource.create = function create(properties) { + return new BackupGcpResource(properties); + }; + + /** + * Encodes the specified BackupGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {google.cloud.backupdr.v1.IBackupGcpResource} message BackupGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupGcpResource.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + return writer; + }; + + /** + * Encodes the specified BackupGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {google.cloud.backupdr.v1.IBackupGcpResource} message BackupGcpResource message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupGcpResource.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupGcpResource message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupGcpResource.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupGcpResource(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.location = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupGcpResource message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupGcpResource.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupGcpResource message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupGcpResource.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + return null; + }; + + /** + * Creates a BackupGcpResource message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource + */ + BackupGcpResource.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupGcpResource) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupGcpResource(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.location != null) + message.location = String(object.location); + if (object.type != null) + message.type = String(object.type); + return message; + }; + + /** + * Creates a plain object from a BackupGcpResource message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {google.cloud.backupdr.v1.BackupGcpResource} message BackupGcpResource + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupGcpResource.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.location = ""; + object.type = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + return object; + }; + + /** + * Converts this BackupGcpResource to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @instance + * @returns {Object.} JSON object + */ + BackupGcpResource.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupGcpResource + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupGcpResource + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupGcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupGcpResource"; + }; + + return BackupGcpResource; + })(); + + /** + * BackupConfigState enum. + * @name google.cloud.backupdr.v1.BackupConfigState + * @enum {number} + * @property {number} BACKUP_CONFIG_STATE_UNSPECIFIED=0 BACKUP_CONFIG_STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} PASSIVE=2 PASSIVE value + */ + v1.BackupConfigState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_CONFIG_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "PASSIVE"] = 2; + return values; + })(); + + /** + * BackupView enum. + * @name google.cloud.backupdr.v1.BackupView + * @enum {number} + * @property {number} BACKUP_VIEW_UNSPECIFIED=0 BACKUP_VIEW_UNSPECIFIED value + * @property {number} BACKUP_VIEW_BASIC=1 BACKUP_VIEW_BASIC value + * @property {number} BACKUP_VIEW_FULL=2 BACKUP_VIEW_FULL value + */ + v1.BackupView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_VIEW_BASIC"] = 1; + values[valuesById[2] = "BACKUP_VIEW_FULL"] = 2; + return values; + })(); + + /** + * BackupVaultView enum. + * @name google.cloud.backupdr.v1.BackupVaultView + * @enum {number} + * @property {number} BACKUP_VAULT_VIEW_UNSPECIFIED=0 BACKUP_VAULT_VIEW_UNSPECIFIED value + * @property {number} BACKUP_VAULT_VIEW_BASIC=1 BACKUP_VAULT_VIEW_BASIC value + * @property {number} BACKUP_VAULT_VIEW_FULL=2 BACKUP_VAULT_VIEW_FULL value + */ + v1.BackupVaultView = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "BACKUP_VAULT_VIEW_UNSPECIFIED"] = 0; + values[valuesById[1] = "BACKUP_VAULT_VIEW_BASIC"] = 1; + values[valuesById[2] = "BACKUP_VAULT_VIEW_FULL"] = 2; + return values; + })(); + + v1.BackupApplianceBackupProperties = (function() { + + /** + * Properties of a BackupApplianceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupApplianceBackupProperties + * @property {number|null} [generationId] BackupApplianceBackupProperties generationId + * @property {google.protobuf.ITimestamp|null} [finalizeTime] BackupApplianceBackupProperties finalizeTime + * @property {google.protobuf.ITimestamp|null} [recoveryRangeStartTime] BackupApplianceBackupProperties recoveryRangeStartTime + * @property {google.protobuf.ITimestamp|null} [recoveryRangeEndTime] BackupApplianceBackupProperties recoveryRangeEndTime + */ + + /** + * Constructs a new BackupApplianceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupApplianceBackupProperties. + * @implements IBackupApplianceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set + */ + function BackupApplianceBackupProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupApplianceBackupProperties generationId. + * @member {number|null|undefined} generationId + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.generationId = null; + + /** + * BackupApplianceBackupProperties finalizeTime. + * @member {google.protobuf.ITimestamp|null|undefined} finalizeTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.finalizeTime = null; + + /** + * BackupApplianceBackupProperties recoveryRangeStartTime. + * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeStartTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.recoveryRangeStartTime = null; + + /** + * BackupApplianceBackupProperties recoveryRangeEndTime. + * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeEndTime + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + */ + BackupApplianceBackupProperties.prototype.recoveryRangeEndTime = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_generationId", { + get: $util.oneOfGetter($oneOfFields = ["generationId"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_finalizeTime", { + get: $util.oneOfGetter($oneOfFields = ["finalizeTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeStartTime", { + get: $util.oneOfGetter($oneOfFields = ["recoveryRangeStartTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeEndTime", { + get: $util.oneOfGetter($oneOfFields = ["recoveryRangeEndTime"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupApplianceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties instance + */ + BackupApplianceBackupProperties.create = function create(properties) { + return new BackupApplianceBackupProperties(properties); + }; + + /** + * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.generationId != null && Object.hasOwnProperty.call(message, "generationId")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.generationId); + if (message.finalizeTime != null && Object.hasOwnProperty.call(message, "finalizeTime")) + $root.google.protobuf.Timestamp.encode(message.finalizeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.recoveryRangeStartTime != null && Object.hasOwnProperty.call(message, "recoveryRangeStartTime")) + $root.google.protobuf.Timestamp.encode(message.recoveryRangeStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.recoveryRangeEndTime != null && Object.hasOwnProperty.call(message, "recoveryRangeEndTime")) + $root.google.protobuf.Timestamp.encode(message.recoveryRangeEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupApplianceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.generationId = reader.int32(); + break; + } + case 2: { + message.finalizeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 3: { + message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupApplianceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupApplianceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupApplianceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.generationId != null && message.hasOwnProperty("generationId")) { + properties._generationId = 1; + if (!$util.isInteger(message.generationId)) + return "generationId: integer expected"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + properties._finalizeTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.finalizeTime); + if (error) + return "finalizeTime." + error; + } + } + if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { + properties._recoveryRangeStartTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeStartTime); + if (error) + return "recoveryRangeStartTime." + error; + } + } + if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { + properties._recoveryRangeEndTime = 1; + { + var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeEndTime); + if (error) + return "recoveryRangeEndTime." + error; + } + } + return null; + }; + + /** + * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties + */ + BackupApplianceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); + if (object.generationId != null) + message.generationId = object.generationId | 0; + if (object.finalizeTime != null) { + if (typeof object.finalizeTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.finalizeTime: object expected"); + message.finalizeTime = $root.google.protobuf.Timestamp.fromObject(object.finalizeTime); + } + if (object.recoveryRangeStartTime != null) { + if (typeof object.recoveryRangeStartTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeStartTime: object expected"); + message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeStartTime); + } + if (object.recoveryRangeEndTime != null) { + if (typeof object.recoveryRangeEndTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeEndTime: object expected"); + message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeEndTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.BackupApplianceBackupProperties} message BackupApplianceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupApplianceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.generationId != null && message.hasOwnProperty("generationId")) { + object.generationId = message.generationId; + if (options.oneofs) + object._generationId = "generationId"; + } + if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { + object.finalizeTime = $root.google.protobuf.Timestamp.toObject(message.finalizeTime, options); + if (options.oneofs) + object._finalizeTime = "finalizeTime"; + } + if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { + object.recoveryRangeStartTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeStartTime, options); + if (options.oneofs) + object._recoveryRangeStartTime = "recoveryRangeStartTime"; + } + if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { + object.recoveryRangeEndTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeEndTime, options); + if (options.oneofs) + object._recoveryRangeEndTime = "recoveryRangeEndTime"; + } + return object; + }; + + /** + * Converts this BackupApplianceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + BackupApplianceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupApplianceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupApplianceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupProperties"; + }; + + return BackupApplianceBackupProperties; + })(); + + v1.DiskTargetEnvironment = (function() { + + /** + * Properties of a DiskTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @interface IDiskTargetEnvironment + * @property {string|null} [project] DiskTargetEnvironment project + * @property {string|null} [zone] DiskTargetEnvironment zone + */ + + /** + * Constructs a new DiskTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DiskTargetEnvironment. + * @implements IDiskTargetEnvironment + * @constructor + * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment=} [properties] Properties to set + */ + function DiskTargetEnvironment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskTargetEnvironment project. + * @member {string} project + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @instance + */ + DiskTargetEnvironment.prototype.project = ""; + + /** + * DiskTargetEnvironment zone. + * @member {string} zone + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @instance + */ + DiskTargetEnvironment.prototype.zone = ""; + + /** + * Creates a new DiskTargetEnvironment instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment instance + */ + DiskTargetEnvironment.create = function create(properties) { + return new DiskTargetEnvironment(properties); + }; + + /** + * Encodes the specified DiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment} message DiskTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTargetEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + return writer; + }; + + /** + * Encodes the specified DiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment} message DiskTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskTargetEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTargetEnvironment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskTargetEnvironment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskTargetEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskTargetEnvironment message. + * @function verify + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskTargetEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a DiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment + */ + DiskTargetEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DiskTargetEnvironment) + return object; + var message = new $root.google.cloud.backupdr.v1.DiskTargetEnvironment(); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a DiskTargetEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.DiskTargetEnvironment} message DiskTargetEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskTargetEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.zone = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + return object; + }; + + /** + * Converts this DiskTargetEnvironment to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @instance + * @returns {Object.} JSON object + */ + DiskTargetEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskTargetEnvironment + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskTargetEnvironment"; + }; + + return DiskTargetEnvironment; + })(); + + v1.RegionDiskTargetEnvironment = (function() { + + /** + * Properties of a RegionDiskTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @interface IRegionDiskTargetEnvironment + * @property {string|null} [project] RegionDiskTargetEnvironment project + * @property {string|null} [region] RegionDiskTargetEnvironment region + * @property {Array.|null} [replicaZones] RegionDiskTargetEnvironment replicaZones + */ + + /** + * Constructs a new RegionDiskTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a RegionDiskTargetEnvironment. + * @implements IRegionDiskTargetEnvironment + * @constructor + * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment=} [properties] Properties to set + */ + function RegionDiskTargetEnvironment(properties) { + this.replicaZones = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * RegionDiskTargetEnvironment project. + * @member {string} project + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @instance + */ + RegionDiskTargetEnvironment.prototype.project = ""; + + /** + * RegionDiskTargetEnvironment region. + * @member {string} region + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @instance + */ + RegionDiskTargetEnvironment.prototype.region = ""; + + /** + * RegionDiskTargetEnvironment replicaZones. + * @member {Array.} replicaZones + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @instance + */ + RegionDiskTargetEnvironment.prototype.replicaZones = $util.emptyArray; + + /** + * Creates a new RegionDiskTargetEnvironment instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment instance + */ + RegionDiskTargetEnvironment.create = function create(properties) { + return new RegionDiskTargetEnvironment(properties); + }; + + /** + * Encodes the specified RegionDiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment} message RegionDiskTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDiskTargetEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); + if (message.replicaZones != null && message.replicaZones.length) + for (var i = 0; i < message.replicaZones.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.replicaZones[i]); + return writer; + }; + + /** + * Encodes the specified RegionDiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment} message RegionDiskTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + RegionDiskTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDiskTargetEnvironment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.region = reader.string(); + break; + } + case 3: { + if (!(message.replicaZones && message.replicaZones.length)) + message.replicaZones = []; + message.replicaZones.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + RegionDiskTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a RegionDiskTargetEnvironment message. + * @function verify + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + RegionDiskTargetEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.region != null && message.hasOwnProperty("region")) + if (!$util.isString(message.region)) + return "region: string expected"; + if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { + if (!Array.isArray(message.replicaZones)) + return "replicaZones: array expected"; + for (var i = 0; i < message.replicaZones.length; ++i) + if (!$util.isString(message.replicaZones[i])) + return "replicaZones: string[] expected"; + } + return null; + }; + + /** + * Creates a RegionDiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment + */ + RegionDiskTargetEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment) + return object; + var message = new $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment(); + if (object.project != null) + message.project = String(object.project); + if (object.region != null) + message.region = String(object.region); + if (object.replicaZones) { + if (!Array.isArray(object.replicaZones)) + throw TypeError(".google.cloud.backupdr.v1.RegionDiskTargetEnvironment.replicaZones: array expected"); + message.replicaZones = []; + for (var i = 0; i < object.replicaZones.length; ++i) + message.replicaZones[i] = String(object.replicaZones[i]); + } + return message; + }; + + /** + * Creates a plain object from a RegionDiskTargetEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} message RegionDiskTargetEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + RegionDiskTargetEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaZones = []; + if (options.defaults) { + object.project = ""; + object.region = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.region != null && message.hasOwnProperty("region")) + object.region = message.region; + if (message.replicaZones && message.replicaZones.length) { + object.replicaZones = []; + for (var j = 0; j < message.replicaZones.length; ++j) + object.replicaZones[j] = message.replicaZones[j]; + } + return object; + }; + + /** + * Converts this RegionDiskTargetEnvironment to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @instance + * @returns {Object.} JSON object + */ + RegionDiskTargetEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for RegionDiskTargetEnvironment + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + RegionDiskTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.RegionDiskTargetEnvironment"; + }; + + return RegionDiskTargetEnvironment; + })(); + + v1.DiskRestoreProperties = (function() { + + /** + * Properties of a DiskRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IDiskRestoreProperties + * @property {string|null} [name] DiskRestoreProperties name + * @property {string|null} [description] DiskRestoreProperties description + * @property {number|Long|null} [sizeGb] DiskRestoreProperties sizeGb + * @property {Array.|null} [licenses] DiskRestoreProperties licenses + * @property {Array.|null} [guestOsFeature] DiskRestoreProperties guestOsFeature + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] DiskRestoreProperties diskEncryptionKey + * @property {number|Long|null} [physicalBlockSizeBytes] DiskRestoreProperties physicalBlockSizeBytes + * @property {number|Long|null} [provisionedIops] DiskRestoreProperties provisionedIops + * @property {number|Long|null} [provisionedThroughput] DiskRestoreProperties provisionedThroughput + * @property {boolean|null} [enableConfidentialCompute] DiskRestoreProperties enableConfidentialCompute + * @property {string|null} [storagePool] DiskRestoreProperties storagePool + * @property {google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null} [accessMode] DiskRestoreProperties accessMode + * @property {google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null} [architecture] DiskRestoreProperties architecture + * @property {Array.|null} [resourcePolicy] DiskRestoreProperties resourcePolicy + * @property {string|null} [type] DiskRestoreProperties type + * @property {Object.|null} [labels] DiskRestoreProperties labels + * @property {Object.|null} [resourceManagerTags] DiskRestoreProperties resourceManagerTags + */ + + /** + * Constructs a new DiskRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DiskRestoreProperties. + * @implements IDiskRestoreProperties + * @constructor + * @param {google.cloud.backupdr.v1.IDiskRestoreProperties=} [properties] Properties to set + */ + function DiskRestoreProperties(properties) { + this.licenses = []; + this.guestOsFeature = []; + this.resourcePolicy = []; + this.labels = {}; + this.resourceManagerTags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskRestoreProperties name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.name = null; + + /** + * DiskRestoreProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.description = null; + + /** + * DiskRestoreProperties sizeGb. + * @member {number|Long|null|undefined} sizeGb + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.sizeGb = null; + + /** + * DiskRestoreProperties licenses. + * @member {Array.} licenses + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.licenses = $util.emptyArray; + + /** + * DiskRestoreProperties guestOsFeature. + * @member {Array.} guestOsFeature + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.guestOsFeature = $util.emptyArray; + + /** + * DiskRestoreProperties diskEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.diskEncryptionKey = null; + + /** + * DiskRestoreProperties physicalBlockSizeBytes. + * @member {number|Long|null|undefined} physicalBlockSizeBytes + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.physicalBlockSizeBytes = null; + + /** + * DiskRestoreProperties provisionedIops. + * @member {number|Long|null|undefined} provisionedIops + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.provisionedIops = null; + + /** + * DiskRestoreProperties provisionedThroughput. + * @member {number|Long|null|undefined} provisionedThroughput + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.provisionedThroughput = null; + + /** + * DiskRestoreProperties enableConfidentialCompute. + * @member {boolean|null|undefined} enableConfidentialCompute + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.enableConfidentialCompute = null; + + /** + * DiskRestoreProperties storagePool. + * @member {string|null|undefined} storagePool + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.storagePool = null; + + /** + * DiskRestoreProperties accessMode. + * @member {google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null|undefined} accessMode + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.accessMode = null; + + /** + * DiskRestoreProperties architecture. + * @member {google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null|undefined} architecture + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.architecture = null; + + /** + * DiskRestoreProperties resourcePolicy. + * @member {Array.} resourcePolicy + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.resourcePolicy = $util.emptyArray; + + /** + * DiskRestoreProperties type. + * @member {string|null|undefined} type + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.type = null; + + /** + * DiskRestoreProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.labels = $util.emptyObject; + + /** + * DiskRestoreProperties resourceManagerTags. + * @member {Object.} resourceManagerTags + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + */ + DiskRestoreProperties.prototype.resourceManagerTags = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_sizeGb", { + get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_physicalBlockSizeBytes", { + get: $util.oneOfGetter($oneOfFields = ["physicalBlockSizeBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_provisionedIops", { + get: $util.oneOfGetter($oneOfFields = ["provisionedIops"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_provisionedThroughput", { + get: $util.oneOfGetter($oneOfFields = ["provisionedThroughput"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_enableConfidentialCompute", { + get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_storagePool", { + get: $util.oneOfGetter($oneOfFields = ["storagePool"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_accessMode", { + get: $util.oneOfGetter($oneOfFields = ["accessMode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_architecture", { + get: $util.oneOfGetter($oneOfFields = ["architecture"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskRestoreProperties.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskRestoreProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskRestoreProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties instance + */ + DiskRestoreProperties.create = function create(properties) { + return new DiskRestoreProperties(properties); + }; + + /** + * Encodes the specified DiskRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskRestoreProperties} message DiskRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskRestoreProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 3, wireType 0 =*/24).int64(message.sizeGb); + if (message.licenses != null && message.licenses.length) + for (var i = 0; i < message.licenses.length; ++i) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.licenses[i]); + if (message.guestOsFeature != null && message.guestOsFeature.length) + for (var i = 0; i < message.guestOsFeature.length; ++i) + $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.physicalBlockSizeBytes != null && Object.hasOwnProperty.call(message, "physicalBlockSizeBytes")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.physicalBlockSizeBytes); + if (message.provisionedIops != null && Object.hasOwnProperty.call(message, "provisionedIops")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.provisionedIops); + if (message.provisionedThroughput != null && Object.hasOwnProperty.call(message, "provisionedThroughput")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.provisionedThroughput); + if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableConfidentialCompute); + if (message.storagePool != null && Object.hasOwnProperty.call(message, "storagePool")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.storagePool); + if (message.accessMode != null && Object.hasOwnProperty.call(message, "accessMode")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.accessMode); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 14, wireType 0 =*/112).int32(message.architecture); + if (message.resourcePolicy != null && message.resourcePolicy.length) + for (var i = 0; i < message.resourcePolicy.length; ++i) + writer.uint32(/* id 15, wireType 2 =*/122).string(message.resourcePolicy[i]); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.type); + 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 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); + if (message.resourceManagerTags != null && Object.hasOwnProperty.call(message, "resourceManagerTags")) + for (var keys = Object.keys(message.resourceManagerTags), 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.resourceManagerTags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified DiskRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskRestoreProperties} message DiskRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskRestoreProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskRestoreProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskRestoreProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskRestoreProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.sizeGb = reader.int64(); + break; + } + case 4: { + if (!(message.licenses && message.licenses.length)) + message.licenses = []; + message.licenses.push(reader.string()); + break; + } + case 5: { + if (!(message.guestOsFeature && message.guestOsFeature.length)) + message.guestOsFeature = []; + message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + } + case 6: { + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 7: { + message.physicalBlockSizeBytes = reader.int64(); + break; + } + case 8: { + message.provisionedIops = reader.int64(); + break; + } + case 9: { + message.provisionedThroughput = reader.int64(); + break; + } + case 10: { + message.enableConfidentialCompute = reader.bool(); + break; + } + case 11: { + message.storagePool = reader.string(); + break; + } + case 12: { + message.accessMode = reader.int32(); + break; + } + case 14: { + message.architecture = reader.int32(); + break; + } + case 15: { + if (!(message.resourcePolicy && message.resourcePolicy.length)) + message.resourcePolicy = []; + message.resourcePolicy.push(reader.string()); + break; + } + case 16: { + message.type = reader.string(); + break; + } + case 17: { + 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 18: { + if (message.resourceManagerTags === $util.emptyObject) + message.resourceManagerTags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceManagerTags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskRestoreProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskRestoreProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskRestoreProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskRestoreProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + properties._sizeGb = 1; + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + } + if (message.licenses != null && message.hasOwnProperty("licenses")) { + if (!Array.isArray(message.licenses)) + return "licenses: array expected"; + for (var i = 0; i < message.licenses.length; ++i) + if (!$util.isString(message.licenses[i])) + return "licenses: string[] expected"; + } + if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { + if (!Array.isArray(message.guestOsFeature)) + return "guestOsFeature: array expected"; + for (var i = 0; i < message.guestOsFeature.length; ++i) { + var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); + if (error) + return "guestOsFeature." + error; + } + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.physicalBlockSizeBytes != null && message.hasOwnProperty("physicalBlockSizeBytes")) { + properties._physicalBlockSizeBytes = 1; + if (!$util.isInteger(message.physicalBlockSizeBytes) && !(message.physicalBlockSizeBytes && $util.isInteger(message.physicalBlockSizeBytes.low) && $util.isInteger(message.physicalBlockSizeBytes.high))) + return "physicalBlockSizeBytes: integer|Long expected"; + } + if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { + properties._provisionedIops = 1; + if (!$util.isInteger(message.provisionedIops) && !(message.provisionedIops && $util.isInteger(message.provisionedIops.low) && $util.isInteger(message.provisionedIops.high))) + return "provisionedIops: integer|Long expected"; + } + if (message.provisionedThroughput != null && message.hasOwnProperty("provisionedThroughput")) { + properties._provisionedThroughput = 1; + if (!$util.isInteger(message.provisionedThroughput) && !(message.provisionedThroughput && $util.isInteger(message.provisionedThroughput.low) && $util.isInteger(message.provisionedThroughput.high))) + return "provisionedThroughput: integer|Long expected"; + } + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + properties._enableConfidentialCompute = 1; + if (typeof message.enableConfidentialCompute !== "boolean") + return "enableConfidentialCompute: boolean expected"; + } + if (message.storagePool != null && message.hasOwnProperty("storagePool")) { + properties._storagePool = 1; + if (!$util.isString(message.storagePool)) + return "storagePool: string expected"; + } + if (message.accessMode != null && message.hasOwnProperty("accessMode")) { + properties._accessMode = 1; + switch (message.accessMode) { + default: + return "accessMode: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.architecture != null && message.hasOwnProperty("architecture")) { + properties._architecture = 1; + switch (message.architecture) { + default: + return "architecture: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.resourcePolicy != null && message.hasOwnProperty("resourcePolicy")) { + if (!Array.isArray(message.resourcePolicy)) + return "resourcePolicy: array expected"; + for (var i = 0; i < message.resourcePolicy.length; ++i) + if (!$util.isString(message.resourcePolicy[i])) + return "resourcePolicy: string[] expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + if (!$util.isString(message.type)) + return "type: 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.resourceManagerTags != null && message.hasOwnProperty("resourceManagerTags")) { + if (!$util.isObject(message.resourceManagerTags)) + return "resourceManagerTags: object expected"; + var key = Object.keys(message.resourceManagerTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceManagerTags[key[i]])) + return "resourceManagerTags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates a DiskRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties + */ + DiskRestoreProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DiskRestoreProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.DiskRestoreProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.licenses) { + if (!Array.isArray(object.licenses)) + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.licenses: array expected"); + message.licenses = []; + for (var i = 0; i < object.licenses.length; ++i) + message.licenses[i] = String(object.licenses[i]); + } + if (object.guestOsFeature) { + if (!Array.isArray(object.guestOsFeature)) + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.guestOsFeature: array expected"); + message.guestOsFeature = []; + for (var i = 0; i < object.guestOsFeature.length; ++i) { + if (typeof object.guestOsFeature[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.guestOsFeature: object expected"); + message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); + } + } + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.physicalBlockSizeBytes != null) + if ($util.Long) + (message.physicalBlockSizeBytes = $util.Long.fromValue(object.physicalBlockSizeBytes)).unsigned = false; + else if (typeof object.physicalBlockSizeBytes === "string") + message.physicalBlockSizeBytes = parseInt(object.physicalBlockSizeBytes, 10); + else if (typeof object.physicalBlockSizeBytes === "number") + message.physicalBlockSizeBytes = object.physicalBlockSizeBytes; + else if (typeof object.physicalBlockSizeBytes === "object") + message.physicalBlockSizeBytes = new $util.LongBits(object.physicalBlockSizeBytes.low >>> 0, object.physicalBlockSizeBytes.high >>> 0).toNumber(); + if (object.provisionedIops != null) + if ($util.Long) + (message.provisionedIops = $util.Long.fromValue(object.provisionedIops)).unsigned = false; + else if (typeof object.provisionedIops === "string") + message.provisionedIops = parseInt(object.provisionedIops, 10); + else if (typeof object.provisionedIops === "number") + message.provisionedIops = object.provisionedIops; + else if (typeof object.provisionedIops === "object") + message.provisionedIops = new $util.LongBits(object.provisionedIops.low >>> 0, object.provisionedIops.high >>> 0).toNumber(); + if (object.provisionedThroughput != null) + if ($util.Long) + (message.provisionedThroughput = $util.Long.fromValue(object.provisionedThroughput)).unsigned = false; + else if (typeof object.provisionedThroughput === "string") + message.provisionedThroughput = parseInt(object.provisionedThroughput, 10); + else if (typeof object.provisionedThroughput === "number") + message.provisionedThroughput = object.provisionedThroughput; + else if (typeof object.provisionedThroughput === "object") + message.provisionedThroughput = new $util.LongBits(object.provisionedThroughput.low >>> 0, object.provisionedThroughput.high >>> 0).toNumber(); + if (object.enableConfidentialCompute != null) + message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); + if (object.storagePool != null) + message.storagePool = String(object.storagePool); + switch (object.accessMode) { + default: + if (typeof object.accessMode === "number") { + message.accessMode = object.accessMode; + break; + } + break; + case "READ_WRITE_SINGLE": + case 0: + message.accessMode = 0; + break; + case "READ_WRITE_MANY": + case 1: + message.accessMode = 1; + break; + case "READ_ONLY_MANY": + case 2: + message.accessMode = 2; + break; + } + switch (object.architecture) { + default: + if (typeof object.architecture === "number") { + message.architecture = object.architecture; + break; + } + break; + case "ARCHITECTURE_UNSPECIFIED": + case 0: + message.architecture = 0; + break; + case "X86_64": + case 1: + message.architecture = 1; + break; + case "ARM64": + case 2: + message.architecture = 2; + break; + } + if (object.resourcePolicy) { + if (!Array.isArray(object.resourcePolicy)) + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.resourcePolicy: array expected"); + message.resourcePolicy = []; + for (var i = 0; i < object.resourcePolicy.length; ++i) + message.resourcePolicy[i] = String(object.resourcePolicy[i]); + } + if (object.type != null) + message.type = String(object.type); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.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.resourceManagerTags) { + if (typeof object.resourceManagerTags !== "object") + throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.resourceManagerTags: object expected"); + message.resourceManagerTags = {}; + for (var keys = Object.keys(object.resourceManagerTags), i = 0; i < keys.length; ++i) + message.resourceManagerTags[keys[i]] = String(object.resourceManagerTags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from a DiskRestoreProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.DiskRestoreProperties} message DiskRestoreProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskRestoreProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.licenses = []; + object.guestOsFeature = []; + object.resourcePolicy = []; + } + if (options.objects || options.defaults) { + object.labels = {}; + object.resourceManagerTags = {}; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (options.oneofs) + object._sizeGb = "sizeGb"; + } + if (message.licenses && message.licenses.length) { + object.licenses = []; + for (var j = 0; j < message.licenses.length; ++j) + object.licenses[j] = message.licenses[j]; + } + if (message.guestOsFeature && message.guestOsFeature.length) { + object.guestOsFeature = []; + for (var j = 0; j < message.guestOsFeature.length; ++j) + object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + if (message.physicalBlockSizeBytes != null && message.hasOwnProperty("physicalBlockSizeBytes")) { + if (typeof message.physicalBlockSizeBytes === "number") + object.physicalBlockSizeBytes = options.longs === String ? String(message.physicalBlockSizeBytes) : message.physicalBlockSizeBytes; + else + object.physicalBlockSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.physicalBlockSizeBytes) : options.longs === Number ? new $util.LongBits(message.physicalBlockSizeBytes.low >>> 0, message.physicalBlockSizeBytes.high >>> 0).toNumber() : message.physicalBlockSizeBytes; + if (options.oneofs) + object._physicalBlockSizeBytes = "physicalBlockSizeBytes"; + } + if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { + if (typeof message.provisionedIops === "number") + object.provisionedIops = options.longs === String ? String(message.provisionedIops) : message.provisionedIops; + else + object.provisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.provisionedIops) : options.longs === Number ? new $util.LongBits(message.provisionedIops.low >>> 0, message.provisionedIops.high >>> 0).toNumber() : message.provisionedIops; + if (options.oneofs) + object._provisionedIops = "provisionedIops"; + } + if (message.provisionedThroughput != null && message.hasOwnProperty("provisionedThroughput")) { + if (typeof message.provisionedThroughput === "number") + object.provisionedThroughput = options.longs === String ? String(message.provisionedThroughput) : message.provisionedThroughput; + else + object.provisionedThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.provisionedThroughput) : options.longs === Number ? new $util.LongBits(message.provisionedThroughput.low >>> 0, message.provisionedThroughput.high >>> 0).toNumber() : message.provisionedThroughput; + if (options.oneofs) + object._provisionedThroughput = "provisionedThroughput"; + } + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + object.enableConfidentialCompute = message.enableConfidentialCompute; + if (options.oneofs) + object._enableConfidentialCompute = "enableConfidentialCompute"; + } + if (message.storagePool != null && message.hasOwnProperty("storagePool")) { + object.storagePool = message.storagePool; + if (options.oneofs) + object._storagePool = "storagePool"; + } + if (message.accessMode != null && message.hasOwnProperty("accessMode")) { + object.accessMode = options.enums === String ? $root.google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode[message.accessMode] === undefined ? message.accessMode : $root.google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode[message.accessMode] : message.accessMode; + if (options.oneofs) + object._accessMode = "accessMode"; + } + if (message.architecture != null && message.hasOwnProperty("architecture")) { + object.architecture = options.enums === String ? $root.google.cloud.backupdr.v1.DiskRestoreProperties.Architecture[message.architecture] === undefined ? message.architecture : $root.google.cloud.backupdr.v1.DiskRestoreProperties.Architecture[message.architecture] : message.architecture; + if (options.oneofs) + object._architecture = "architecture"; + } + if (message.resourcePolicy && message.resourcePolicy.length) { + object.resourcePolicy = []; + for (var j = 0; j < message.resourcePolicy.length; ++j) + object.resourcePolicy[j] = message.resourcePolicy[j]; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = message.type; + if (options.oneofs) + object._type = "type"; + } + 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.resourceManagerTags && (keys2 = Object.keys(message.resourceManagerTags)).length) { + object.resourceManagerTags = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceManagerTags[keys2[j]] = message.resourceManagerTags[keys2[j]]; + } + return object; + }; + + /** + * Converts this DiskRestoreProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @instance + * @returns {Object.} JSON object + */ + DiskRestoreProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskRestoreProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DiskRestoreProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskRestoreProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskRestoreProperties"; + }; + + /** + * AccessMode enum. + * @name google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode + * @enum {number} + * @property {number} READ_WRITE_SINGLE=0 READ_WRITE_SINGLE value + * @property {number} READ_WRITE_MANY=1 READ_WRITE_MANY value + * @property {number} READ_ONLY_MANY=2 READ_ONLY_MANY value + */ + DiskRestoreProperties.AccessMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "READ_WRITE_SINGLE"] = 0; + values[valuesById[1] = "READ_WRITE_MANY"] = 1; + values[valuesById[2] = "READ_ONLY_MANY"] = 2; + return values; + })(); + + /** + * Architecture enum. + * @name google.cloud.backupdr.v1.DiskRestoreProperties.Architecture + * @enum {number} + * @property {number} ARCHITECTURE_UNSPECIFIED=0 ARCHITECTURE_UNSPECIFIED value + * @property {number} X86_64=1 X86_64 value + * @property {number} ARM64=2 ARM64 value + */ + DiskRestoreProperties.Architecture = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ARCHITECTURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "X86_64"] = 1; + values[valuesById[2] = "ARM64"] = 2; + return values; + })(); + + return DiskRestoreProperties; + })(); + + v1.DiskBackupProperties = (function() { + + /** + * Properties of a DiskBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IDiskBackupProperties + * @property {string|null} [description] DiskBackupProperties description + * @property {Array.|null} [licenses] DiskBackupProperties licenses + * @property {Array.|null} [guestOsFeature] DiskBackupProperties guestOsFeature + * @property {google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null} [architecture] DiskBackupProperties architecture + * @property {string|null} [type] DiskBackupProperties type + * @property {number|Long|null} [sizeGb] DiskBackupProperties sizeGb + * @property {string|null} [region] DiskBackupProperties region + * @property {string|null} [zone] DiskBackupProperties zone + * @property {Array.|null} [replicaZones] DiskBackupProperties replicaZones + * @property {string|null} [sourceDisk] DiskBackupProperties sourceDisk + */ + + /** + * Constructs a new DiskBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DiskBackupProperties. + * @implements IDiskBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IDiskBackupProperties=} [properties] Properties to set + */ + function DiskBackupProperties(properties) { + this.licenses = []; + this.guestOsFeature = []; + this.replicaZones = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskBackupProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.description = null; + + /** + * DiskBackupProperties licenses. + * @member {Array.} licenses + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.licenses = $util.emptyArray; + + /** + * DiskBackupProperties guestOsFeature. + * @member {Array.} guestOsFeature + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.guestOsFeature = $util.emptyArray; + + /** + * DiskBackupProperties architecture. + * @member {google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null|undefined} architecture + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.architecture = null; + + /** + * DiskBackupProperties type. + * @member {string|null|undefined} type + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.type = null; + + /** + * DiskBackupProperties sizeGb. + * @member {number|Long|null|undefined} sizeGb + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.sizeGb = null; + + /** + * DiskBackupProperties region. + * @member {string|null|undefined} region + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.region = null; + + /** + * DiskBackupProperties zone. + * @member {string|null|undefined} zone + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.zone = null; + + /** + * DiskBackupProperties replicaZones. + * @member {Array.} replicaZones + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.replicaZones = $util.emptyArray; + + /** + * DiskBackupProperties sourceDisk. + * @member {string|null|undefined} sourceDisk + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + */ + DiskBackupProperties.prototype.sourceDisk = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_architecture", { + get: $util.oneOfGetter($oneOfFields = ["architecture"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_sizeGb", { + get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_region", { + get: $util.oneOfGetter($oneOfFields = ["region"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_zone", { + get: $util.oneOfGetter($oneOfFields = ["zone"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DiskBackupProperties.prototype, "_sourceDisk", { + get: $util.oneOfGetter($oneOfFields = ["sourceDisk"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DiskBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties instance + */ + DiskBackupProperties.create = function create(properties) { + return new DiskBackupProperties(properties); + }; + + /** + * Encodes the specified DiskBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskBackupProperties} message DiskBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.licenses != null && message.licenses.length) + for (var i = 0; i < message.licenses.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.licenses[i]); + if (message.guestOsFeature != null && message.guestOsFeature.length) + for (var i = 0; i < message.guestOsFeature.length; ++i) + $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.architecture); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeGb); + if (message.region != null && Object.hasOwnProperty.call(message, "region")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.region); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.zone); + if (message.replicaZones != null && message.replicaZones.length) + for (var i = 0; i < message.replicaZones.length; ++i) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.replicaZones[i]); + if (message.sourceDisk != null && Object.hasOwnProperty.call(message, "sourceDisk")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceDisk); + return writer; + }; + + /** + * Encodes the specified DiskBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskBackupProperties} message DiskBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskBackupProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskBackupProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + if (!(message.licenses && message.licenses.length)) + message.licenses = []; + message.licenses.push(reader.string()); + break; + } + case 3: { + if (!(message.guestOsFeature && message.guestOsFeature.length)) + message.guestOsFeature = []; + message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + } + case 4: { + message.architecture = reader.int32(); + break; + } + case 5: { + message.type = reader.string(); + break; + } + case 6: { + message.sizeGb = reader.int64(); + break; + } + case 7: { + message.region = reader.string(); + break; + } + case 8: { + message.zone = reader.string(); + break; + } + case 9: { + if (!(message.replicaZones && message.replicaZones.length)) + message.replicaZones = []; + message.replicaZones.push(reader.string()); + break; + } + case 10: { + message.sourceDisk = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.licenses != null && message.hasOwnProperty("licenses")) { + if (!Array.isArray(message.licenses)) + return "licenses: array expected"; + for (var i = 0; i < message.licenses.length; ++i) + if (!$util.isString(message.licenses[i])) + return "licenses: string[] expected"; + } + if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { + if (!Array.isArray(message.guestOsFeature)) + return "guestOsFeature: array expected"; + for (var i = 0; i < message.guestOsFeature.length; ++i) { + var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); + if (error) + return "guestOsFeature." + error; + } + } + if (message.architecture != null && message.hasOwnProperty("architecture")) { + properties._architecture = 1; + switch (message.architecture) { + default: + return "architecture: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + if (!$util.isString(message.type)) + return "type: string expected"; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + properties._sizeGb = 1; + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + } + if (message.region != null && message.hasOwnProperty("region")) { + properties._region = 1; + if (!$util.isString(message.region)) + return "region: string expected"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + properties._zone = 1; + if (!$util.isString(message.zone)) + return "zone: string expected"; + } + if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { + if (!Array.isArray(message.replicaZones)) + return "replicaZones: array expected"; + for (var i = 0; i < message.replicaZones.length; ++i) + if (!$util.isString(message.replicaZones[i])) + return "replicaZones: string[] expected"; + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + properties._sourceDisk = 1; + if (!$util.isString(message.sourceDisk)) + return "sourceDisk: string expected"; + } + return null; + }; + + /** + * Creates a DiskBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties + */ + DiskBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DiskBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.DiskBackupProperties(); + if (object.description != null) + message.description = String(object.description); + if (object.licenses) { + if (!Array.isArray(object.licenses)) + throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.licenses: array expected"); + message.licenses = []; + for (var i = 0; i < object.licenses.length; ++i) + message.licenses[i] = String(object.licenses[i]); + } + if (object.guestOsFeature) { + if (!Array.isArray(object.guestOsFeature)) + throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.guestOsFeature: array expected"); + message.guestOsFeature = []; + for (var i = 0; i < object.guestOsFeature.length; ++i) { + if (typeof object.guestOsFeature[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.guestOsFeature: object expected"); + message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); + } + } + switch (object.architecture) { + default: + if (typeof object.architecture === "number") { + message.architecture = object.architecture; + break; + } + break; + case "ARCHITECTURE_UNSPECIFIED": + case 0: + message.architecture = 0; + break; + case "X86_64": + case 1: + message.architecture = 1; + break; + case "ARM64": + case 2: + message.architecture = 2; + break; + } + if (object.type != null) + message.type = String(object.type); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + if (object.region != null) + message.region = String(object.region); + if (object.zone != null) + message.zone = String(object.zone); + if (object.replicaZones) { + if (!Array.isArray(object.replicaZones)) + throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.replicaZones: array expected"); + message.replicaZones = []; + for (var i = 0; i < object.replicaZones.length; ++i) + message.replicaZones[i] = String(object.replicaZones[i]); + } + if (object.sourceDisk != null) + message.sourceDisk = String(object.sourceDisk); + return message; + }; + + /** + * Creates a plain object from a DiskBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {google.cloud.backupdr.v1.DiskBackupProperties} message DiskBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.licenses = []; + object.guestOsFeature = []; + object.replicaZones = []; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.licenses && message.licenses.length) { + object.licenses = []; + for (var j = 0; j < message.licenses.length; ++j) + object.licenses[j] = message.licenses[j]; + } + if (message.guestOsFeature && message.guestOsFeature.length) { + object.guestOsFeature = []; + for (var j = 0; j < message.guestOsFeature.length; ++j) + object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); + } + if (message.architecture != null && message.hasOwnProperty("architecture")) { + object.architecture = options.enums === String ? $root.google.cloud.backupdr.v1.DiskBackupProperties.Architecture[message.architecture] === undefined ? message.architecture : $root.google.cloud.backupdr.v1.DiskBackupProperties.Architecture[message.architecture] : message.architecture; + if (options.oneofs) + object._architecture = "architecture"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + if (options.oneofs) + object._sizeGb = "sizeGb"; + } + if (message.region != null && message.hasOwnProperty("region")) { + object.region = message.region; + if (options.oneofs) + object._region = "region"; + } + if (message.zone != null && message.hasOwnProperty("zone")) { + object.zone = message.zone; + if (options.oneofs) + object._zone = "zone"; + } + if (message.replicaZones && message.replicaZones.length) { + object.replicaZones = []; + for (var j = 0; j < message.replicaZones.length; ++j) + object.replicaZones[j] = message.replicaZones[j]; + } + if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { + object.sourceDisk = message.sourceDisk; + if (options.oneofs) + object._sourceDisk = "sourceDisk"; + } + return object; + }; + + /** + * Converts this DiskBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @instance + * @returns {Object.} JSON object + */ + DiskBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DiskBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskBackupProperties"; + }; + + /** + * Architecture enum. + * @name google.cloud.backupdr.v1.DiskBackupProperties.Architecture + * @enum {number} + * @property {number} ARCHITECTURE_UNSPECIFIED=0 ARCHITECTURE_UNSPECIFIED value + * @property {number} X86_64=1 X86_64 value + * @property {number} ARM64=2 ARM64 value + */ + DiskBackupProperties.Architecture = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ARCHITECTURE_UNSPECIFIED"] = 0; + values[valuesById[1] = "X86_64"] = 1; + values[valuesById[2] = "ARM64"] = 2; + return values; + })(); + + return DiskBackupProperties; + })(); + + v1.DiskDataSourceProperties = (function() { + + /** + * Properties of a DiskDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IDiskDataSourceProperties + * @property {string|null} [name] DiskDataSourceProperties name + * @property {string|null} [description] DiskDataSourceProperties description + * @property {string|null} [type] DiskDataSourceProperties type + * @property {number|Long|null} [sizeGb] DiskDataSourceProperties sizeGb + */ + + /** + * Constructs a new DiskDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DiskDataSourceProperties. + * @implements IDiskDataSourceProperties + * @constructor + * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties=} [properties] Properties to set + */ + function DiskDataSourceProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DiskDataSourceProperties name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @instance + */ + DiskDataSourceProperties.prototype.name = ""; + + /** + * DiskDataSourceProperties description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @instance + */ + DiskDataSourceProperties.prototype.description = ""; + + /** + * DiskDataSourceProperties type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @instance + */ + DiskDataSourceProperties.prototype.type = ""; + + /** + * DiskDataSourceProperties sizeGb. + * @member {number|Long} sizeGb + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @instance + */ + DiskDataSourceProperties.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new DiskDataSourceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties instance + */ + DiskDataSourceProperties.create = function create(properties) { + return new DiskDataSourceProperties(properties); + }; + + /** + * Encodes the specified DiskDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties} message DiskDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskDataSourceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); + if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sizeGb); + return writer; + }; + + /** + * Encodes the specified DiskDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties} message DiskDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DiskDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DiskDataSourceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskDataSourceProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskDataSourceProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.type = reader.string(); + break; + } + case 4: { + message.sizeGb = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DiskDataSourceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DiskDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DiskDataSourceProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DiskDataSourceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) + return "sizeGb: integer|Long expected"; + return null; + }; + + /** + * Creates a DiskDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties + */ + DiskDataSourceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DiskDataSourceProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.DiskDataSourceProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.type != null) + message.type = String(object.type); + if (object.sizeGb != null) + if ($util.Long) + (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; + else if (typeof object.sizeGb === "string") + message.sizeGb = parseInt(object.sizeGb, 10); + else if (typeof object.sizeGb === "number") + message.sizeGb = object.sizeGb; + else if (typeof object.sizeGb === "object") + message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DiskDataSourceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.DiskDataSourceProperties} message DiskDataSourceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DiskDataSourceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.type = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.sizeGb = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) + if (typeof message.sizeGb === "number") + object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; + else + object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; + return object; + }; + + /** + * Converts this DiskDataSourceProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @instance + * @returns {Object.} JSON object + */ + DiskDataSourceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DiskDataSourceProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DiskDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskDataSourceProperties"; + }; + + return DiskDataSourceProperties; + })(); + + v1.ComputeInstanceBackupProperties = (function() { + + /** + * Properties of a ComputeInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceBackupProperties + * @property {string|null} [description] ComputeInstanceBackupProperties description + * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceBackupProperties tags + * @property {string|null} [machineType] ComputeInstanceBackupProperties machineType + * @property {boolean|null} [canIpForward] ComputeInstanceBackupProperties canIpForward + * @property {Array.|null} [networkInterface] ComputeInstanceBackupProperties networkInterface + * @property {Array.|null} [disk] ComputeInstanceBackupProperties disk + * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceBackupProperties metadata + * @property {Array.|null} [serviceAccount] ComputeInstanceBackupProperties serviceAccount + * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceBackupProperties scheduling + * @property {Array.|null} [guestAccelerator] ComputeInstanceBackupProperties guestAccelerator + * @property {string|null} [minCpuPlatform] ComputeInstanceBackupProperties minCpuPlatform + * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceBackupProperties keyRevocationActionType + * @property {string|null} [sourceInstance] ComputeInstanceBackupProperties sourceInstance + * @property {Object.|null} [labels] ComputeInstanceBackupProperties labels + */ + + /** + * Constructs a new ComputeInstanceBackupProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceBackupProperties. + * @implements IComputeInstanceBackupProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set + */ + function ComputeInstanceBackupProperties(properties) { + this.networkInterface = []; + this.disk = []; + this.serviceAccount = []; + this.guestAccelerator = []; + 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]]; + } + + /** + * ComputeInstanceBackupProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.description = null; + + /** + * ComputeInstanceBackupProperties tags. + * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.tags = null; + + /** + * ComputeInstanceBackupProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.machineType = null; + + /** + * ComputeInstanceBackupProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.canIpForward = null; + + /** + * ComputeInstanceBackupProperties networkInterface. + * @member {Array.} networkInterface + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.networkInterface = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties disk. + * @member {Array.} disk + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.disk = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties metadata. + * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.metadata = null; + + /** + * ComputeInstanceBackupProperties serviceAccount. + * @member {Array.} serviceAccount + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.serviceAccount = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties scheduling. + * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.scheduling = null; + + /** + * ComputeInstanceBackupProperties guestAccelerator. + * @member {Array.} guestAccelerator + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.guestAccelerator = $util.emptyArray; + + /** + * ComputeInstanceBackupProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.minCpuPlatform = null; + + /** + * ComputeInstanceBackupProperties keyRevocationActionType. + * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.keyRevocationActionType = null; + + /** + * ComputeInstanceBackupProperties sourceInstance. + * @member {string|null|undefined} sourceInstance + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.sourceInstance = null; + + /** + * ComputeInstanceBackupProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + */ + ComputeInstanceBackupProperties.prototype.labels = $util.emptyObject; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_keyRevocationActionType", { + get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_sourceInstance", { + get: $util.oneOfGetter($oneOfFields = ["sourceInstance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComputeInstanceBackupProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties instance + */ + ComputeInstanceBackupProperties.create = function create(properties) { + return new ComputeInstanceBackupProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceBackupProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.canIpForward); + if (message.networkInterface != null && message.networkInterface.length) + for (var i = 0; i < message.networkInterface.length; ++i) + $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterface[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.disk != null && message.disk.length) + for (var i = 0; i < message.disk.length; ++i) + $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disk[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.serviceAccount != null && message.serviceAccount.length) + for (var i = 0; i < message.serviceAccount.length; ++i) + $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccount[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.guestAccelerator != null && message.guestAccelerator.length) + for (var i = 0; i < message.guestAccelerator.length; ++i) + $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerator[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.minCpuPlatform); + if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); + if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) + writer.uint32(/* id 13, wireType 2 =*/106).string(message.sourceInstance); + 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 14, wireType 2 =*/114).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 ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceBackupProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.description = reader.string(); + break; + } + case 2: { + message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); + break; + } + case 3: { + message.machineType = reader.string(); + break; + } + case 4: { + message.canIpForward = reader.bool(); + break; + } + case 5: { + if (!(message.networkInterface && message.networkInterface.length)) + message.networkInterface = []; + message.networkInterface.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 6: { + if (!(message.disk && message.disk.length)) + message.disk = []; + message.disk.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 7: { + message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); + break; + } + case 8: { + if (!(message.serviceAccount && message.serviceAccount.length)) + message.serviceAccount = []; + message.serviceAccount.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + } + case 9: { + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); + break; + } + case 10: { + if (!(message.guestAccelerator && message.guestAccelerator.length)) + message.guestAccelerator = []; + message.guestAccelerator.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 11: { + message.minCpuPlatform = reader.string(); + break; + } + case 12: { + message.keyRevocationActionType = reader.int32(); + break; + } + case 13: { + message.sourceInstance = reader.string(); + break; + } + case 14: { + 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 ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceBackupProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceBackupProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceBackupProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) { + if (!Array.isArray(message.networkInterface)) + return "networkInterface: array expected"; + for (var i = 0; i < message.networkInterface.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterface[i]); + if (error) + return "networkInterface." + error; + } + } + if (message.disk != null && message.hasOwnProperty("disk")) { + if (!Array.isArray(message.disk)) + return "disk: array expected"; + for (var i = 0; i < message.disk.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disk[i]); + if (error) + return "disk." + error; + } + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { + if (!Array.isArray(message.serviceAccount)) + return "serviceAccount: array expected"; + for (var i = 0; i < message.serviceAccount.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccount[i]); + if (error) + return "serviceAccount." + error; + } + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.guestAccelerator != null && message.hasOwnProperty("guestAccelerator")) { + if (!Array.isArray(message.guestAccelerator)) + return "guestAccelerator: array expected"; + for (var i = 0; i < message.guestAccelerator.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerator[i]); + if (error) + return "guestAccelerator." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + properties._keyRevocationActionType = 1; + switch (message.keyRevocationActionType) { + default: + return "keyRevocationActionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + properties._sourceInstance = 1; + if (!$util.isString(message.sourceInstance)) + return "sourceInstance: 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"; + } + return null; + }; + + /** + * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties + */ + ComputeInstanceBackupProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(); + if (object.description != null) + message.description = String(object.description); + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.tags: object expected"); + message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); + } + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.networkInterface) { + if (!Array.isArray(object.networkInterface)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: array expected"); + message.networkInterface = []; + for (var i = 0; i < object.networkInterface.length; ++i) { + if (typeof object.networkInterface[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: object expected"); + message.networkInterface[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterface[i]); + } + } + if (object.disk) { + if (!Array.isArray(object.disk)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: array expected"); + message.disk = []; + for (var i = 0; i < object.disk.length; ++i) { + if (typeof object.disk[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: object expected"); + message.disk[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disk[i]); + } + } + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.metadata: object expected"); + message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); + } + if (object.serviceAccount) { + if (!Array.isArray(object.serviceAccount)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: array expected"); + message.serviceAccount = []; + for (var i = 0; i < object.serviceAccount.length; ++i) { + if (typeof object.serviceAccount[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: object expected"); + message.serviceAccount[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccount[i]); + } + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); + } + if (object.guestAccelerator) { + if (!Array.isArray(object.guestAccelerator)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: array expected"); + message.guestAccelerator = []; + for (var i = 0; i < object.guestAccelerator.length; ++i) { + if (typeof object.guestAccelerator[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: object expected"); + message.guestAccelerator[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerator[i]); + } + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + switch (object.keyRevocationActionType) { + default: + if (typeof object.keyRevocationActionType === "number") { + message.keyRevocationActionType = object.keyRevocationActionType; + break; + } + break; + case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": + case 0: + message.keyRevocationActionType = 0; + break; + case "NONE": + case 1: + message.keyRevocationActionType = 1; + break; + case "STOP": + case 2: + message.keyRevocationActionType = 2; + break; + } + if (object.sourceInstance != null) + message.sourceInstance = String(object.sourceInstance); + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.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 ComputeInstanceBackupProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} message ComputeInstanceBackupProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceBackupProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.networkInterface = []; + object.disk = []; + object.serviceAccount = []; + object.guestAccelerator = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.networkInterface && message.networkInterface.length) { + object.networkInterface = []; + for (var j = 0; j < message.networkInterface.length; ++j) + object.networkInterface[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterface[j], options); + } + if (message.disk && message.disk.length) { + object.disk = []; + for (var j = 0; j < message.disk.length; ++j) + object.disk[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disk[j], options); + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.serviceAccount && message.serviceAccount.length) { + object.serviceAccount = []; + for (var j = 0; j < message.serviceAccount.length; ++j) + object.serviceAccount[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccount[j], options); + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.guestAccelerator && message.guestAccelerator.length) { + object.guestAccelerator = []; + for (var j = 0; j < message.guestAccelerator.length; ++j) + object.guestAccelerator[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerator[j], options); + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; + if (options.oneofs) + object._keyRevocationActionType = "keyRevocationActionType"; + } + if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { + object.sourceInstance = message.sourceInstance; + if (options.oneofs) + object._sourceInstance = "sourceInstance"; + } + 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 ComputeInstanceBackupProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceBackupProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceBackupProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceBackupProperties"; + }; + + return ComputeInstanceBackupProperties; + })(); + + v1.ComputeInstanceRestoreProperties = (function() { + + /** + * Properties of a ComputeInstanceRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceRestoreProperties + * @property {string|null} [name] ComputeInstanceRestoreProperties name + * @property {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null} [advancedMachineFeatures] ComputeInstanceRestoreProperties advancedMachineFeatures + * @property {boolean|null} [canIpForward] ComputeInstanceRestoreProperties canIpForward + * @property {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] ComputeInstanceRestoreProperties confidentialInstanceConfig + * @property {boolean|null} [deletionProtection] ComputeInstanceRestoreProperties deletionProtection + * @property {string|null} [description] ComputeInstanceRestoreProperties description + * @property {Array.|null} [disks] ComputeInstanceRestoreProperties disks + * @property {google.cloud.backupdr.v1.IDisplayDevice|null} [displayDevice] ComputeInstanceRestoreProperties displayDevice + * @property {Array.|null} [guestAccelerators] ComputeInstanceRestoreProperties guestAccelerators + * @property {string|null} [hostname] ComputeInstanceRestoreProperties hostname + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [instanceEncryptionKey] ComputeInstanceRestoreProperties instanceEncryptionKey + * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceRestoreProperties keyRevocationActionType + * @property {Object.|null} [labels] ComputeInstanceRestoreProperties labels + * @property {string|null} [machineType] ComputeInstanceRestoreProperties machineType + * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceRestoreProperties metadata + * @property {string|null} [minCpuPlatform] ComputeInstanceRestoreProperties minCpuPlatform + * @property {Array.|null} [networkInterfaces] ComputeInstanceRestoreProperties networkInterfaces + * @property {google.cloud.backupdr.v1.INetworkPerformanceConfig|null} [networkPerformanceConfig] ComputeInstanceRestoreProperties networkPerformanceConfig + * @property {google.cloud.backupdr.v1.IInstanceParams|null} [params] ComputeInstanceRestoreProperties params + * @property {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] ComputeInstanceRestoreProperties privateIpv6GoogleAccess + * @property {google.cloud.backupdr.v1.IAllocationAffinity|null} [allocationAffinity] ComputeInstanceRestoreProperties allocationAffinity + * @property {Array.|null} [resourcePolicies] ComputeInstanceRestoreProperties resourcePolicies + * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceRestoreProperties scheduling + * @property {Array.|null} [serviceAccounts] ComputeInstanceRestoreProperties serviceAccounts + * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceRestoreProperties tags + */ + + /** + * Constructs a new ComputeInstanceRestoreProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceRestoreProperties. + * @implements IComputeInstanceRestoreProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set + */ + function ComputeInstanceRestoreProperties(properties) { + this.disks = []; + this.guestAccelerators = []; + this.labels = {}; + this.networkInterfaces = []; + this.resourcePolicies = []; + this.serviceAccounts = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeInstanceRestoreProperties name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.name = null; + + /** + * ComputeInstanceRestoreProperties advancedMachineFeatures. + * @member {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null|undefined} advancedMachineFeatures + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.advancedMachineFeatures = null; + + /** + * ComputeInstanceRestoreProperties canIpForward. + * @member {boolean|null|undefined} canIpForward + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.canIpForward = null; + + /** + * ComputeInstanceRestoreProperties confidentialInstanceConfig. + * @member {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.confidentialInstanceConfig = null; + + /** + * ComputeInstanceRestoreProperties deletionProtection. + * @member {boolean|null|undefined} deletionProtection + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.deletionProtection = null; + + /** + * ComputeInstanceRestoreProperties description. + * @member {string|null|undefined} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.description = null; + + /** + * ComputeInstanceRestoreProperties disks. + * @member {Array.} disks + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.disks = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties displayDevice. + * @member {google.cloud.backupdr.v1.IDisplayDevice|null|undefined} displayDevice + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.displayDevice = null; + + /** + * ComputeInstanceRestoreProperties guestAccelerators. + * @member {Array.} guestAccelerators + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.guestAccelerators = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties hostname. + * @member {string|null|undefined} hostname + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.hostname = null; + + /** + * ComputeInstanceRestoreProperties instanceEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} instanceEncryptionKey + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.instanceEncryptionKey = null; + + /** + * ComputeInstanceRestoreProperties keyRevocationActionType. + * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.keyRevocationActionType = null; + + /** + * ComputeInstanceRestoreProperties labels. + * @member {Object.} labels + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.labels = $util.emptyObject; + + /** + * ComputeInstanceRestoreProperties machineType. + * @member {string|null|undefined} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.machineType = null; + + /** + * ComputeInstanceRestoreProperties metadata. + * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.metadata = null; + + /** + * ComputeInstanceRestoreProperties minCpuPlatform. + * @member {string|null|undefined} minCpuPlatform + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.minCpuPlatform = null; + + /** + * ComputeInstanceRestoreProperties networkInterfaces. + * @member {Array.} networkInterfaces + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.networkInterfaces = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties networkPerformanceConfig. + * @member {google.cloud.backupdr.v1.INetworkPerformanceConfig|null|undefined} networkPerformanceConfig + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.networkPerformanceConfig = null; + + /** + * ComputeInstanceRestoreProperties params. + * @member {google.cloud.backupdr.v1.IInstanceParams|null|undefined} params + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.params = null; + + /** + * ComputeInstanceRestoreProperties privateIpv6GoogleAccess. + * @member {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.privateIpv6GoogleAccess = null; + + /** + * ComputeInstanceRestoreProperties allocationAffinity. + * @member {google.cloud.backupdr.v1.IAllocationAffinity|null|undefined} allocationAffinity + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.allocationAffinity = null; + + /** + * ComputeInstanceRestoreProperties resourcePolicies. + * @member {Array.} resourcePolicies + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.resourcePolicies = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties scheduling. + * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.scheduling = null; + + /** + * ComputeInstanceRestoreProperties serviceAccounts. + * @member {Array.} serviceAccounts + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.serviceAccounts = $util.emptyArray; + + /** + * ComputeInstanceRestoreProperties tags. + * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + */ + ComputeInstanceRestoreProperties.prototype.tags = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_advancedMachineFeatures", { + get: $util.oneOfGetter($oneOfFields = ["advancedMachineFeatures"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_canIpForward", { + get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_confidentialInstanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["confidentialInstanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_deletionProtection", { + get: $util.oneOfGetter($oneOfFields = ["deletionProtection"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_description", { + get: $util.oneOfGetter($oneOfFields = ["description"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_displayDevice", { + get: $util.oneOfGetter($oneOfFields = ["displayDevice"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_hostname", { + get: $util.oneOfGetter($oneOfFields = ["hostname"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_instanceEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["instanceEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_keyRevocationActionType", { + get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_machineType", { + get: $util.oneOfGetter($oneOfFields = ["machineType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_metadata", { + get: $util.oneOfGetter($oneOfFields = ["metadata"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_minCpuPlatform", { + get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_networkPerformanceConfig", { + get: $util.oneOfGetter($oneOfFields = ["networkPerformanceConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_params", { + get: $util.oneOfGetter($oneOfFields = ["params"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_privateIpv6GoogleAccess", { + get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_allocationAffinity", { + get: $util.oneOfGetter($oneOfFields = ["allocationAffinity"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_scheduling", { + get: $util.oneOfGetter($oneOfFields = ["scheduling"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_tags", { + get: $util.oneOfGetter($oneOfFields = ["tags"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties instance + */ + ComputeInstanceRestoreProperties.create = function create(properties) { + return new ComputeInstanceRestoreProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceRestoreProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) + $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canIpForward); + if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) + $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deletionProtection); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); + if (message.disks != null && message.disks.length) + for (var i = 0; i < message.disks.length; ++i) + $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.displayDevice != null && Object.hasOwnProperty.call(message, "displayDevice")) + $root.google.cloud.backupdr.v1.DisplayDevice.encode(message.displayDevice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.guestAccelerators != null && message.guestAccelerators.length) + for (var i = 0; i < message.guestAccelerators.length; ++i) + $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.hostname); + if (message.instanceEncryptionKey != null && Object.hasOwnProperty.call(message, "instanceEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.instanceEncryptionKey, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); + 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.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.machineType); + if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) + $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) + writer.uint32(/* id 16, wireType 2 =*/130).string(message.minCpuPlatform); + if (message.networkInterfaces != null && message.networkInterfaces.length) + for (var i = 0; i < message.networkInterfaces.length; ++i) + $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); + if (message.networkPerformanceConfig != null && Object.hasOwnProperty.call(message, "networkPerformanceConfig")) + $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.encode(message.networkPerformanceConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); + if (message.params != null && Object.hasOwnProperty.call(message, "params")) + $root.google.cloud.backupdr.v1.InstanceParams.encode(message.params, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); + if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) + writer.uint32(/* id 20, wireType 0 =*/160).int32(message.privateIpv6GoogleAccess); + if (message.allocationAffinity != null && Object.hasOwnProperty.call(message, "allocationAffinity")) + $root.google.cloud.backupdr.v1.AllocationAffinity.encode(message.allocationAffinity, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.resourcePolicies != null && message.resourcePolicies.length) + for (var i = 0; i < message.resourcePolicies.length; ++i) + writer.uint32(/* id 22, wireType 2 =*/178).string(message.resourcePolicies[i]); + if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) + $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); + if (message.serviceAccounts != null && message.serviceAccounts.length) + for (var i = 0; i < message.serviceAccounts.length; ++i) + $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccounts[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); + if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) + $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceRestoreProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceRestoreProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(), 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.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.decode(reader, reader.uint32()); + break; + } + case 3: { + message.canIpForward = reader.bool(); + break; + } + case 4: { + message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); + break; + } + case 5: { + message.deletionProtection = reader.bool(); + break; + } + case 6: { + message.description = reader.string(); + break; + } + case 7: { + if (!(message.disks && message.disks.length)) + message.disks = []; + message.disks.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); + break; + } + case 8: { + message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.decode(reader, reader.uint32()); + break; + } + case 9: { + if (!(message.guestAccelerators && message.guestAccelerators.length)) + message.guestAccelerators = []; + message.guestAccelerators.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); + break; + } + case 10: { + message.hostname = reader.string(); + break; + } + case 11: { + message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 12: { + message.keyRevocationActionType = reader.int32(); + 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.machineType = reader.string(); + break; + } + case 15: { + message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); + break; + } + case 16: { + message.minCpuPlatform = reader.string(); + break; + } + case 17: { + if (!(message.networkInterfaces && message.networkInterfaces.length)) + message.networkInterfaces = []; + message.networkInterfaces.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); + break; + } + case 18: { + message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.decode(reader, reader.uint32()); + break; + } + case 19: { + message.params = $root.google.cloud.backupdr.v1.InstanceParams.decode(reader, reader.uint32()); + break; + } + case 20: { + message.privateIpv6GoogleAccess = reader.int32(); + break; + } + case 21: { + message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.decode(reader, reader.uint32()); + break; + } + case 22: { + if (!(message.resourcePolicies && message.resourcePolicies.length)) + message.resourcePolicies = []; + message.resourcePolicies.push(reader.string()); + break; + } + case 23: { + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); + break; + } + case 24: { + if (!(message.serviceAccounts && message.serviceAccounts.length)) + message.serviceAccounts = []; + message.serviceAccounts.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); + break; + } + case 26: { + message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceRestoreProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceRestoreProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceRestoreProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + properties._advancedMachineFeatures = 1; + { + var error = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures); + if (error) + return "advancedMachineFeatures." + error; + } + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + properties._canIpForward = 1; + if (typeof message.canIpForward !== "boolean") + return "canIpForward: boolean expected"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + properties._confidentialInstanceConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); + if (error) + return "confidentialInstanceConfig." + error; + } + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + properties._deletionProtection = 1; + if (typeof message.deletionProtection !== "boolean") + return "deletionProtection: boolean expected"; + } + if (message.description != null && message.hasOwnProperty("description")) { + properties._description = 1; + if (!$util.isString(message.description)) + return "description: string expected"; + } + if (message.disks != null && message.hasOwnProperty("disks")) { + if (!Array.isArray(message.disks)) + return "disks: array expected"; + for (var i = 0; i < message.disks.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disks[i]); + if (error) + return "disks." + error; + } + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + properties._displayDevice = 1; + { + var error = $root.google.cloud.backupdr.v1.DisplayDevice.verify(message.displayDevice); + if (error) + return "displayDevice." + error; + } + } + if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { + if (!Array.isArray(message.guestAccelerators)) + return "guestAccelerators: array expected"; + for (var i = 0; i < message.guestAccelerators.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); + if (error) + return "guestAccelerators." + error; + } + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + properties._hostname = 1; + if (!$util.isString(message.hostname)) + return "hostname: string expected"; + } + if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { + properties._instanceEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.instanceEncryptionKey); + if (error) + return "instanceEncryptionKey." + error; + } + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + properties._keyRevocationActionType = 1; + switch (message.keyRevocationActionType) { + default: + return "keyRevocationActionType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.labels != null && message.hasOwnProperty("labels")) { + if (!$util.isObject(message.labels)) + return "labels: object expected"; + var key = Object.keys(message.labels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.labels[key[i]])) + return "labels: string{k:string} expected"; + } + if (message.machineType != null && message.hasOwnProperty("machineType")) { + properties._machineType = 1; + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + properties._metadata = 1; + { + var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); + if (error) + return "metadata." + error; + } + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + properties._minCpuPlatform = 1; + if (!$util.isString(message.minCpuPlatform)) + return "minCpuPlatform: string expected"; + } + if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { + if (!Array.isArray(message.networkInterfaces)) + return "networkInterfaces: array expected"; + for (var i = 0; i < message.networkInterfaces.length; ++i) { + var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterfaces[i]); + if (error) + return "networkInterfaces." + error; + } + } + if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { + properties._networkPerformanceConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.verify(message.networkPerformanceConfig); + if (error) + return "networkPerformanceConfig." + error; + } + } + if (message.params != null && message.hasOwnProperty("params")) { + properties._params = 1; + { + var error = $root.google.cloud.backupdr.v1.InstanceParams.verify(message.params); + if (error) + return "params." + error; + } + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + properties._privateIpv6GoogleAccess = 1; + switch (message.privateIpv6GoogleAccess) { + default: + return "privateIpv6GoogleAccess: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { + properties._allocationAffinity = 1; + { + var error = $root.google.cloud.backupdr.v1.AllocationAffinity.verify(message.allocationAffinity); + if (error) + return "allocationAffinity." + error; + } + } + if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { + if (!Array.isArray(message.resourcePolicies)) + return "resourcePolicies: array expected"; + for (var i = 0; i < message.resourcePolicies.length; ++i) + if (!$util.isString(message.resourcePolicies[i])) + return "resourcePolicies: string[] expected"; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + properties._scheduling = 1; + { + var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); + if (error) + return "scheduling." + error; + } + } + if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { + if (!Array.isArray(message.serviceAccounts)) + return "serviceAccounts: array expected"; + for (var i = 0; i < message.serviceAccounts.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccounts[i]); + if (error) + return "serviceAccounts." + error; + } + } + if (message.tags != null && message.hasOwnProperty("tags")) { + properties._tags = 1; + { + var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); + if (error) + return "tags." + error; + } + } + return null; + }; + + /** + * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties + */ + ComputeInstanceRestoreProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.advancedMachineFeatures != null) { + if (typeof object.advancedMachineFeatures !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.advancedMachineFeatures: object expected"); + message.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures); + } + if (object.canIpForward != null) + message.canIpForward = Boolean(object.canIpForward); + if (object.confidentialInstanceConfig != null) { + if (typeof object.confidentialInstanceConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.confidentialInstanceConfig: object expected"); + message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); + } + if (object.deletionProtection != null) + message.deletionProtection = Boolean(object.deletionProtection); + if (object.description != null) + message.description = String(object.description); + if (object.disks) { + if (!Array.isArray(object.disks)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: array expected"); + message.disks = []; + for (var i = 0; i < object.disks.length; ++i) { + if (typeof object.disks[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: object expected"); + message.disks[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disks[i]); + } + } + if (object.displayDevice != null) { + if (typeof object.displayDevice !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.displayDevice: object expected"); + message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.fromObject(object.displayDevice); + } + if (object.guestAccelerators) { + if (!Array.isArray(object.guestAccelerators)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: array expected"); + message.guestAccelerators = []; + for (var i = 0; i < object.guestAccelerators.length; ++i) { + if (typeof object.guestAccelerators[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: object expected"); + message.guestAccelerators[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); + } + } + if (object.hostname != null) + message.hostname = String(object.hostname); + if (object.instanceEncryptionKey != null) { + if (typeof object.instanceEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.instanceEncryptionKey: object expected"); + message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.instanceEncryptionKey); + } + switch (object.keyRevocationActionType) { + default: + if (typeof object.keyRevocationActionType === "number") { + message.keyRevocationActionType = object.keyRevocationActionType; + break; + } + break; + case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": + case 0: + message.keyRevocationActionType = 0; + break; + case "NONE": + case 1: + message.keyRevocationActionType = 1; + break; + case "STOP": + case 2: + message.keyRevocationActionType = 2; + break; + } + if (object.labels) { + if (typeof object.labels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.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.machineType != null) + message.machineType = String(object.machineType); + if (object.metadata != null) { + if (typeof object.metadata !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.metadata: object expected"); + message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); + } + if (object.minCpuPlatform != null) + message.minCpuPlatform = String(object.minCpuPlatform); + if (object.networkInterfaces) { + if (!Array.isArray(object.networkInterfaces)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: array expected"); + message.networkInterfaces = []; + for (var i = 0; i < object.networkInterfaces.length; ++i) { + if (typeof object.networkInterfaces[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: object expected"); + message.networkInterfaces[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); + } + } + if (object.networkPerformanceConfig != null) { + if (typeof object.networkPerformanceConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkPerformanceConfig: object expected"); + message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.fromObject(object.networkPerformanceConfig); + } + if (object.params != null) { + if (typeof object.params !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.params: object expected"); + message.params = $root.google.cloud.backupdr.v1.InstanceParams.fromObject(object.params); + } + switch (object.privateIpv6GoogleAccess) { + default: + if (typeof object.privateIpv6GoogleAccess === "number") { + message.privateIpv6GoogleAccess = object.privateIpv6GoogleAccess; + break; + } + break; + case "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": + case 0: + message.privateIpv6GoogleAccess = 0; + break; + case "INHERIT_FROM_SUBNETWORK": + case 1: + message.privateIpv6GoogleAccess = 1; + break; + case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": + case 2: + message.privateIpv6GoogleAccess = 2; + break; + case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": + case 3: + message.privateIpv6GoogleAccess = 3; + break; + } + if (object.allocationAffinity != null) { + if (typeof object.allocationAffinity !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.allocationAffinity: object expected"); + message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.fromObject(object.allocationAffinity); + } + if (object.resourcePolicies) { + if (!Array.isArray(object.resourcePolicies)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.resourcePolicies: array expected"); + message.resourcePolicies = []; + for (var i = 0; i < object.resourcePolicies.length; ++i) + message.resourcePolicies[i] = String(object.resourcePolicies[i]); + } + if (object.scheduling != null) { + if (typeof object.scheduling !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.scheduling: object expected"); + message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); + } + if (object.serviceAccounts) { + if (!Array.isArray(object.serviceAccounts)) + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: array expected"); + message.serviceAccounts = []; + for (var i = 0; i < object.serviceAccounts.length; ++i) { + if (typeof object.serviceAccounts[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: object expected"); + message.serviceAccounts[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccounts[i]); + } + } + if (object.tags != null) { + if (typeof object.tags !== "object") + throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.tags: object expected"); + message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); + } + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceRestoreProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.disks = []; + object.guestAccelerators = []; + object.networkInterfaces = []; + object.resourcePolicies = []; + object.serviceAccounts = []; + } + if (options.objects || options.defaults) + object.labels = {}; + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { + object.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); + if (options.oneofs) + object._advancedMachineFeatures = "advancedMachineFeatures"; + } + if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { + object.canIpForward = message.canIpForward; + if (options.oneofs) + object._canIpForward = "canIpForward"; + } + if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { + object.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); + if (options.oneofs) + object._confidentialInstanceConfig = "confidentialInstanceConfig"; + } + if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { + object.deletionProtection = message.deletionProtection; + if (options.oneofs) + object._deletionProtection = "deletionProtection"; + } + if (message.description != null && message.hasOwnProperty("description")) { + object.description = message.description; + if (options.oneofs) + object._description = "description"; + } + if (message.disks && message.disks.length) { + object.disks = []; + for (var j = 0; j < message.disks.length; ++j) + object.disks[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disks[j], options); + } + if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { + object.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.toObject(message.displayDevice, options); + if (options.oneofs) + object._displayDevice = "displayDevice"; + } + if (message.guestAccelerators && message.guestAccelerators.length) { + object.guestAccelerators = []; + for (var j = 0; j < message.guestAccelerators.length; ++j) + object.guestAccelerators[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); + } + if (message.hostname != null && message.hasOwnProperty("hostname")) { + object.hostname = message.hostname; + if (options.oneofs) + object._hostname = "hostname"; + } + if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { + object.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.instanceEncryptionKey, options); + if (options.oneofs) + object._instanceEncryptionKey = "instanceEncryptionKey"; + } + if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { + object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; + if (options.oneofs) + object._keyRevocationActionType = "keyRevocationActionType"; + } + 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.machineType != null && message.hasOwnProperty("machineType")) { + object.machineType = message.machineType; + if (options.oneofs) + object._machineType = "machineType"; + } + if (message.metadata != null && message.hasOwnProperty("metadata")) { + object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); + if (options.oneofs) + object._metadata = "metadata"; + } + if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { + object.minCpuPlatform = message.minCpuPlatform; + if (options.oneofs) + object._minCpuPlatform = "minCpuPlatform"; + } + if (message.networkInterfaces && message.networkInterfaces.length) { + object.networkInterfaces = []; + for (var j = 0; j < message.networkInterfaces.length; ++j) + object.networkInterfaces[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); + } + if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { + object.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.toObject(message.networkPerformanceConfig, options); + if (options.oneofs) + object._networkPerformanceConfig = "networkPerformanceConfig"; + } + if (message.params != null && message.hasOwnProperty("params")) { + object.params = $root.google.cloud.backupdr.v1.InstanceParams.toObject(message.params, options); + if (options.oneofs) + object._params = "params"; + } + if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { + object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] === undefined ? message.privateIpv6GoogleAccess : $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; + if (options.oneofs) + object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; + } + if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { + object.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.toObject(message.allocationAffinity, options); + if (options.oneofs) + object._allocationAffinity = "allocationAffinity"; + } + if (message.resourcePolicies && message.resourcePolicies.length) { + object.resourcePolicies = []; + for (var j = 0; j < message.resourcePolicies.length; ++j) + object.resourcePolicies[j] = message.resourcePolicies[j]; + } + if (message.scheduling != null && message.hasOwnProperty("scheduling")) { + object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); + if (options.oneofs) + object._scheduling = "scheduling"; + } + if (message.serviceAccounts && message.serviceAccounts.length) { + object.serviceAccounts = []; + for (var j = 0; j < message.serviceAccounts.length; ++j) + object.serviceAccounts[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccounts[j], options); + } + if (message.tags != null && message.hasOwnProperty("tags")) { + object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); + if (options.oneofs) + object._tags = "tags"; + } + return object; + }; + + /** + * Converts this ComputeInstanceRestoreProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceRestoreProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceRestoreProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceRestoreProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceRestoreProperties"; + }; + + /** + * InstancePrivateIpv6GoogleAccess enum. + * @name google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess + * @enum {number} + * @property {number} INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED=0 INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED value + * @property {number} INHERIT_FROM_SUBNETWORK=1 INHERIT_FROM_SUBNETWORK value + * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=2 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value + * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=3 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value + */ + ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"] = 0; + values[valuesById[1] = "INHERIT_FROM_SUBNETWORK"] = 1; + values[valuesById[2] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 2; + values[valuesById[3] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 3; + return values; + })(); + + return ComputeInstanceRestoreProperties; + })(); + + v1.ComputeInstanceTargetEnvironment = (function() { + + /** + * Properties of a ComputeInstanceTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceTargetEnvironment + * @property {string|null} [project] ComputeInstanceTargetEnvironment project + * @property {string|null} [zone] ComputeInstanceTargetEnvironment zone + */ + + /** + * Constructs a new ComputeInstanceTargetEnvironment. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceTargetEnvironment. + * @implements IComputeInstanceTargetEnvironment + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set + */ + function ComputeInstanceTargetEnvironment(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeInstanceTargetEnvironment project. + * @member {string} project + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + */ + ComputeInstanceTargetEnvironment.prototype.project = ""; + + /** + * ComputeInstanceTargetEnvironment zone. + * @member {string} zone + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + */ + ComputeInstanceTargetEnvironment.prototype.zone = ""; + + /** + * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment instance + */ + ComputeInstanceTargetEnvironment.create = function create(properties) { + return new ComputeInstanceTargetEnvironment(properties); + }; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceTargetEnvironment.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.project != null && Object.hasOwnProperty.call(message, "project")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); + if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceTargetEnvironment.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.project = reader.string(); + break; + } + case 2: { + message.zone = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceTargetEnvironment message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceTargetEnvironment.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.project != null && message.hasOwnProperty("project")) + if (!$util.isString(message.project)) + return "project: string expected"; + if (message.zone != null && message.hasOwnProperty("zone")) + if (!$util.isString(message.zone)) + return "zone: string expected"; + return null; + }; + + /** + * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment + */ + ComputeInstanceTargetEnvironment.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); + if (object.project != null) + message.project = String(object.project); + if (object.zone != null) + message.zone = String(object.zone); + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceTargetEnvironment.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.project = ""; + object.zone = ""; + } + if (message.project != null && message.hasOwnProperty("project")) + object.project = message.project; + if (message.zone != null && message.hasOwnProperty("zone")) + object.zone = message.zone; + return object; + }; + + /** + * Converts this ComputeInstanceTargetEnvironment to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceTargetEnvironment.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceTargetEnvironment + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment"; + }; + + return ComputeInstanceTargetEnvironment; + })(); + + v1.ComputeInstanceDataSourceProperties = (function() { + + /** + * Properties of a ComputeInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @interface IComputeInstanceDataSourceProperties + * @property {string|null} [name] ComputeInstanceDataSourceProperties name + * @property {string|null} [description] ComputeInstanceDataSourceProperties description + * @property {string|null} [machineType] ComputeInstanceDataSourceProperties machineType + * @property {number|Long|null} [totalDiskCount] ComputeInstanceDataSourceProperties totalDiskCount + * @property {number|Long|null} [totalDiskSizeGb] ComputeInstanceDataSourceProperties totalDiskSizeGb + */ + + /** + * Constructs a new ComputeInstanceDataSourceProperties. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ComputeInstanceDataSourceProperties. + * @implements IComputeInstanceDataSourceProperties + * @constructor + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set + */ + function ComputeInstanceDataSourceProperties(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ComputeInstanceDataSourceProperties name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.name = ""; + + /** + * ComputeInstanceDataSourceProperties description. + * @member {string} description + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.description = ""; + + /** + * ComputeInstanceDataSourceProperties machineType. + * @member {string} machineType + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.machineType = ""; + + /** + * ComputeInstanceDataSourceProperties totalDiskCount. + * @member {number|Long} totalDiskCount + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.totalDiskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ComputeInstanceDataSourceProperties totalDiskSizeGb. + * @member {number|Long} totalDiskSizeGb + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + */ + ComputeInstanceDataSourceProperties.prototype.totalDiskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties instance + */ + ComputeInstanceDataSourceProperties.create = function create(properties) { + return new ComputeInstanceDataSourceProperties(properties); + }; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceDataSourceProperties.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.description != null && Object.hasOwnProperty.call(message, "description")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); + if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); + if (message.totalDiskCount != null && Object.hasOwnProperty.call(message, "totalDiskCount")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalDiskCount); + if (message.totalDiskSizeGb != null && Object.hasOwnProperty.call(message, "totalDiskSizeGb")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalDiskSizeGb); + return writer; + }; + + /** + * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ComputeInstanceDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceDataSourceProperties.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.description = reader.string(); + break; + } + case 3: { + message.machineType = reader.string(); + break; + } + case 4: { + message.totalDiskCount = reader.int64(); + break; + } + case 5: { + message.totalDiskSizeGb = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ComputeInstanceDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ComputeInstanceDataSourceProperties message. + * @function verify + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ComputeInstanceDataSourceProperties.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.description != null && message.hasOwnProperty("description")) + if (!$util.isString(message.description)) + return "description: string expected"; + if (message.machineType != null && message.hasOwnProperty("machineType")) + if (!$util.isString(message.machineType)) + return "machineType: string expected"; + if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) + if (!$util.isInteger(message.totalDiskCount) && !(message.totalDiskCount && $util.isInteger(message.totalDiskCount.low) && $util.isInteger(message.totalDiskCount.high))) + return "totalDiskCount: integer|Long expected"; + if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) + if (!$util.isInteger(message.totalDiskSizeGb) && !(message.totalDiskSizeGb && $util.isInteger(message.totalDiskSizeGb.low) && $util.isInteger(message.totalDiskSizeGb.high))) + return "totalDiskSizeGb: integer|Long expected"; + return null; + }; + + /** + * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties + */ + ComputeInstanceDataSourceProperties.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties) + return object; + var message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); + if (object.name != null) + message.name = String(object.name); + if (object.description != null) + message.description = String(object.description); + if (object.machineType != null) + message.machineType = String(object.machineType); + if (object.totalDiskCount != null) + if ($util.Long) + (message.totalDiskCount = $util.Long.fromValue(object.totalDiskCount)).unsigned = false; + else if (typeof object.totalDiskCount === "string") + message.totalDiskCount = parseInt(object.totalDiskCount, 10); + else if (typeof object.totalDiskCount === "number") + message.totalDiskCount = object.totalDiskCount; + else if (typeof object.totalDiskCount === "object") + message.totalDiskCount = new $util.LongBits(object.totalDiskCount.low >>> 0, object.totalDiskCount.high >>> 0).toNumber(); + if (object.totalDiskSizeGb != null) + if ($util.Long) + (message.totalDiskSizeGb = $util.Long.fromValue(object.totalDiskSizeGb)).unsigned = false; + else if (typeof object.totalDiskSizeGb === "string") + message.totalDiskSizeGb = parseInt(object.totalDiskSizeGb, 10); + else if (typeof object.totalDiskSizeGb === "number") + message.totalDiskSizeGb = object.totalDiskSizeGb; + else if (typeof object.totalDiskSizeGb === "object") + message.totalDiskSizeGb = new $util.LongBits(object.totalDiskSizeGb.low >>> 0, object.totalDiskSizeGb.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ComputeInstanceDataSourceProperties.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.description = ""; + object.machineType = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalDiskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalDiskCount = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.totalDiskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.totalDiskSizeGb = options.longs === String ? "0" : 0; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.description != null && message.hasOwnProperty("description")) + object.description = message.description; + if (message.machineType != null && message.hasOwnProperty("machineType")) + object.machineType = message.machineType; + if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) + if (typeof message.totalDiskCount === "number") + object.totalDiskCount = options.longs === String ? String(message.totalDiskCount) : message.totalDiskCount; + else + object.totalDiskCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskCount) : options.longs === Number ? new $util.LongBits(message.totalDiskCount.low >>> 0, message.totalDiskCount.high >>> 0).toNumber() : message.totalDiskCount; + if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) + if (typeof message.totalDiskSizeGb === "number") + object.totalDiskSizeGb = options.longs === String ? String(message.totalDiskSizeGb) : message.totalDiskSizeGb; + else + object.totalDiskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskSizeGb) : options.longs === Number ? new $util.LongBits(message.totalDiskSizeGb.low >>> 0, message.totalDiskSizeGb.high >>> 0).toNumber() : message.totalDiskSizeGb; + return object; + }; + + /** + * Converts this ComputeInstanceDataSourceProperties to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @instance + * @returns {Object.} JSON object + */ + ComputeInstanceDataSourceProperties.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ComputeInstanceDataSourceProperties + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ComputeInstanceDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties"; + }; + + return ComputeInstanceDataSourceProperties; + })(); + + v1.AdvancedMachineFeatures = (function() { + + /** + * Properties of an AdvancedMachineFeatures. + * @memberof google.cloud.backupdr.v1 + * @interface IAdvancedMachineFeatures + * @property {boolean|null} [enableNestedVirtualization] AdvancedMachineFeatures enableNestedVirtualization + * @property {number|null} [threadsPerCore] AdvancedMachineFeatures threadsPerCore + * @property {number|null} [visibleCoreCount] AdvancedMachineFeatures visibleCoreCount + * @property {boolean|null} [enableUefiNetworking] AdvancedMachineFeatures enableUefiNetworking + */ + + /** + * Constructs a new AdvancedMachineFeatures. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AdvancedMachineFeatures. + * @implements IAdvancedMachineFeatures + * @constructor + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set + */ + function AdvancedMachineFeatures(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AdvancedMachineFeatures enableNestedVirtualization. + * @member {boolean|null|undefined} enableNestedVirtualization + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableNestedVirtualization = null; + + /** + * AdvancedMachineFeatures threadsPerCore. + * @member {number|null|undefined} threadsPerCore + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.threadsPerCore = null; + + /** + * AdvancedMachineFeatures visibleCoreCount. + * @member {number|null|undefined} visibleCoreCount + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.visibleCoreCount = null; + + /** + * AdvancedMachineFeatures enableUefiNetworking. + * @member {boolean|null|undefined} enableUefiNetworking + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + */ + AdvancedMachineFeatures.prototype.enableUefiNetworking = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableNestedVirtualization", { + get: $util.oneOfGetter($oneOfFields = ["enableNestedVirtualization"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdvancedMachineFeatures.prototype, "_threadsPerCore", { + get: $util.oneOfGetter($oneOfFields = ["threadsPerCore"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdvancedMachineFeatures.prototype, "_visibleCoreCount", { + get: $util.oneOfGetter($oneOfFields = ["visibleCoreCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableUefiNetworking", { + get: $util.oneOfGetter($oneOfFields = ["enableUefiNetworking"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AdvancedMachineFeatures instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures instance + */ + AdvancedMachineFeatures.create = function create(properties) { + return new AdvancedMachineFeatures(properties); + }; + + /** + * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableNestedVirtualization != null && Object.hasOwnProperty.call(message, "enableNestedVirtualization")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableNestedVirtualization); + if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threadsPerCore); + if (message.visibleCoreCount != null && Object.hasOwnProperty.call(message, "visibleCoreCount")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.visibleCoreCount); + if (message.enableUefiNetworking != null && Object.hasOwnProperty.call(message, "enableUefiNetworking")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableUefiNetworking); + return writer; + }; + + /** + * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableNestedVirtualization = reader.bool(); + break; + } + case 2: { + message.threadsPerCore = reader.int32(); + break; + } + case 3: { + message.visibleCoreCount = reader.int32(); + break; + } + case 4: { + message.enableUefiNetworking = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AdvancedMachineFeatures.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AdvancedMachineFeatures message. + * @function verify + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AdvancedMachineFeatures.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + properties._enableNestedVirtualization = 1; + if (typeof message.enableNestedVirtualization !== "boolean") + return "enableNestedVirtualization: boolean expected"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + properties._threadsPerCore = 1; + if (!$util.isInteger(message.threadsPerCore)) + return "threadsPerCore: integer expected"; + } + if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { + properties._visibleCoreCount = 1; + if (!$util.isInteger(message.visibleCoreCount)) + return "visibleCoreCount: integer expected"; + } + if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { + properties._enableUefiNetworking = 1; + if (typeof message.enableUefiNetworking !== "boolean") + return "enableUefiNetworking: boolean expected"; + } + return null; + }; + + /** + * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures + */ + AdvancedMachineFeatures.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AdvancedMachineFeatures) + return object; + var message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); + if (object.enableNestedVirtualization != null) + message.enableNestedVirtualization = Boolean(object.enableNestedVirtualization); + if (object.threadsPerCore != null) + message.threadsPerCore = object.threadsPerCore | 0; + if (object.visibleCoreCount != null) + message.visibleCoreCount = object.visibleCoreCount | 0; + if (object.enableUefiNetworking != null) + message.enableUefiNetworking = Boolean(object.enableUefiNetworking); + return message; + }; + + /** + * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {google.cloud.backupdr.v1.AdvancedMachineFeatures} message AdvancedMachineFeatures + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AdvancedMachineFeatures.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { + object.enableNestedVirtualization = message.enableNestedVirtualization; + if (options.oneofs) + object._enableNestedVirtualization = "enableNestedVirtualization"; + } + if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { + object.threadsPerCore = message.threadsPerCore; + if (options.oneofs) + object._threadsPerCore = "threadsPerCore"; + } + if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { + object.visibleCoreCount = message.visibleCoreCount; + if (options.oneofs) + object._visibleCoreCount = "visibleCoreCount"; + } + if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { + object.enableUefiNetworking = message.enableUefiNetworking; + if (options.oneofs) + object._enableUefiNetworking = "enableUefiNetworking"; + } + return object; + }; + + /** + * Converts this AdvancedMachineFeatures to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @instance + * @returns {Object.} JSON object + */ + AdvancedMachineFeatures.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AdvancedMachineFeatures + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AdvancedMachineFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AdvancedMachineFeatures"; + }; + + return AdvancedMachineFeatures; + })(); + + v1.ConfidentialInstanceConfig = (function() { + + /** + * Properties of a ConfidentialInstanceConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IConfidentialInstanceConfig + * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute + */ + + /** + * Constructs a new ConfidentialInstanceConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ConfidentialInstanceConfig. + * @implements IConfidentialInstanceConfig + * @constructor + * @param {google.cloud.backupdr.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|null|undefined} enableConfidentialCompute + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @instance + */ + ConfidentialInstanceConfig.prototype.enableConfidentialCompute = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ConfidentialInstanceConfig.prototype, "_enableConfidentialCompute", { + get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ConfidentialInstanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance + */ + ConfidentialInstanceConfig.create = function create(properties) { + return new ConfidentialInstanceConfig(properties); + }; + + /** + * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.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.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.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.backupdr.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"; + var properties = {}; + if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + properties._enableConfidentialCompute = 1; + 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.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig + */ + ConfidentialInstanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig) + return object; + var message = new $root.google.cloud.backupdr.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.backupdr.v1.ConfidentialInstanceConfig + * @static + * @param {google.cloud.backupdr.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 (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { + object.enableConfidentialCompute = message.enableConfidentialCompute; + if (options.oneofs) + object._enableConfidentialCompute = "enableConfidentialCompute"; + } + return object; + }; + + /** + * Converts this ConfidentialInstanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.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.backupdr.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.backupdr.v1.ConfidentialInstanceConfig"; + }; + + return ConfidentialInstanceConfig; + })(); + + v1.DisplayDevice = (function() { + + /** + * Properties of a DisplayDevice. + * @memberof google.cloud.backupdr.v1 + * @interface IDisplayDevice + * @property {boolean|null} [enableDisplay] DisplayDevice enableDisplay + */ + + /** + * Constructs a new DisplayDevice. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DisplayDevice. + * @implements IDisplayDevice + * @constructor + * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set + */ + function DisplayDevice(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DisplayDevice enableDisplay. + * @member {boolean|null|undefined} enableDisplay + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + */ + DisplayDevice.prototype.enableDisplay = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DisplayDevice.prototype, "_enableDisplay", { + get: $util.oneOfGetter($oneOfFields = ["enableDisplay"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DisplayDevice instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice instance + */ + DisplayDevice.create = function create(properties) { + return new DisplayDevice(properties); + }; + + /** + * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.enableDisplay != null && Object.hasOwnProperty.call(message, "enableDisplay")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableDisplay); + return writer; + }; + + /** + * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DisplayDevice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DisplayDevice(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.enableDisplay = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DisplayDevice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DisplayDevice message. + * @function verify + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DisplayDevice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + properties._enableDisplay = 1; + if (typeof message.enableDisplay !== "boolean") + return "enableDisplay: boolean expected"; + } + return null; + }; + + /** + * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice + */ + DisplayDevice.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DisplayDevice) + return object; + var message = new $root.google.cloud.backupdr.v1.DisplayDevice(); + if (object.enableDisplay != null) + message.enableDisplay = Boolean(object.enableDisplay); + return message; + }; + + /** + * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {google.cloud.backupdr.v1.DisplayDevice} message DisplayDevice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DisplayDevice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { + object.enableDisplay = message.enableDisplay; + if (options.oneofs) + object._enableDisplay = "enableDisplay"; + } + return object; + }; + + /** + * Converts this DisplayDevice to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @instance + * @returns {Object.} JSON object + */ + DisplayDevice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DisplayDevice + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DisplayDevice + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DisplayDevice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DisplayDevice"; + }; + + return DisplayDevice; + })(); + + v1.AcceleratorConfig = (function() { + + /** + * Properties of an AcceleratorConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IAcceleratorConfig + * @property {string|null} [acceleratorType] AcceleratorConfig acceleratorType + * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount + */ + + /** + * Constructs a new AcceleratorConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AcceleratorConfig. + * @implements IAcceleratorConfig + * @constructor + * @param {google.cloud.backupdr.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 acceleratorType. + * @member {string|null|undefined} acceleratorType + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorType = null; + + /** + * AcceleratorConfig acceleratorCount. + * @member {number|null|undefined} acceleratorCount + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @instance + */ + AcceleratorConfig.prototype.acceleratorCount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorType", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorCount", { + get: $util.oneOfGetter($oneOfFields = ["acceleratorCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AcceleratorConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.v1.IAcceleratorConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig instance + */ + AcceleratorConfig.create = function create(properties) { + return new AcceleratorConfig(properties); + }; + + /** + * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.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.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.acceleratorType); + 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.backupdr.v1.AcceleratorConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.v1.AcceleratorConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.acceleratorType = 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.backupdr.v1.AcceleratorConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.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.backupdr.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"; + var properties = {}; + if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + properties._acceleratorType = 1; + if (!$util.isString(message.acceleratorType)) + return "acceleratorType: string expected"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + properties._acceleratorCount = 1; + 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.backupdr.v1.AcceleratorConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig + */ + AcceleratorConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AcceleratorConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.AcceleratorConfig(); + if (object.acceleratorType != null) + message.acceleratorType = String(object.acceleratorType); + 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.backupdr.v1.AcceleratorConfig + * @static + * @param {google.cloud.backupdr.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 (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { + object.acceleratorType = message.acceleratorType; + if (options.oneofs) + object._acceleratorType = "acceleratorType"; + } + if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { + object.acceleratorCount = message.acceleratorCount; + if (options.oneofs) + object._acceleratorCount = "acceleratorCount"; + } + return object; + }; + + /** + * Converts this AcceleratorConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.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.backupdr.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.backupdr.v1.AcceleratorConfig"; + }; + + return AcceleratorConfig; + })(); + + v1.CustomerEncryptionKey = (function() { + + /** + * Properties of a CustomerEncryptionKey. + * @memberof google.cloud.backupdr.v1 + * @interface ICustomerEncryptionKey + * @property {string|null} [rawKey] CustomerEncryptionKey rawKey + * @property {string|null} [rsaEncryptedKey] CustomerEncryptionKey rsaEncryptedKey + * @property {string|null} [kmsKeyName] CustomerEncryptionKey kmsKeyName + * @property {string|null} [kmsKeyServiceAccount] CustomerEncryptionKey kmsKeyServiceAccount + */ + + /** + * Constructs a new CustomerEncryptionKey. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a CustomerEncryptionKey. + * @implements ICustomerEncryptionKey + * @constructor + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set + */ + function CustomerEncryptionKey(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * CustomerEncryptionKey rawKey. + * @member {string|null|undefined} rawKey + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rawKey = null; + + /** + * CustomerEncryptionKey rsaEncryptedKey. + * @member {string|null|undefined} rsaEncryptedKey + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.rsaEncryptedKey = null; + + /** + * CustomerEncryptionKey kmsKeyName. + * @member {string|null|undefined} kmsKeyName + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyName = null; + + /** + * CustomerEncryptionKey kmsKeyServiceAccount. + * @member {string|null|undefined} kmsKeyServiceAccount + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + CustomerEncryptionKey.prototype.kmsKeyServiceAccount = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * CustomerEncryptionKey key. + * @member {"rawKey"|"rsaEncryptedKey"|"kmsKeyName"|undefined} key + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + */ + Object.defineProperty(CustomerEncryptionKey.prototype, "key", { + get: $util.oneOfGetter($oneOfFields = ["rawKey", "rsaEncryptedKey", "kmsKeyName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(CustomerEncryptionKey.prototype, "_kmsKeyServiceAccount", { + get: $util.oneOfGetter($oneOfFields = ["kmsKeyServiceAccount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new CustomerEncryptionKey instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey instance + */ + CustomerEncryptionKey.create = function create(properties) { + return new CustomerEncryptionKey(properties); + }; + + /** + * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.rawKey != null && Object.hasOwnProperty.call(message, "rawKey")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.rawKey); + if (message.rsaEncryptedKey != null && Object.hasOwnProperty.call(message, "rsaEncryptedKey")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.rsaEncryptedKey); + if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyName); + if (message.kmsKeyServiceAccount != null && Object.hasOwnProperty.call(message, "kmsKeyServiceAccount")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.kmsKeyServiceAccount); + return writer; + }; + + /** + * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + CustomerEncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.rawKey = reader.string(); + break; + } + case 2: { + message.rsaEncryptedKey = reader.string(); + break; + } + case 3: { + message.kmsKeyName = reader.string(); + break; + } + case 4: { + message.kmsKeyServiceAccount = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + CustomerEncryptionKey.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a CustomerEncryptionKey message. + * @function verify + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + CustomerEncryptionKey.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + properties.key = 1; + if (!$util.isString(message.rawKey)) + return "rawKey: string expected"; + } + if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { + if (properties.key === 1) + return "key: multiple values"; + properties.key = 1; + if (!$util.isString(message.rsaEncryptedKey)) + return "rsaEncryptedKey: string expected"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + if (properties.key === 1) + return "key: multiple values"; + properties.key = 1; + if (!$util.isString(message.kmsKeyName)) + return "kmsKeyName: string expected"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + properties._kmsKeyServiceAccount = 1; + if (!$util.isString(message.kmsKeyServiceAccount)) + return "kmsKeyServiceAccount: string expected"; + } + return null; + }; + + /** + * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey + */ + CustomerEncryptionKey.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.CustomerEncryptionKey) + return object; + var message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); + if (object.rawKey != null) + message.rawKey = String(object.rawKey); + if (object.rsaEncryptedKey != null) + message.rsaEncryptedKey = String(object.rsaEncryptedKey); + if (object.kmsKeyName != null) + message.kmsKeyName = String(object.kmsKeyName); + if (object.kmsKeyServiceAccount != null) + message.kmsKeyServiceAccount = String(object.kmsKeyServiceAccount); + return message; + }; + + /** + * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {google.cloud.backupdr.v1.CustomerEncryptionKey} message CustomerEncryptionKey + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + CustomerEncryptionKey.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.rawKey != null && message.hasOwnProperty("rawKey")) { + object.rawKey = message.rawKey; + if (options.oneofs) + object.key = "rawKey"; + } + if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { + object.rsaEncryptedKey = message.rsaEncryptedKey; + if (options.oneofs) + object.key = "rsaEncryptedKey"; + } + if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { + object.kmsKeyName = message.kmsKeyName; + if (options.oneofs) + object.key = "kmsKeyName"; + } + if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { + object.kmsKeyServiceAccount = message.kmsKeyServiceAccount; + if (options.oneofs) + object._kmsKeyServiceAccount = "kmsKeyServiceAccount"; + } + return object; + }; + + /** + * Converts this CustomerEncryptionKey to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @instance + * @returns {Object.} JSON object + */ + CustomerEncryptionKey.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for CustomerEncryptionKey + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + CustomerEncryptionKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.CustomerEncryptionKey"; + }; + + return CustomerEncryptionKey; + })(); + + v1.Entry = (function() { + + /** + * Properties of an Entry. + * @memberof google.cloud.backupdr.v1 + * @interface IEntry + * @property {string|null} [key] Entry key + * @property {string|null} [value] Entry value + */ + + /** + * Constructs a new Entry. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an Entry. + * @implements IEntry + * @constructor + * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set + */ + function Entry(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Entry key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Entry.prototype.key = null; + + /** + * Entry value. + * @member {string|null|undefined} value + * @memberof google.cloud.backupdr.v1.Entry + * @instance + */ + Entry.prototype.value = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Entry.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Entry.prototype, "_value", { + get: $util.oneOfGetter($oneOfFields = ["value"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Entry instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Entry} Entry instance + */ + Entry.create = function create(properties) { + return new Entry(properties); + }; + + /** + * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + return writer; + }; + + /** + * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Entry.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Entry message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Entry(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.value = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Entry message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Entry} Entry + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Entry.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Entry message. + * @function verify + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Entry.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.value != null && message.hasOwnProperty("value")) { + properties._value = 1; + if (!$util.isString(message.value)) + return "value: string expected"; + } + return null; + }; + + /** + * Creates an Entry message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Entry} Entry + */ + Entry.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Entry) + return object; + var message = new $root.google.cloud.backupdr.v1.Entry(); + if (object.key != null) + message.key = String(object.key); + if (object.value != null) + message.value = String(object.value); + return message; + }; + + /** + * Creates a plain object from an Entry message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {google.cloud.backupdr.v1.Entry} message Entry + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Entry.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.value != null && message.hasOwnProperty("value")) { + object.value = message.value; + if (options.oneofs) + object._value = "value"; + } + return object; + }; + + /** + * Converts this Entry to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Entry + * @instance + * @returns {Object.} JSON object + */ + Entry.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Entry + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Entry + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Entry"; + }; + + return Entry; + })(); + + v1.Metadata = (function() { + + /** + * Properties of a Metadata. + * @memberof google.cloud.backupdr.v1 + * @interface IMetadata + * @property {Array.|null} [items] Metadata items + */ + + /** + * Constructs a new Metadata. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Metadata. + * @implements IMetadata + * @constructor + * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set + */ + function Metadata(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Metadata items. + * @member {Array.} items + * @memberof google.cloud.backupdr.v1.Metadata + * @instance + */ + Metadata.prototype.items = $util.emptyArray; + + /** + * Creates a new Metadata instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Metadata} Metadata instance + */ + Metadata.create = function create(properties) { + return new Metadata(properties); + }; + + /** + * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + $root.google.cloud.backupdr.v1.Entry.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Metadata.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Metadata message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Metadata(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push($root.google.cloud.backupdr.v1.Entry.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Metadata message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Metadata.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Metadata message. + * @function verify + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Metadata.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Entry.verify(message.items[i]); + if (error) + return "items." + error; + } + } + return null; + }; + + /** + * Creates a Metadata message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Metadata} Metadata + */ + Metadata.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Metadata) + return object; + var message = new $root.google.cloud.backupdr.v1.Metadata(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.backupdr.v1.Metadata.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) { + if (typeof object.items[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Metadata.items: object expected"); + message.items[i] = $root.google.cloud.backupdr.v1.Entry.fromObject(object.items[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a Metadata message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {google.cloud.backupdr.v1.Metadata} message Metadata + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Metadata.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = $root.google.cloud.backupdr.v1.Entry.toObject(message.items[j], options); + } + return object; + }; + + /** + * Converts this Metadata to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Metadata + * @instance + * @returns {Object.} JSON object + */ + Metadata.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Metadata + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Metadata + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Metadata"; + }; + + return Metadata; + })(); + + v1.NetworkInterface = (function() { + + /** + * Properties of a NetworkInterface. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkInterface + * @property {string|null} [network] NetworkInterface network + * @property {string|null} [subnetwork] NetworkInterface subnetwork + * @property {string|null} [ipAddress] NetworkInterface ipAddress + * @property {string|null} [ipv6Address] NetworkInterface ipv6Address + * @property {number|null} [internalIpv6PrefixLength] NetworkInterface internalIpv6PrefixLength + * @property {string|null} [name] NetworkInterface name + * @property {Array.|null} [accessConfigs] NetworkInterface accessConfigs + * @property {Array.|null} [ipv6AccessConfigs] NetworkInterface ipv6AccessConfigs + * @property {Array.|null} [aliasIpRanges] NetworkInterface aliasIpRanges + * @property {google.cloud.backupdr.v1.NetworkInterface.StackType|null} [stackType] NetworkInterface stackType + * @property {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null} [ipv6AccessType] NetworkInterface ipv6AccessType + * @property {number|null} [queueCount] NetworkInterface queueCount + * @property {google.cloud.backupdr.v1.NetworkInterface.NicType|null} [nicType] NetworkInterface nicType + * @property {string|null} [networkAttachment] NetworkInterface networkAttachment + */ + + /** + * Constructs a new NetworkInterface. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkInterface. + * @implements INetworkInterface + * @constructor + * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set + */ + function NetworkInterface(properties) { + this.accessConfigs = []; + this.ipv6AccessConfigs = []; + this.aliasIpRanges = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkInterface network. + * @member {string|null|undefined} network + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.network = null; + + /** + * NetworkInterface subnetwork. + * @member {string|null|undefined} subnetwork + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.subnetwork = null; + + /** + * NetworkInterface ipAddress. + * @member {string|null|undefined} ipAddress + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipAddress = null; + + /** + * NetworkInterface ipv6Address. + * @member {string|null|undefined} ipv6Address + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6Address = null; + + /** + * NetworkInterface internalIpv6PrefixLength. + * @member {number|null|undefined} internalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.internalIpv6PrefixLength = null; + + /** + * NetworkInterface name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.name = null; + + /** + * NetworkInterface accessConfigs. + * @member {Array.} accessConfigs + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.accessConfigs = $util.emptyArray; + + /** + * NetworkInterface ipv6AccessConfigs. + * @member {Array.} ipv6AccessConfigs + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6AccessConfigs = $util.emptyArray; + + /** + * NetworkInterface aliasIpRanges. + * @member {Array.} aliasIpRanges + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.aliasIpRanges = $util.emptyArray; + + /** + * NetworkInterface stackType. + * @member {google.cloud.backupdr.v1.NetworkInterface.StackType|null|undefined} stackType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.stackType = null; + + /** + * NetworkInterface ipv6AccessType. + * @member {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null|undefined} ipv6AccessType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.ipv6AccessType = null; + + /** + * NetworkInterface queueCount. + * @member {number|null|undefined} queueCount + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.queueCount = null; + + /** + * NetworkInterface nicType. + * @member {google.cloud.backupdr.v1.NetworkInterface.NicType|null|undefined} nicType + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.nicType = null; + + /** + * NetworkInterface networkAttachment. + * @member {string|null|undefined} networkAttachment + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + */ + NetworkInterface.prototype.networkAttachment = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_network", { + get: $util.oneOfGetter($oneOfFields = ["network"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_subnetwork", { + get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_ipAddress", { + get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_ipv6Address", { + get: $util.oneOfGetter($oneOfFields = ["ipv6Address"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_internalIpv6PrefixLength", { + get: $util.oneOfGetter($oneOfFields = ["internalIpv6PrefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_stackType", { + get: $util.oneOfGetter($oneOfFields = ["stackType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_ipv6AccessType", { + get: $util.oneOfGetter($oneOfFields = ["ipv6AccessType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_queueCount", { + get: $util.oneOfGetter($oneOfFields = ["queueCount"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_nicType", { + get: $util.oneOfGetter($oneOfFields = ["nicType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkInterface.prototype, "_networkAttachment", { + get: $util.oneOfGetter($oneOfFields = ["networkAttachment"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkInterface instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface instance + */ + NetworkInterface.create = function create(properties) { + return new NetworkInterface(properties); + }; + + /** + * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.network != null && Object.hasOwnProperty.call(message, "network")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); + if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); + if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); + if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipv6Address); + if (message.internalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "internalIpv6PrefixLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.internalIpv6PrefixLength); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); + if (message.accessConfigs != null && message.accessConfigs.length) + for (var i = 0; i < message.accessConfigs.length; ++i) + $root.google.cloud.backupdr.v1.AccessConfig.encode(message.accessConfigs[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.ipv6AccessConfigs != null && message.ipv6AccessConfigs.length) + for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) + $root.google.cloud.backupdr.v1.AccessConfig.encode(message.ipv6AccessConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.aliasIpRanges != null && message.aliasIpRanges.length) + for (var i = 0; i < message.aliasIpRanges.length; ++i) + $root.google.cloud.backupdr.v1.AliasIpRange.encode(message.aliasIpRanges[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.stackType != null && Object.hasOwnProperty.call(message, "stackType")) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.stackType); + if (message.ipv6AccessType != null && Object.hasOwnProperty.call(message, "ipv6AccessType")) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.ipv6AccessType); + if (message.queueCount != null && Object.hasOwnProperty.call(message, "queueCount")) + writer.uint32(/* id 12, wireType 0 =*/96).int32(message.queueCount); + if (message.nicType != null && Object.hasOwnProperty.call(message, "nicType")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.nicType); + if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) + writer.uint32(/* id 14, wireType 2 =*/114).string(message.networkAttachment); + return writer; + }; + + /** + * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkInterface(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.network = reader.string(); + break; + } + case 2: { + message.subnetwork = reader.string(); + break; + } + case 3: { + message.ipAddress = reader.string(); + break; + } + case 4: { + message.ipv6Address = reader.string(); + break; + } + case 5: { + message.internalIpv6PrefixLength = reader.int32(); + break; + } + case 6: { + message.name = reader.string(); + break; + } + case 7: { + if (!(message.accessConfigs && message.accessConfigs.length)) + message.accessConfigs = []; + message.accessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); + break; + } + case 8: { + if (!(message.ipv6AccessConfigs && message.ipv6AccessConfigs.length)) + message.ipv6AccessConfigs = []; + message.ipv6AccessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); + break; + } + case 9: { + if (!(message.aliasIpRanges && message.aliasIpRanges.length)) + message.aliasIpRanges = []; + message.aliasIpRanges.push($root.google.cloud.backupdr.v1.AliasIpRange.decode(reader, reader.uint32())); + break; + } + case 10: { + message.stackType = reader.int32(); + break; + } + case 11: { + message.ipv6AccessType = reader.int32(); + break; + } + case 12: { + message.queueCount = reader.int32(); + break; + } + case 13: { + message.nicType = reader.int32(); + break; + } + case 14: { + message.networkAttachment = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkInterface.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkInterface message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkInterface.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.network != null && message.hasOwnProperty("network")) { + properties._network = 1; + if (!$util.isString(message.network)) + return "network: string expected"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + properties._subnetwork = 1; + if (!$util.isString(message.subnetwork)) + return "subnetwork: string expected"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + properties._ipAddress = 1; + if (!$util.isString(message.ipAddress)) + return "ipAddress: string expected"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + properties._ipv6Address = 1; + if (!$util.isString(message.ipv6Address)) + return "ipv6Address: string expected"; + } + if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { + properties._internalIpv6PrefixLength = 1; + if (!$util.isInteger(message.internalIpv6PrefixLength)) + return "internalIpv6PrefixLength: integer expected"; + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.accessConfigs != null && message.hasOwnProperty("accessConfigs")) { + if (!Array.isArray(message.accessConfigs)) + return "accessConfigs: array expected"; + for (var i = 0; i < message.accessConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.accessConfigs[i]); + if (error) + return "accessConfigs." + error; + } + } + if (message.ipv6AccessConfigs != null && message.hasOwnProperty("ipv6AccessConfigs")) { + if (!Array.isArray(message.ipv6AccessConfigs)) + return "ipv6AccessConfigs: array expected"; + for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.ipv6AccessConfigs[i]); + if (error) + return "ipv6AccessConfigs." + error; + } + } + if (message.aliasIpRanges != null && message.hasOwnProperty("aliasIpRanges")) { + if (!Array.isArray(message.aliasIpRanges)) + return "aliasIpRanges: array expected"; + for (var i = 0; i < message.aliasIpRanges.length; ++i) { + var error = $root.google.cloud.backupdr.v1.AliasIpRange.verify(message.aliasIpRanges[i]); + if (error) + return "aliasIpRanges." + error; + } + } + if (message.stackType != null && message.hasOwnProperty("stackType")) { + properties._stackType = 1; + switch (message.stackType) { + default: + return "stackType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { + properties._ipv6AccessType = 1; + switch (message.ipv6AccessType) { + default: + return "ipv6AccessType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.queueCount != null && message.hasOwnProperty("queueCount")) { + properties._queueCount = 1; + if (!$util.isInteger(message.queueCount)) + return "queueCount: integer expected"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + properties._nicType = 1; + switch (message.nicType) { + default: + return "nicType: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { + properties._networkAttachment = 1; + if (!$util.isString(message.networkAttachment)) + return "networkAttachment: string expected"; + } + return null; + }; + + /** + * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface + */ + NetworkInterface.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkInterface) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkInterface(); + if (object.network != null) + message.network = String(object.network); + if (object.subnetwork != null) + message.subnetwork = String(object.subnetwork); + if (object.ipAddress != null) + message.ipAddress = String(object.ipAddress); + if (object.ipv6Address != null) + message.ipv6Address = String(object.ipv6Address); + if (object.internalIpv6PrefixLength != null) + message.internalIpv6PrefixLength = object.internalIpv6PrefixLength | 0; + if (object.name != null) + message.name = String(object.name); + if (object.accessConfigs) { + if (!Array.isArray(object.accessConfigs)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: array expected"); + message.accessConfigs = []; + for (var i = 0; i < object.accessConfigs.length; ++i) { + if (typeof object.accessConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: object expected"); + message.accessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.accessConfigs[i]); + } + } + if (object.ipv6AccessConfigs) { + if (!Array.isArray(object.ipv6AccessConfigs)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: array expected"); + message.ipv6AccessConfigs = []; + for (var i = 0; i < object.ipv6AccessConfigs.length; ++i) { + if (typeof object.ipv6AccessConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: object expected"); + message.ipv6AccessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.ipv6AccessConfigs[i]); + } + } + if (object.aliasIpRanges) { + if (!Array.isArray(object.aliasIpRanges)) + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: array expected"); + message.aliasIpRanges = []; + for (var i = 0; i < object.aliasIpRanges.length; ++i) { + if (typeof object.aliasIpRanges[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: object expected"); + message.aliasIpRanges[i] = $root.google.cloud.backupdr.v1.AliasIpRange.fromObject(object.aliasIpRanges[i]); + } + } + switch (object.stackType) { + default: + if (typeof object.stackType === "number") { + message.stackType = object.stackType; + break; + } + break; + case "STACK_TYPE_UNSPECIFIED": + case 0: + message.stackType = 0; + break; + case "IPV4_ONLY": + case 1: + message.stackType = 1; + break; + case "IPV4_IPV6": + case 2: + message.stackType = 2; + break; + } + switch (object.ipv6AccessType) { + default: + if (typeof object.ipv6AccessType === "number") { + message.ipv6AccessType = object.ipv6AccessType; + break; + } + break; + case "UNSPECIFIED_IPV6_ACCESS_TYPE": + case 0: + message.ipv6AccessType = 0; + break; + case "INTERNAL": + case 1: + message.ipv6AccessType = 1; + break; + case "EXTERNAL": + case 2: + message.ipv6AccessType = 2; + break; + } + if (object.queueCount != null) + message.queueCount = object.queueCount | 0; + switch (object.nicType) { + default: + if (typeof object.nicType === "number") { + message.nicType = object.nicType; + break; + } + break; + case "NIC_TYPE_UNSPECIFIED": + case 0: + message.nicType = 0; + break; + case "VIRTIO_NET": + case 1: + message.nicType = 1; + break; + case "GVNIC": + case 2: + message.nicType = 2; + break; + } + if (object.networkAttachment != null) + message.networkAttachment = String(object.networkAttachment); + return message; + }; + + /** + * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {google.cloud.backupdr.v1.NetworkInterface} message NetworkInterface + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkInterface.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.accessConfigs = []; + object.ipv6AccessConfigs = []; + object.aliasIpRanges = []; + } + if (message.network != null && message.hasOwnProperty("network")) { + object.network = message.network; + if (options.oneofs) + object._network = "network"; + } + if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { + object.subnetwork = message.subnetwork; + if (options.oneofs) + object._subnetwork = "subnetwork"; + } + if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { + object.ipAddress = message.ipAddress; + if (options.oneofs) + object._ipAddress = "ipAddress"; + } + if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { + object.ipv6Address = message.ipv6Address; + if (options.oneofs) + object._ipv6Address = "ipv6Address"; + } + if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { + object.internalIpv6PrefixLength = message.internalIpv6PrefixLength; + if (options.oneofs) + object._internalIpv6PrefixLength = "internalIpv6PrefixLength"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.accessConfigs && message.accessConfigs.length) { + object.accessConfigs = []; + for (var j = 0; j < message.accessConfigs.length; ++j) + object.accessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.accessConfigs[j], options); + } + if (message.ipv6AccessConfigs && message.ipv6AccessConfigs.length) { + object.ipv6AccessConfigs = []; + for (var j = 0; j < message.ipv6AccessConfigs.length; ++j) + object.ipv6AccessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.ipv6AccessConfigs[j], options); + } + if (message.aliasIpRanges && message.aliasIpRanges.length) { + object.aliasIpRanges = []; + for (var j = 0; j < message.aliasIpRanges.length; ++j) + object.aliasIpRanges[j] = $root.google.cloud.backupdr.v1.AliasIpRange.toObject(message.aliasIpRanges[j], options); + } + if (message.stackType != null && message.hasOwnProperty("stackType")) { + object.stackType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] === undefined ? message.stackType : $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] : message.stackType; + if (options.oneofs) + object._stackType = "stackType"; + } + if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { + object.ipv6AccessType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] === undefined ? message.ipv6AccessType : $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] : message.ipv6AccessType; + if (options.oneofs) + object._ipv6AccessType = "ipv6AccessType"; + } + if (message.queueCount != null && message.hasOwnProperty("queueCount")) { + object.queueCount = message.queueCount; + if (options.oneofs) + object._queueCount = "queueCount"; + } + if (message.nicType != null && message.hasOwnProperty("nicType")) { + object.nicType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] === undefined ? message.nicType : $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] : message.nicType; + if (options.oneofs) + object._nicType = "nicType"; + } + if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { + object.networkAttachment = message.networkAttachment; + if (options.oneofs) + object._networkAttachment = "networkAttachment"; + } + return object; + }; + + /** + * Converts this NetworkInterface to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @instance + * @returns {Object.} JSON object + */ + NetworkInterface.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkInterface + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkInterface + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkInterface"; + }; + + /** + * StackType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.StackType + * @enum {number} + * @property {number} STACK_TYPE_UNSPECIFIED=0 STACK_TYPE_UNSPECIFIED value + * @property {number} IPV4_ONLY=1 IPV4_ONLY value + * @property {number} IPV4_IPV6=2 IPV4_IPV6 value + */ + NetworkInterface.StackType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STACK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "IPV4_ONLY"] = 1; + values[valuesById[2] = "IPV4_IPV6"] = 2; + return values; + })(); + + /** + * Ipv6AccessType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType + * @enum {number} + * @property {number} UNSPECIFIED_IPV6_ACCESS_TYPE=0 UNSPECIFIED_IPV6_ACCESS_TYPE value + * @property {number} INTERNAL=1 INTERNAL value + * @property {number} EXTERNAL=2 EXTERNAL value + */ + NetworkInterface.Ipv6AccessType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "UNSPECIFIED_IPV6_ACCESS_TYPE"] = 0; + values[valuesById[1] = "INTERNAL"] = 1; + values[valuesById[2] = "EXTERNAL"] = 2; + return values; + })(); + + /** + * NicType enum. + * @name google.cloud.backupdr.v1.NetworkInterface.NicType + * @enum {number} + * @property {number} NIC_TYPE_UNSPECIFIED=0 NIC_TYPE_UNSPECIFIED value + * @property {number} VIRTIO_NET=1 VIRTIO_NET value + * @property {number} GVNIC=2 GVNIC value + */ + NetworkInterface.NicType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NIC_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTIO_NET"] = 1; + values[valuesById[2] = "GVNIC"] = 2; + return values; + })(); + + return NetworkInterface; + })(); + + v1.NetworkPerformanceConfig = (function() { + + /** + * Properties of a NetworkPerformanceConfig. + * @memberof google.cloud.backupdr.v1 + * @interface INetworkPerformanceConfig + * @property {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null} [totalEgressBandwidthTier] NetworkPerformanceConfig totalEgressBandwidthTier + */ + + /** + * Constructs a new NetworkPerformanceConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a NetworkPerformanceConfig. + * @implements INetworkPerformanceConfig + * @constructor + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set + */ + function NetworkPerformanceConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * NetworkPerformanceConfig totalEgressBandwidthTier. + * @member {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null|undefined} totalEgressBandwidthTier + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + */ + NetworkPerformanceConfig.prototype.totalEgressBandwidthTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NetworkPerformanceConfig.prototype, "_totalEgressBandwidthTier", { + get: $util.oneOfGetter($oneOfFields = ["totalEgressBandwidthTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NetworkPerformanceConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig instance + */ + NetworkPerformanceConfig.create = function create(properties) { + return new NetworkPerformanceConfig(properties); + }; + + /** + * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPerformanceConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.totalEgressBandwidthTier != null && Object.hasOwnProperty.call(message, "totalEgressBandwidthTier")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalEgressBandwidthTier); + return writer; + }; + + /** + * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkPerformanceConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPerformanceConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.totalEgressBandwidthTier = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkPerformanceConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkPerformanceConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkPerformanceConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { + properties._totalEgressBandwidthTier = 1; + switch (message.totalEgressBandwidthTier) { + default: + return "totalEgressBandwidthTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig + */ + NetworkPerformanceConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.NetworkPerformanceConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); + switch (object.totalEgressBandwidthTier) { + default: + if (typeof object.totalEgressBandwidthTier === "number") { + message.totalEgressBandwidthTier = object.totalEgressBandwidthTier; + break; + } + break; + case "TIER_UNSPECIFIED": + case 0: + message.totalEgressBandwidthTier = 0; + break; + case "DEFAULT": + case 1: + message.totalEgressBandwidthTier = 1; + break; + case "TIER_1": + case 2: + message.totalEgressBandwidthTier = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {google.cloud.backupdr.v1.NetworkPerformanceConfig} message NetworkPerformanceConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkPerformanceConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { + object.totalEgressBandwidthTier = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] === undefined ? message.totalEgressBandwidthTier : $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] : message.totalEgressBandwidthTier; + if (options.oneofs) + object._totalEgressBandwidthTier = "totalEgressBandwidthTier"; + } + return object; + }; + + /** + * Converts this NetworkPerformanceConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @instance + * @returns {Object.} JSON object + */ + NetworkPerformanceConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NetworkPerformanceConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NetworkPerformanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkPerformanceConfig"; + }; + + /** + * Tier enum. + * @name google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier + * @enum {number} + * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value + * @property {number} DEFAULT=1 DEFAULT value + * @property {number} TIER_1=2 TIER_1 value + */ + NetworkPerformanceConfig.Tier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "DEFAULT"] = 1; + values[valuesById[2] = "TIER_1"] = 2; + return values; + })(); + + return NetworkPerformanceConfig; + })(); + + v1.AccessConfig = (function() { + + /** + * Properties of an AccessConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IAccessConfig + * @property {google.cloud.backupdr.v1.AccessConfig.AccessType|null} [type] AccessConfig type + * @property {string|null} [name] AccessConfig name + * @property {string|null} [externalIp] AccessConfig externalIp + * @property {string|null} [externalIpv6] AccessConfig externalIpv6 + * @property {number|null} [externalIpv6PrefixLength] AccessConfig externalIpv6PrefixLength + * @property {boolean|null} [setPublicPtr] AccessConfig setPublicPtr + * @property {string|null} [publicPtrDomainName] AccessConfig publicPtrDomainName + * @property {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null} [networkTier] AccessConfig networkTier + */ + + /** + * Constructs a new AccessConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AccessConfig. + * @implements IAccessConfig + * @constructor + * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set + */ + function AccessConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AccessConfig type. + * @member {google.cloud.backupdr.v1.AccessConfig.AccessType|null|undefined} type + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.type = null; + + /** + * AccessConfig name. + * @member {string|null|undefined} name + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.name = null; + + /** + * AccessConfig externalIp. + * @member {string|null|undefined} externalIp + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIp = null; + + /** + * AccessConfig externalIpv6. + * @member {string|null|undefined} externalIpv6 + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIpv6 = null; + + /** + * AccessConfig externalIpv6PrefixLength. + * @member {number|null|undefined} externalIpv6PrefixLength + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.externalIpv6PrefixLength = null; + + /** + * AccessConfig setPublicPtr. + * @member {boolean|null|undefined} setPublicPtr + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.setPublicPtr = null; + + /** + * AccessConfig publicPtrDomainName. + * @member {string|null|undefined} publicPtrDomainName + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.publicPtrDomainName = null; + + /** + * AccessConfig networkTier. + * @member {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null|undefined} networkTier + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + */ + AccessConfig.prototype.networkTier = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_name", { + get: $util.oneOfGetter($oneOfFields = ["name"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_externalIp", { + get: $util.oneOfGetter($oneOfFields = ["externalIp"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_externalIpv6", { + get: $util.oneOfGetter($oneOfFields = ["externalIpv6"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_externalIpv6PrefixLength", { + get: $util.oneOfGetter($oneOfFields = ["externalIpv6PrefixLength"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_setPublicPtr", { + get: $util.oneOfGetter($oneOfFields = ["setPublicPtr"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_publicPtrDomainName", { + get: $util.oneOfGetter($oneOfFields = ["publicPtrDomainName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AccessConfig.prototype, "_networkTier", { + get: $util.oneOfGetter($oneOfFields = ["networkTier"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AccessConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig instance + */ + AccessConfig.create = function create(properties) { + return new AccessConfig(properties); + }; + + /** + * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); + if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalIp); + if (message.externalIpv6 != null && Object.hasOwnProperty.call(message, "externalIpv6")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.externalIpv6); + if (message.externalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "externalIpv6PrefixLength")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.externalIpv6PrefixLength); + if (message.setPublicPtr != null && Object.hasOwnProperty.call(message, "setPublicPtr")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.setPublicPtr); + if (message.publicPtrDomainName != null && Object.hasOwnProperty.call(message, "publicPtrDomainName")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.publicPtrDomainName); + if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) + writer.uint32(/* id 8, wireType 0 =*/64).int32(message.networkTier); + return writer; + }; + + /** + * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AccessConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AccessConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.name = reader.string(); + break; + } + case 3: { + message.externalIp = reader.string(); + break; + } + case 4: { + message.externalIpv6 = reader.string(); + break; + } + case 5: { + message.externalIpv6PrefixLength = reader.int32(); + break; + } + case 6: { + message.setPublicPtr = reader.bool(); + break; + } + case 7: { + message.publicPtrDomainName = reader.string(); + break; + } + case 8: { + message.networkTier = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AccessConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AccessConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AccessConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AccessConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.name != null && message.hasOwnProperty("name")) { + properties._name = 1; + if (!$util.isString(message.name)) + return "name: string expected"; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + properties._externalIp = 1; + if (!$util.isString(message.externalIp)) + return "externalIp: string expected"; + } + if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { + properties._externalIpv6 = 1; + if (!$util.isString(message.externalIpv6)) + return "externalIpv6: string expected"; + } + if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { + properties._externalIpv6PrefixLength = 1; + if (!$util.isInteger(message.externalIpv6PrefixLength)) + return "externalIpv6PrefixLength: integer expected"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + properties._setPublicPtr = 1; + if (typeof message.setPublicPtr !== "boolean") + return "setPublicPtr: boolean expected"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + properties._publicPtrDomainName = 1; + if (!$util.isString(message.publicPtrDomainName)) + return "publicPtrDomainName: string expected"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + properties._networkTier = 1; + switch (message.networkTier) { + default: + return "networkTier: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig + */ + AccessConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AccessConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.AccessConfig(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "ACCESS_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ONE_TO_ONE_NAT": + case 1: + message.type = 1; + break; + case "DIRECT_IPV6": + case 2: + message.type = 2; + break; + } + if (object.name != null) + message.name = String(object.name); + if (object.externalIp != null) + message.externalIp = String(object.externalIp); + if (object.externalIpv6 != null) + message.externalIpv6 = String(object.externalIpv6); + if (object.externalIpv6PrefixLength != null) + message.externalIpv6PrefixLength = object.externalIpv6PrefixLength | 0; + if (object.setPublicPtr != null) + message.setPublicPtr = Boolean(object.setPublicPtr); + if (object.publicPtrDomainName != null) + message.publicPtrDomainName = String(object.publicPtrDomainName); + switch (object.networkTier) { + default: + if (typeof object.networkTier === "number") { + message.networkTier = object.networkTier; + break; + } + break; + case "NETWORK_TIER_UNSPECIFIED": + case 0: + message.networkTier = 0; + break; + case "PREMIUM": + case 1: + message.networkTier = 1; + break; + case "STANDARD": + case 2: + message.networkTier = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {google.cloud.backupdr.v1.AccessConfig} message AccessConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AccessConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + if (message.name != null && message.hasOwnProperty("name")) { + object.name = message.name; + if (options.oneofs) + object._name = "name"; + } + if (message.externalIp != null && message.hasOwnProperty("externalIp")) { + object.externalIp = message.externalIp; + if (options.oneofs) + object._externalIp = "externalIp"; + } + if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { + object.externalIpv6 = message.externalIpv6; + if (options.oneofs) + object._externalIpv6 = "externalIpv6"; + } + if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { + object.externalIpv6PrefixLength = message.externalIpv6PrefixLength; + if (options.oneofs) + object._externalIpv6PrefixLength = "externalIpv6PrefixLength"; + } + if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { + object.setPublicPtr = message.setPublicPtr; + if (options.oneofs) + object._setPublicPtr = "setPublicPtr"; + } + if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { + object.publicPtrDomainName = message.publicPtrDomainName; + if (options.oneofs) + object._publicPtrDomainName = "publicPtrDomainName"; + } + if (message.networkTier != null && message.hasOwnProperty("networkTier")) { + object.networkTier = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] === undefined ? message.networkTier : $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] : message.networkTier; + if (options.oneofs) + object._networkTier = "networkTier"; + } + return object; + }; + + /** + * Converts this AccessConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AccessConfig + * @instance + * @returns {Object.} JSON object + */ + AccessConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AccessConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AccessConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AccessConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AccessConfig"; + }; + + /** + * AccessType enum. + * @name google.cloud.backupdr.v1.AccessConfig.AccessType + * @enum {number} + * @property {number} ACCESS_TYPE_UNSPECIFIED=0 ACCESS_TYPE_UNSPECIFIED value + * @property {number} ONE_TO_ONE_NAT=1 ONE_TO_ONE_NAT value + * @property {number} DIRECT_IPV6=2 DIRECT_IPV6 value + */ + AccessConfig.AccessType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ACCESS_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ONE_TO_ONE_NAT"] = 1; + values[valuesById[2] = "DIRECT_IPV6"] = 2; + return values; + })(); + + /** + * NetworkTier enum. + * @name google.cloud.backupdr.v1.AccessConfig.NetworkTier + * @enum {number} + * @property {number} NETWORK_TIER_UNSPECIFIED=0 NETWORK_TIER_UNSPECIFIED value + * @property {number} PREMIUM=1 PREMIUM value + * @property {number} STANDARD=2 STANDARD value + */ + AccessConfig.NetworkTier = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "NETWORK_TIER_UNSPECIFIED"] = 0; + values[valuesById[1] = "PREMIUM"] = 1; + values[valuesById[2] = "STANDARD"] = 2; + return values; + })(); + + return AccessConfig; + })(); + + v1.AliasIpRange = (function() { + + /** + * Properties of an AliasIpRange. + * @memberof google.cloud.backupdr.v1 + * @interface IAliasIpRange + * @property {string|null} [ipCidrRange] AliasIpRange ipCidrRange + * @property {string|null} [subnetworkRangeName] AliasIpRange subnetworkRangeName + */ + + /** + * Constructs a new AliasIpRange. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AliasIpRange. + * @implements IAliasIpRange + * @constructor + * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set + */ + function AliasIpRange(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AliasIpRange ipCidrRange. + * @member {string|null|undefined} ipCidrRange + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.ipCidrRange = null; + + /** + * AliasIpRange subnetworkRangeName. + * @member {string|null|undefined} subnetworkRangeName + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + */ + AliasIpRange.prototype.subnetworkRangeName = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AliasIpRange.prototype, "_ipCidrRange", { + get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AliasIpRange.prototype, "_subnetworkRangeName", { + get: $util.oneOfGetter($oneOfFields = ["subnetworkRangeName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AliasIpRange instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange instance + */ + AliasIpRange.create = function create(properties) { + return new AliasIpRange(properties); + }; + + /** + * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipCidrRange); + if (message.subnetworkRangeName != null && Object.hasOwnProperty.call(message, "subnetworkRangeName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetworkRangeName); + return writer; + }; + + /** + * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AliasIpRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AliasIpRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ipCidrRange = reader.string(); + break; + } + case 2: { + message.subnetworkRangeName = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AliasIpRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AliasIpRange message. + * @function verify + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AliasIpRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + properties._ipCidrRange = 1; + if (!$util.isString(message.ipCidrRange)) + return "ipCidrRange: string expected"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + properties._subnetworkRangeName = 1; + if (!$util.isString(message.subnetworkRangeName)) + return "subnetworkRangeName: string expected"; + } + return null; + }; + + /** + * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange + */ + AliasIpRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AliasIpRange) + return object; + var message = new $root.google.cloud.backupdr.v1.AliasIpRange(); + if (object.ipCidrRange != null) + message.ipCidrRange = String(object.ipCidrRange); + if (object.subnetworkRangeName != null) + message.subnetworkRangeName = String(object.subnetworkRangeName); + return message; + }; + + /** + * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {google.cloud.backupdr.v1.AliasIpRange} message AliasIpRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AliasIpRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { + object.ipCidrRange = message.ipCidrRange; + if (options.oneofs) + object._ipCidrRange = "ipCidrRange"; + } + if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { + object.subnetworkRangeName = message.subnetworkRangeName; + if (options.oneofs) + object._subnetworkRangeName = "subnetworkRangeName"; + } + return object; + }; + + /** + * Converts this AliasIpRange to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @instance + * @returns {Object.} JSON object + */ + AliasIpRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AliasIpRange + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AliasIpRange + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AliasIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AliasIpRange"; + }; + + return AliasIpRange; + })(); + + v1.InstanceParams = (function() { + + /** + * Properties of an InstanceParams. + * @memberof google.cloud.backupdr.v1 + * @interface IInstanceParams + * @property {Object.|null} [resourceManagerTags] InstanceParams resourceManagerTags + */ + + /** + * Constructs a new InstanceParams. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an InstanceParams. + * @implements IInstanceParams + * @constructor + * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set + */ + function InstanceParams(properties) { + this.resourceManagerTags = {}; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InstanceParams resourceManagerTags. + * @member {Object.} resourceManagerTags + * @memberof google.cloud.backupdr.v1.InstanceParams + * @instance + */ + InstanceParams.prototype.resourceManagerTags = $util.emptyObject; + + /** + * Creates a new InstanceParams instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams instance + */ + InstanceParams.create = function create(properties) { + return new InstanceParams(properties); + }; + + /** + * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceManagerTags != null && Object.hasOwnProperty.call(message, "resourceManagerTags")) + for (var keys = Object.keys(message.resourceManagerTags), 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.resourceManagerTags[keys[i]]).ldelim(); + return writer; + }; + + /** + * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InstanceParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InstanceParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceParams.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InstanceParams(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (message.resourceManagerTags === $util.emptyObject) + message.resourceManagerTags = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.resourceManagerTags[key] = value; + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InstanceParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InstanceParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InstanceParams message. + * @function verify + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InstanceParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceManagerTags != null && message.hasOwnProperty("resourceManagerTags")) { + if (!$util.isObject(message.resourceManagerTags)) + return "resourceManagerTags: object expected"; + var key = Object.keys(message.resourceManagerTags); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.resourceManagerTags[key[i]])) + return "resourceManagerTags: string{k:string} expected"; + } + return null; + }; + + /** + * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams + */ + InstanceParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.InstanceParams) + return object; + var message = new $root.google.cloud.backupdr.v1.InstanceParams(); + if (object.resourceManagerTags) { + if (typeof object.resourceManagerTags !== "object") + throw TypeError(".google.cloud.backupdr.v1.InstanceParams.resourceManagerTags: object expected"); + message.resourceManagerTags = {}; + for (var keys = Object.keys(object.resourceManagerTags), i = 0; i < keys.length; ++i) + message.resourceManagerTags[keys[i]] = String(object.resourceManagerTags[keys[i]]); + } + return message; + }; + + /** + * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {google.cloud.backupdr.v1.InstanceParams} message InstanceParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InstanceParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.objects || options.defaults) + object.resourceManagerTags = {}; + var keys2; + if (message.resourceManagerTags && (keys2 = Object.keys(message.resourceManagerTags)).length) { + object.resourceManagerTags = {}; + for (var j = 0; j < keys2.length; ++j) + object.resourceManagerTags[keys2[j]] = message.resourceManagerTags[keys2[j]]; + } + return object; + }; + + /** + * Converts this InstanceParams to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.InstanceParams + * @instance + * @returns {Object.} JSON object + */ + InstanceParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InstanceParams + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.InstanceParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InstanceParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.InstanceParams"; + }; + + return InstanceParams; + })(); + + v1.AllocationAffinity = (function() { + + /** + * Properties of an AllocationAffinity. + * @memberof google.cloud.backupdr.v1 + * @interface IAllocationAffinity + * @property {google.cloud.backupdr.v1.AllocationAffinity.Type|null} [consumeAllocationType] AllocationAffinity consumeAllocationType + * @property {string|null} [key] AllocationAffinity key + * @property {Array.|null} [values] AllocationAffinity values + */ + + /** + * Constructs a new AllocationAffinity. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AllocationAffinity. + * @implements IAllocationAffinity + * @constructor + * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set + */ + function AllocationAffinity(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]]; + } + + /** + * AllocationAffinity consumeAllocationType. + * @member {google.cloud.backupdr.v1.AllocationAffinity.Type|null|undefined} consumeAllocationType + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.consumeAllocationType = null; + + /** + * AllocationAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.key = null; + + /** + * AllocationAffinity values. + * @member {Array.} values + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + */ + AllocationAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AllocationAffinity.prototype, "_consumeAllocationType", { + get: $util.oneOfGetter($oneOfFields = ["consumeAllocationType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AllocationAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AllocationAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity instance + */ + AllocationAffinity.create = function create(properties) { + return new AllocationAffinity(properties); + }; + + /** + * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.consumeAllocationType != null && Object.hasOwnProperty.call(message, "consumeAllocationType")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumeAllocationType); + 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 AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AllocationAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AllocationAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationAffinity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.consumeAllocationType = 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 an AllocationAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AllocationAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AllocationAffinity message. + * @function verify + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AllocationAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { + properties._consumeAllocationType = 1; + switch (message.consumeAllocationType) { + default: + return "consumeAllocationType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + 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 an AllocationAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity + */ + AllocationAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AllocationAffinity) + return object; + var message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); + switch (object.consumeAllocationType) { + default: + if (typeof object.consumeAllocationType === "number") { + message.consumeAllocationType = object.consumeAllocationType; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.consumeAllocationType = 0; + break; + case "NO_RESERVATION": + case 1: + message.consumeAllocationType = 1; + break; + case "ANY_RESERVATION": + case 2: + message.consumeAllocationType = 2; + break; + case "SPECIFIC_RESERVATION": + case 3: + message.consumeAllocationType = 3; + break; + } + if (object.key != null) + message.key = String(object.key); + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.backupdr.v1.AllocationAffinity.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 an AllocationAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {google.cloud.backupdr.v1.AllocationAffinity} message AllocationAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AllocationAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { + object.consumeAllocationType = options.enums === String ? $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] === undefined ? message.consumeAllocationType : $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] : message.consumeAllocationType; + if (options.oneofs) + object._consumeAllocationType = "consumeAllocationType"; + } + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "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 AllocationAffinity to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @instance + * @returns {Object.} JSON object + */ + AllocationAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AllocationAffinity + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AllocationAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AllocationAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AllocationAffinity"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.AllocationAffinity.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 + */ + AllocationAffinity.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 AllocationAffinity; + })(); + + v1.Scheduling = (function() { + + /** + * Properties of a Scheduling. + * @memberof google.cloud.backupdr.v1 + * @interface IScheduling + * @property {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null} [onHostMaintenance] Scheduling onHostMaintenance + * @property {boolean|null} [automaticRestart] Scheduling automaticRestart + * @property {boolean|null} [preemptible] Scheduling preemptible + * @property {Array.|null} [nodeAffinities] Scheduling nodeAffinities + * @property {number|null} [minNodeCpus] Scheduling minNodeCpus + * @property {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null} [provisioningModel] Scheduling provisioningModel + * @property {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null} [instanceTerminationAction] Scheduling instanceTerminationAction + * @property {google.cloud.backupdr.v1.ISchedulingDuration|null} [localSsdRecoveryTimeout] Scheduling localSsdRecoveryTimeout + */ + + /** + * Constructs a new Scheduling. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Scheduling. + * @implements IScheduling + * @constructor + * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set + */ + function Scheduling(properties) { + this.nodeAffinities = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Scheduling onHostMaintenance. + * @member {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null|undefined} onHostMaintenance + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.onHostMaintenance = null; + + /** + * Scheduling automaticRestart. + * @member {boolean|null|undefined} automaticRestart + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.automaticRestart = null; + + /** + * Scheduling preemptible. + * @member {boolean|null|undefined} preemptible + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.preemptible = null; + + /** + * Scheduling nodeAffinities. + * @member {Array.} nodeAffinities + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.nodeAffinities = $util.emptyArray; + + /** + * Scheduling minNodeCpus. + * @member {number|null|undefined} minNodeCpus + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.minNodeCpus = null; + + /** + * Scheduling provisioningModel. + * @member {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null|undefined} provisioningModel + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.provisioningModel = null; + + /** + * Scheduling instanceTerminationAction. + * @member {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null|undefined} instanceTerminationAction + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.instanceTerminationAction = null; + + /** + * Scheduling localSsdRecoveryTimeout. + * @member {google.cloud.backupdr.v1.ISchedulingDuration|null|undefined} localSsdRecoveryTimeout + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + */ + Scheduling.prototype.localSsdRecoveryTimeout = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_onHostMaintenance", { + get: $util.oneOfGetter($oneOfFields = ["onHostMaintenance"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_automaticRestart", { + get: $util.oneOfGetter($oneOfFields = ["automaticRestart"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_preemptible", { + get: $util.oneOfGetter($oneOfFields = ["preemptible"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_minNodeCpus", { + get: $util.oneOfGetter($oneOfFields = ["minNodeCpus"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_provisioningModel", { + get: $util.oneOfGetter($oneOfFields = ["provisioningModel"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_instanceTerminationAction", { + get: $util.oneOfGetter($oneOfFields = ["instanceTerminationAction"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(Scheduling.prototype, "_localSsdRecoveryTimeout", { + get: $util.oneOfGetter($oneOfFields = ["localSsdRecoveryTimeout"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new Scheduling instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling instance + */ + Scheduling.create = function create(properties) { + return new Scheduling(properties); + }; + + /** + * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.onHostMaintenance); + if (message.automaticRestart != null && Object.hasOwnProperty.call(message, "automaticRestart")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.automaticRestart); + if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preemptible); + if (message.nodeAffinities != null && message.nodeAffinities.length) + for (var i = 0; i < message.nodeAffinities.length; ++i) + $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.minNodeCpus != null && Object.hasOwnProperty.call(message, "minNodeCpus")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minNodeCpus); + if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.provisioningModel); + if (message.instanceTerminationAction != null && Object.hasOwnProperty.call(message, "instanceTerminationAction")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.instanceTerminationAction); + if (message.localSsdRecoveryTimeout != null && Object.hasOwnProperty.call(message, "localSsdRecoveryTimeout")) + $root.google.cloud.backupdr.v1.SchedulingDuration.encode(message.localSsdRecoveryTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Scheduling.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.onHostMaintenance = reader.int32(); + break; + } + case 2: { + message.automaticRestart = reader.bool(); + break; + } + case 3: { + message.preemptible = reader.bool(); + break; + } + case 4: { + if (!(message.nodeAffinities && message.nodeAffinities.length)) + message.nodeAffinities = []; + message.nodeAffinities.push($root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.decode(reader, reader.uint32())); + break; + } + case 5: { + message.minNodeCpus = reader.int32(); + break; + } + case 6: { + message.provisioningModel = reader.int32(); + break; + } + case 7: { + message.instanceTerminationAction = reader.int32(); + break; + } + case 10: { + message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Scheduling message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Scheduling.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Scheduling message. + * @function verify + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Scheduling.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + properties._onHostMaintenance = 1; + switch (message.onHostMaintenance) { + default: + return "onHostMaintenance: enum value expected"; + case 0: + case 1: + case 1000: + break; + } + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + properties._automaticRestart = 1; + if (typeof message.automaticRestart !== "boolean") + return "automaticRestart: boolean expected"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + properties._preemptible = 1; + if (typeof message.preemptible !== "boolean") + return "preemptible: boolean expected"; + } + if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { + if (!Array.isArray(message.nodeAffinities)) + return "nodeAffinities: array expected"; + for (var i = 0; i < message.nodeAffinities.length; ++i) { + var error = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify(message.nodeAffinities[i]); + if (error) + return "nodeAffinities." + error; + } + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + properties._minNodeCpus = 1; + if (!$util.isInteger(message.minNodeCpus)) + return "minNodeCpus: integer expected"; + } + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { + properties._provisioningModel = 1; + switch (message.provisioningModel) { + default: + return "provisioningModel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { + properties._instanceTerminationAction = 1; + switch (message.instanceTerminationAction) { + default: + return "instanceTerminationAction: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { + properties._localSsdRecoveryTimeout = 1; + { + var error = $root.google.cloud.backupdr.v1.SchedulingDuration.verify(message.localSsdRecoveryTimeout); + if (error) + return "localSsdRecoveryTimeout." + error; + } + } + return null; + }; + + /** + * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling + */ + Scheduling.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Scheduling) + return object; + var message = new $root.google.cloud.backupdr.v1.Scheduling(); + switch (object.onHostMaintenance) { + default: + if (typeof object.onHostMaintenance === "number") { + message.onHostMaintenance = object.onHostMaintenance; + break; + } + break; + case "ON_HOST_MAINTENANCE_UNSPECIFIED": + case 0: + message.onHostMaintenance = 0; + break; + case "TERMINATE": + case 1: + message.onHostMaintenance = 1; + break; + case "MIGRATE": + case 1000: + message.onHostMaintenance = 1000; + break; + } + if (object.automaticRestart != null) + message.automaticRestart = Boolean(object.automaticRestart); + if (object.preemptible != null) + message.preemptible = Boolean(object.preemptible); + if (object.nodeAffinities) { + if (!Array.isArray(object.nodeAffinities)) + throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: array expected"); + message.nodeAffinities = []; + for (var i = 0; i < object.nodeAffinities.length; ++i) { + if (typeof object.nodeAffinities[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: object expected"); + message.nodeAffinities[i] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.fromObject(object.nodeAffinities[i]); + } + } + if (object.minNodeCpus != null) + message.minNodeCpus = object.minNodeCpus | 0; + switch (object.provisioningModel) { + default: + if (typeof object.provisioningModel === "number") { + message.provisioningModel = object.provisioningModel; + break; + } + break; + case "PROVISIONING_MODEL_UNSPECIFIED": + case 0: + message.provisioningModel = 0; + break; + case "STANDARD": + case 1: + message.provisioningModel = 1; + break; + case "SPOT": + case 2: + message.provisioningModel = 2; + break; + } + switch (object.instanceTerminationAction) { + default: + if (typeof object.instanceTerminationAction === "number") { + message.instanceTerminationAction = object.instanceTerminationAction; + break; + } + break; + case "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": + case 0: + message.instanceTerminationAction = 0; + break; + case "DELETE": + case 1: + message.instanceTerminationAction = 1; + break; + case "STOP": + case 2: + message.instanceTerminationAction = 2; + break; + } + if (object.localSsdRecoveryTimeout != null) { + if (typeof object.localSsdRecoveryTimeout !== "object") + throw TypeError(".google.cloud.backupdr.v1.Scheduling.localSsdRecoveryTimeout: object expected"); + message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.fromObject(object.localSsdRecoveryTimeout); + } + return message; + }; + + /** + * Creates a plain object from a Scheduling message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {google.cloud.backupdr.v1.Scheduling} message Scheduling + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Scheduling.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.nodeAffinities = []; + if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { + object.onHostMaintenance = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] === undefined ? message.onHostMaintenance : $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] : message.onHostMaintenance; + if (options.oneofs) + object._onHostMaintenance = "onHostMaintenance"; + } + if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { + object.automaticRestart = message.automaticRestart; + if (options.oneofs) + object._automaticRestart = "automaticRestart"; + } + if (message.preemptible != null && message.hasOwnProperty("preemptible")) { + object.preemptible = message.preemptible; + if (options.oneofs) + object._preemptible = "preemptible"; + } + if (message.nodeAffinities && message.nodeAffinities.length) { + object.nodeAffinities = []; + for (var j = 0; j < message.nodeAffinities.length; ++j) + object.nodeAffinities[j] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.toObject(message.nodeAffinities[j], options); + } + if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { + object.minNodeCpus = message.minNodeCpus; + if (options.oneofs) + object._minNodeCpus = "minNodeCpus"; + } + if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { + object.provisioningModel = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] : message.provisioningModel; + if (options.oneofs) + object._provisioningModel = "provisioningModel"; + } + if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { + object.instanceTerminationAction = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] === undefined ? message.instanceTerminationAction : $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] : message.instanceTerminationAction; + if (options.oneofs) + object._instanceTerminationAction = "instanceTerminationAction"; + } + if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { + object.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.toObject(message.localSsdRecoveryTimeout, options); + if (options.oneofs) + object._localSsdRecoveryTimeout = "localSsdRecoveryTimeout"; + } + return object; + }; + + /** + * Converts this Scheduling to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Scheduling + * @instance + * @returns {Object.} JSON object + */ + Scheduling.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Scheduling + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Scheduling + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Scheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling"; + }; + + /** + * OnHostMaintenance enum. + * @name google.cloud.backupdr.v1.Scheduling.OnHostMaintenance + * @enum {number} + * @property {number} ON_HOST_MAINTENANCE_UNSPECIFIED=0 ON_HOST_MAINTENANCE_UNSPECIFIED value + * @property {number} TERMINATE=1 TERMINATE value + * @property {number} MIGRATE=1000 MIGRATE value + */ + Scheduling.OnHostMaintenance = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "ON_HOST_MAINTENANCE_UNSPECIFIED"] = 0; + values[valuesById[1] = "TERMINATE"] = 1; + values[valuesById[1000] = "MIGRATE"] = 1000; + return values; + })(); + + Scheduling.NodeAffinity = (function() { + + /** + * Properties of a NodeAffinity. + * @memberof google.cloud.backupdr.v1.Scheduling + * @interface INodeAffinity + * @property {string|null} [key] NodeAffinity key + * @property {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null} [operator] NodeAffinity operator + * @property {Array.|null} [values] NodeAffinity values + */ + + /** + * Constructs a new NodeAffinity. + * @memberof google.cloud.backupdr.v1.Scheduling + * @classdesc Represents a NodeAffinity. + * @implements INodeAffinity + * @constructor + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set + */ + function NodeAffinity(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]]; + } + + /** + * NodeAffinity key. + * @member {string|null|undefined} key + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.key = null; + + /** + * NodeAffinity operator. + * @member {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null|undefined} operator + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.operator = null; + + /** + * NodeAffinity values. + * @member {Array.} values + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + */ + NodeAffinity.prototype.values = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NodeAffinity.prototype, "_key", { + get: $util.oneOfGetter($oneOfFields = ["key"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(NodeAffinity.prototype, "_operator", { + get: $util.oneOfGetter($oneOfFields = ["operator"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new NodeAffinity instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity instance + */ + NodeAffinity.create = function create(properties) { + return new NodeAffinity(properties); + }; + + /** + * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); + if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); + 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 NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NodeAffinity message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.key = reader.string(); + break; + } + case 2: { + message.operator = reader.int32(); + 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 NodeAffinity message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NodeAffinity.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NodeAffinity message. + * @function verify + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NodeAffinity.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.key != null && message.hasOwnProperty("key")) { + properties._key = 1; + if (!$util.isString(message.key)) + return "key: string expected"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + properties._operator = 1; + switch (message.operator) { + default: + return "operator: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + 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 NodeAffinity message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity + */ + NodeAffinity.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity) + return object; + var message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); + if (object.key != null) + message.key = String(object.key); + switch (object.operator) { + default: + if (typeof object.operator === "number") { + message.operator = object.operator; + break; + } + break; + case "OPERATOR_UNSPECIFIED": + case 0: + message.operator = 0; + break; + case "IN": + case 1: + message.operator = 1; + break; + case "NOT_IN": + case 2: + message.operator = 2; + break; + } + if (object.values) { + if (!Array.isArray(object.values)) + throw TypeError(".google.cloud.backupdr.v1.Scheduling.NodeAffinity.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 NodeAffinity message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {google.cloud.backupdr.v1.Scheduling.NodeAffinity} message NodeAffinity + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NodeAffinity.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.values = []; + if (message.key != null && message.hasOwnProperty("key")) { + object.key = message.key; + if (options.oneofs) + object._key = "key"; + } + if (message.operator != null && message.hasOwnProperty("operator")) { + object.operator = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] : message.operator; + if (options.oneofs) + object._operator = "operator"; + } + 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 NodeAffinity to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @instance + * @returns {Object.} JSON object + */ + NodeAffinity.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for NodeAffinity + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + NodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling.NodeAffinity"; + }; + + /** + * Operator enum. + * @name google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator + * @enum {number} + * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value + * @property {number} IN=1 IN value + * @property {number} NOT_IN=2 NOT_IN value + */ + NodeAffinity.Operator = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; + values[valuesById[1] = "IN"] = 1; + values[valuesById[2] = "NOT_IN"] = 2; + return values; + })(); + + return NodeAffinity; + })(); + + /** + * ProvisioningModel enum. + * @name google.cloud.backupdr.v1.Scheduling.ProvisioningModel + * @enum {number} + * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value + * @property {number} STANDARD=1 STANDARD value + * @property {number} SPOT=2 SPOT value + */ + Scheduling.ProvisioningModel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; + values[valuesById[1] = "STANDARD"] = 1; + values[valuesById[2] = "SPOT"] = 2; + return values; + })(); + + /** + * InstanceTerminationAction enum. + * @name google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction + * @enum {number} + * @property {number} INSTANCE_TERMINATION_ACTION_UNSPECIFIED=0 INSTANCE_TERMINATION_ACTION_UNSPECIFIED value + * @property {number} DELETE=1 DELETE value + * @property {number} STOP=2 STOP value + */ + Scheduling.InstanceTerminationAction = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "INSTANCE_TERMINATION_ACTION_UNSPECIFIED"] = 0; + values[valuesById[1] = "DELETE"] = 1; + values[valuesById[2] = "STOP"] = 2; + return values; + })(); + + return Scheduling; + })(); + + v1.SchedulingDuration = (function() { + + /** + * Properties of a SchedulingDuration. + * @memberof google.cloud.backupdr.v1 + * @interface ISchedulingDuration + * @property {number|Long|null} [seconds] SchedulingDuration seconds + * @property {number|null} [nanos] SchedulingDuration nanos + */ + + /** + * Constructs a new SchedulingDuration. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a SchedulingDuration. + * @implements ISchedulingDuration + * @constructor + * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set + */ + function SchedulingDuration(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * SchedulingDuration seconds. + * @member {number|Long|null|undefined} seconds + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + SchedulingDuration.prototype.seconds = null; + + /** + * SchedulingDuration nanos. + * @member {number|null|undefined} nanos + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + */ + SchedulingDuration.prototype.nanos = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SchedulingDuration.prototype, "_seconds", { + get: $util.oneOfGetter($oneOfFields = ["seconds"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(SchedulingDuration.prototype, "_nanos", { + get: $util.oneOfGetter($oneOfFields = ["nanos"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new SchedulingDuration instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration instance + */ + SchedulingDuration.create = function create(properties) { + return new SchedulingDuration(properties); + }; + + /** + * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingDuration.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 SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SchedulingDuration.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SchedulingDuration message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingDuration.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); + 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 SchedulingDuration message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SchedulingDuration.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SchedulingDuration message. + * @function verify + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SchedulingDuration.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.seconds != null && message.hasOwnProperty("seconds")) { + properties._seconds = 1; + 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")) { + properties._nanos = 1; + if (!$util.isInteger(message.nanos)) + return "nanos: integer expected"; + } + return null; + }; + + /** + * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration + */ + SchedulingDuration.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.SchedulingDuration) + return object; + var message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); + 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 SchedulingDuration message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {google.cloud.backupdr.v1.SchedulingDuration} message SchedulingDuration + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SchedulingDuration.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + 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 (options.oneofs) + object._seconds = "seconds"; + } + if (message.nanos != null && message.hasOwnProperty("nanos")) { + object.nanos = message.nanos; + if (options.oneofs) + object._nanos = "nanos"; + } + return object; + }; + + /** + * Converts this SchedulingDuration to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @instance + * @returns {Object.} JSON object + */ + SchedulingDuration.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for SchedulingDuration + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.SchedulingDuration + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + SchedulingDuration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.SchedulingDuration"; + }; + + return SchedulingDuration; + })(); + + v1.ServiceAccount = (function() { + + /** + * Properties of a ServiceAccount. + * @memberof google.cloud.backupdr.v1 + * @interface IServiceAccount + * @property {string|null} [email] ServiceAccount email + * @property {Array.|null} [scopes] ServiceAccount scopes + */ + + /** + * Constructs a new ServiceAccount. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ServiceAccount. + * @implements IServiceAccount + * @constructor + * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set + */ + function ServiceAccount(properties) { + this.scopes = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ServiceAccount email. + * @member {string|null|undefined} email + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.email = null; + + /** + * ServiceAccount scopes. + * @member {Array.} scopes + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + */ + ServiceAccount.prototype.scopes = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(ServiceAccount.prototype, "_email", { + get: $util.oneOfGetter($oneOfFields = ["email"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new ServiceAccount instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount instance + */ + ServiceAccount.create = function create(properties) { + return new ServiceAccount(properties); + }; + + /** + * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.email != null && Object.hasOwnProperty.call(message, "email")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); + if (message.scopes != null && message.scopes.length) + for (var i = 0; i < message.scopes.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); + return writer; + }; + + /** + * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceAccount(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.email = reader.string(); + break; + } + case 2: { + if (!(message.scopes && message.scopes.length)) + message.scopes = []; + message.scopes.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceAccount.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceAccount message. + * @function verify + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceAccount.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.email != null && message.hasOwnProperty("email")) { + properties._email = 1; + if (!$util.isString(message.email)) + return "email: string expected"; + } + if (message.scopes != null && message.hasOwnProperty("scopes")) { + if (!Array.isArray(message.scopes)) + return "scopes: array expected"; + for (var i = 0; i < message.scopes.length; ++i) + if (!$util.isString(message.scopes[i])) + return "scopes: string[] expected"; + } + return null; + }; + + /** + * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount + */ + ServiceAccount.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ServiceAccount) + return object; + var message = new $root.google.cloud.backupdr.v1.ServiceAccount(); + if (object.email != null) + message.email = String(object.email); + if (object.scopes) { + if (!Array.isArray(object.scopes)) + throw TypeError(".google.cloud.backupdr.v1.ServiceAccount.scopes: array expected"); + message.scopes = []; + for (var i = 0; i < object.scopes.length; ++i) + message.scopes[i] = String(object.scopes[i]); + } + return message; + }; + + /** + * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {google.cloud.backupdr.v1.ServiceAccount} message ServiceAccount + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceAccount.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.scopes = []; + if (message.email != null && message.hasOwnProperty("email")) { + object.email = message.email; + if (options.oneofs) + object._email = "email"; + } + if (message.scopes && message.scopes.length) { + object.scopes = []; + for (var j = 0; j < message.scopes.length; ++j) + object.scopes[j] = message.scopes[j]; + } + return object; + }; + + /** + * Converts this ServiceAccount to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @instance + * @returns {Object.} JSON object + */ + ServiceAccount.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ServiceAccount + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ServiceAccount + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceAccount"; + }; + + return ServiceAccount; + })(); + + v1.Tags = (function() { + + /** + * Properties of a Tags. + * @memberof google.cloud.backupdr.v1 + * @interface ITags + * @property {Array.|null} [items] Tags items + */ + + /** + * Constructs a new Tags. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a Tags. + * @implements ITags + * @constructor + * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set + */ + function Tags(properties) { + this.items = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * Tags items. + * @member {Array.} items + * @memberof google.cloud.backupdr.v1.Tags + * @instance + */ + Tags.prototype.items = $util.emptyArray; + + /** + * Creates a new Tags instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.Tags} Tags instance + */ + Tags.create = function create(properties) { + return new Tags(properties); + }; + + /** + * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.items != null && message.items.length) + for (var i = 0; i < message.items.length; ++i) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.items[i]); + return writer; + }; + + /** + * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Tags.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Tags message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Tags(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.items && message.items.length)) + message.items = []; + message.items.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Tags message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.Tags} Tags + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Tags.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Tags message. + * @function verify + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Tags.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.items != null && message.hasOwnProperty("items")) { + if (!Array.isArray(message.items)) + return "items: array expected"; + for (var i = 0; i < message.items.length; ++i) + if (!$util.isString(message.items[i])) + return "items: string[] expected"; + } + return null; + }; + + /** + * Creates a Tags message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.Tags} Tags + */ + Tags.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.Tags) + return object; + var message = new $root.google.cloud.backupdr.v1.Tags(); + if (object.items) { + if (!Array.isArray(object.items)) + throw TypeError(".google.cloud.backupdr.v1.Tags.items: array expected"); + message.items = []; + for (var i = 0; i < object.items.length; ++i) + message.items[i] = String(object.items[i]); + } + return message; + }; + + /** + * Creates a plain object from a Tags message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {google.cloud.backupdr.v1.Tags} message Tags + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Tags.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.items = []; + if (message.items && message.items.length) { + object.items = []; + for (var j = 0; j < message.items.length; ++j) + object.items[j] = message.items[j]; + } + return object; + }; + + /** + * Converts this Tags to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.Tags + * @instance + * @returns {Object.} JSON object + */ + Tags.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for Tags + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.Tags + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + Tags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.Tags"; + }; + + return Tags; + })(); + + v1.AttachedDisk = (function() { + + /** + * Properties of an AttachedDisk. + * @memberof google.cloud.backupdr.v1 + * @interface IAttachedDisk + * @property {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null} [initializeParams] AttachedDisk initializeParams + * @property {string|null} [deviceName] AttachedDisk deviceName + * @property {string|null} [kind] AttachedDisk kind + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [diskTypeDeprecated] AttachedDisk diskTypeDeprecated + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null} [mode] AttachedDisk mode + * @property {string|null} [source] AttachedDisk source + * @property {number|Long|null} [index] AttachedDisk index + * @property {boolean|null} [boot] AttachedDisk boot + * @property {boolean|null} [autoDelete] AttachedDisk autoDelete + * @property {Array.|null} [license] AttachedDisk license + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null} [diskInterface] AttachedDisk diskInterface + * @property {Array.|null} [guestOsFeature] AttachedDisk guestOsFeature + * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] AttachedDisk diskEncryptionKey + * @property {number|Long|null} [diskSizeGb] AttachedDisk diskSizeGb + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null} [savedState] AttachedDisk savedState + * @property {string|null} [diskType] AttachedDisk diskType + * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [type] AttachedDisk type + */ + + /** + * Constructs a new AttachedDisk. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents an AttachedDisk. + * @implements IAttachedDisk + * @constructor + * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set + */ + function AttachedDisk(properties) { + this.license = []; + this.guestOsFeature = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * AttachedDisk initializeParams. + * @member {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null|undefined} initializeParams + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.initializeParams = null; + + /** + * AttachedDisk deviceName. + * @member {string|null|undefined} deviceName + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.deviceName = null; + + /** + * AttachedDisk kind. + * @member {string|null|undefined} kind + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.kind = null; + + /** + * AttachedDisk diskTypeDeprecated. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} diskTypeDeprecated + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskTypeDeprecated = null; + + /** + * AttachedDisk mode. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null|undefined} mode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.mode = null; + + /** + * AttachedDisk source. + * @member {string|null|undefined} source + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.source = null; + + /** + * AttachedDisk index. + * @member {number|Long|null|undefined} index + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.index = null; + + /** + * AttachedDisk boot. + * @member {boolean|null|undefined} boot + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.boot = null; + + /** + * AttachedDisk autoDelete. + * @member {boolean|null|undefined} autoDelete + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.autoDelete = null; + + /** + * AttachedDisk license. + * @member {Array.} license + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.license = $util.emptyArray; + + /** + * AttachedDisk diskInterface. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null|undefined} diskInterface + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskInterface = null; + + /** + * AttachedDisk guestOsFeature. + * @member {Array.} guestOsFeature + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.guestOsFeature = $util.emptyArray; + + /** + * AttachedDisk diskEncryptionKey. + * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskEncryptionKey = null; + + /** + * AttachedDisk diskSizeGb. + * @member {number|Long|null|undefined} diskSizeGb + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskSizeGb = null; + + /** + * AttachedDisk savedState. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null|undefined} savedState + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.savedState = null; + + /** + * AttachedDisk diskType. + * @member {string|null|undefined} diskType + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.diskType = null; + + /** + * AttachedDisk type. + * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} type + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + */ + AttachedDisk.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_initializeParams", { + get: $util.oneOfGetter($oneOfFields = ["initializeParams"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_deviceName", { + get: $util.oneOfGetter($oneOfFields = ["deviceName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_kind", { + get: $util.oneOfGetter($oneOfFields = ["kind"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_diskTypeDeprecated", { + get: $util.oneOfGetter($oneOfFields = ["diskTypeDeprecated"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_mode", { + get: $util.oneOfGetter($oneOfFields = ["mode"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_source", { + get: $util.oneOfGetter($oneOfFields = ["source"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_index", { + get: $util.oneOfGetter($oneOfFields = ["index"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_boot", { + get: $util.oneOfGetter($oneOfFields = ["boot"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_autoDelete", { + get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_diskInterface", { + get: $util.oneOfGetter($oneOfFields = ["diskInterface"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_diskEncryptionKey", { + get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_diskSizeGb", { + get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_savedState", { + get: $util.oneOfGetter($oneOfFields = ["savedState"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_diskType", { + get: $util.oneOfGetter($oneOfFields = ["diskType"]), + set: $util.oneOfSetter($oneOfFields) + }); + + // Virtual OneOf for proto3 optional field + Object.defineProperty(AttachedDisk.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new AttachedDisk instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk instance + */ + AttachedDisk.create = function create(properties) { + return new AttachedDisk(properties); + }; + + /** + * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.initializeParams != null && Object.hasOwnProperty.call(message, "initializeParams")) + $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.encode(message.initializeParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceName); + if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.kind); + if (message.diskTypeDeprecated != null && Object.hasOwnProperty.call(message, "diskTypeDeprecated")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.diskTypeDeprecated); + if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) + writer.uint32(/* id 7, wireType 0 =*/56).int32(message.mode); + if (message.source != null && Object.hasOwnProperty.call(message, "source")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.source); + if (message.index != null && Object.hasOwnProperty.call(message, "index")) + writer.uint32(/* id 9, wireType 0 =*/72).int64(message.index); + if (message.boot != null && Object.hasOwnProperty.call(message, "boot")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boot); + if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) + writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoDelete); + if (message.license != null && message.license.length) + for (var i = 0; i < message.license.length; ++i) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.license[i]); + if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) + writer.uint32(/* id 13, wireType 0 =*/104).int32(message.diskInterface); + if (message.guestOsFeature != null && message.guestOsFeature.length) + for (var i = 0; i < message.guestOsFeature.length; ++i) + $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); + if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) + $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); + if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) + writer.uint32(/* id 16, wireType 0 =*/128).int64(message.diskSizeGb); + if (message.savedState != null && Object.hasOwnProperty.call(message, "savedState")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.savedState); + if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) + writer.uint32(/* id 18, wireType 2 =*/146).string(message.diskType); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.type); + return writer; + }; + + /** + * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.decode(reader, reader.uint32()); + break; + } + case 4: { + message.deviceName = reader.string(); + break; + } + case 5: { + message.kind = reader.string(); + break; + } + case 6: { + message.diskTypeDeprecated = reader.int32(); + break; + } + case 7: { + message.mode = reader.int32(); + break; + } + case 8: { + message.source = reader.string(); + break; + } + case 9: { + message.index = reader.int64(); + break; + } + case 10: { + message.boot = reader.bool(); + break; + } + case 11: { + message.autoDelete = reader.bool(); + break; + } + case 12: { + if (!(message.license && message.license.length)) + message.license = []; + message.license.push(reader.string()); + break; + } + case 13: { + message.diskInterface = reader.int32(); + break; + } + case 14: { + if (!(message.guestOsFeature && message.guestOsFeature.length)) + message.guestOsFeature = []; + message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); + break; + } + case 15: { + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); + break; + } + case 16: { + message.diskSizeGb = reader.int64(); + break; + } + case 17: { + message.savedState = reader.int32(); + break; + } + case 18: { + message.diskType = reader.string(); + break; + } + case 19: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttachedDisk.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttachedDisk message. + * @function verify + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttachedDisk.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + properties._initializeParams = 1; + { + var error = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify(message.initializeParams); + if (error) + return "initializeParams." + error; + } + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + properties._deviceName = 1; + if (!$util.isString(message.deviceName)) + return "deviceName: string expected"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + properties._kind = 1; + if (!$util.isString(message.kind)) + return "kind: string expected"; + } + if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { + properties._diskTypeDeprecated = 1; + switch (message.diskTypeDeprecated) { + default: + return "diskTypeDeprecated: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + if (message.mode != null && message.hasOwnProperty("mode")) { + properties._mode = 1; + switch (message.mode) { + default: + return "mode: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + } + if (message.source != null && message.hasOwnProperty("source")) { + properties._source = 1; + if (!$util.isString(message.source)) + return "source: string expected"; + } + if (message.index != null && message.hasOwnProperty("index")) { + properties._index = 1; + if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) + return "index: integer|Long expected"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + properties._boot = 1; + if (typeof message.boot !== "boolean") + return "boot: boolean expected"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + properties._autoDelete = 1; + if (typeof message.autoDelete !== "boolean") + return "autoDelete: boolean expected"; + } + if (message.license != null && message.hasOwnProperty("license")) { + if (!Array.isArray(message.license)) + return "license: array expected"; + for (var i = 0; i < message.license.length; ++i) + if (!$util.isString(message.license[i])) + return "license: string[] expected"; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { + properties._diskInterface = 1; + switch (message.diskInterface) { + default: + return "diskInterface: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + } + if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { + if (!Array.isArray(message.guestOsFeature)) + return "guestOsFeature: array expected"; + for (var i = 0; i < message.guestOsFeature.length; ++i) { + var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); + if (error) + return "guestOsFeature." + error; + } + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + properties._diskEncryptionKey = 1; + { + var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); + if (error) + return "diskEncryptionKey." + error; + } + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + properties._diskSizeGb = 1; + if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) + return "diskSizeGb: integer|Long expected"; + } + if (message.savedState != null && message.hasOwnProperty("savedState")) { + properties._savedState = 1; + switch (message.savedState) { + default: + return "savedState: enum value expected"; + case 0: + case 1: + break; + } + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + properties._diskType = 1; + if (!$util.isString(message.diskType)) + return "diskType: string expected"; + } + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + break; + } + } + return null; + }; + + /** + * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk + */ + AttachedDisk.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk) + return object; + var message = new $root.google.cloud.backupdr.v1.AttachedDisk(); + if (object.initializeParams != null) { + if (typeof object.initializeParams !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.initializeParams: object expected"); + message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.fromObject(object.initializeParams); + } + if (object.deviceName != null) + message.deviceName = String(object.deviceName); + if (object.kind != null) + message.kind = String(object.kind); + switch (object.diskTypeDeprecated) { + default: + if (typeof object.diskTypeDeprecated === "number") { + message.diskTypeDeprecated = object.diskTypeDeprecated; + break; + } + break; + case "DISK_TYPE_UNSPECIFIED": + case 0: + message.diskTypeDeprecated = 0; + break; + case "SCRATCH": + case 1: + message.diskTypeDeprecated = 1; + break; + case "PERSISTENT": + case 2: + message.diskTypeDeprecated = 2; + break; + } + switch (object.mode) { + default: + if (typeof object.mode === "number") { + message.mode = object.mode; + break; + } + break; + case "DISK_MODE_UNSPECIFIED": + case 0: + message.mode = 0; + break; + case "READ_WRITE": + case 1: + message.mode = 1; + break; + case "READ_ONLY": + case 2: + message.mode = 2; + break; + case "LOCKED": + case 3: + message.mode = 3; + break; + } + if (object.source != null) + message.source = String(object.source); + if (object.index != null) + if ($util.Long) + (message.index = $util.Long.fromValue(object.index)).unsigned = false; + else if (typeof object.index === "string") + message.index = parseInt(object.index, 10); + else if (typeof object.index === "number") + message.index = object.index; + else if (typeof object.index === "object") + message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); + if (object.boot != null) + message.boot = Boolean(object.boot); + if (object.autoDelete != null) + message.autoDelete = Boolean(object.autoDelete); + if (object.license) { + if (!Array.isArray(object.license)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.license: array expected"); + message.license = []; + for (var i = 0; i < object.license.length; ++i) + message.license[i] = String(object.license[i]); + } + switch (object.diskInterface) { + default: + if (typeof object.diskInterface === "number") { + message.diskInterface = object.diskInterface; + break; + } + break; + case "DISK_INTERFACE_UNSPECIFIED": + case 0: + message.diskInterface = 0; + break; + case "SCSI": + case 1: + message.diskInterface = 1; + break; + case "NVME": + case 2: + message.diskInterface = 2; + break; + case "NVDIMM": + case 3: + message.diskInterface = 3; + break; + case "ISCSI": + case 4: + message.diskInterface = 4; + break; + } + if (object.guestOsFeature) { + if (!Array.isArray(object.guestOsFeature)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: array expected"); + message.guestOsFeature = []; + for (var i = 0; i < object.guestOsFeature.length; ++i) { + if (typeof object.guestOsFeature[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: object expected"); + message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); + } + } + if (object.diskEncryptionKey != null) { + if (typeof object.diskEncryptionKey !== "object") + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.diskEncryptionKey: object expected"); + message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); + } + if (object.diskSizeGb != null) + if ($util.Long) + (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; + else if (typeof object.diskSizeGb === "string") + message.diskSizeGb = parseInt(object.diskSizeGb, 10); + else if (typeof object.diskSizeGb === "number") + message.diskSizeGb = object.diskSizeGb; + else if (typeof object.diskSizeGb === "object") + message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); + switch (object.savedState) { + default: + if (typeof object.savedState === "number") { + message.savedState = object.savedState; + break; + } + break; + case "DISK_SAVED_STATE_UNSPECIFIED": + case 0: + message.savedState = 0; + break; + case "PRESERVED": + case 1: + message.savedState = 1; + break; + } + if (object.diskType != null) + message.diskType = String(object.diskType); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "DISK_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "SCRATCH": + case 1: + message.type = 1; + break; + case "PERSISTENT": + case 2: + message.type = 2; + break; + } + return message; + }; + + /** + * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk} message AttachedDisk + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttachedDisk.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.license = []; + object.guestOsFeature = []; + } + if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { + object.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.toObject(message.initializeParams, options); + if (options.oneofs) + object._initializeParams = "initializeParams"; + } + if (message.deviceName != null && message.hasOwnProperty("deviceName")) { + object.deviceName = message.deviceName; + if (options.oneofs) + object._deviceName = "deviceName"; + } + if (message.kind != null && message.hasOwnProperty("kind")) { + object.kind = message.kind; + if (options.oneofs) + object._kind = "kind"; + } + if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { + object.diskTypeDeprecated = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] === undefined ? message.diskTypeDeprecated : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] : message.diskTypeDeprecated; + if (options.oneofs) + object._diskTypeDeprecated = "diskTypeDeprecated"; + } + if (message.mode != null && message.hasOwnProperty("mode")) { + object.mode = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] === undefined ? message.mode : $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] : message.mode; + if (options.oneofs) + object._mode = "mode"; + } + if (message.source != null && message.hasOwnProperty("source")) { + object.source = message.source; + if (options.oneofs) + object._source = "source"; + } + if (message.index != null && message.hasOwnProperty("index")) { + if (typeof message.index === "number") + object.index = options.longs === String ? String(message.index) : message.index; + else + object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; + if (options.oneofs) + object._index = "index"; + } + if (message.boot != null && message.hasOwnProperty("boot")) { + object.boot = message.boot; + if (options.oneofs) + object._boot = "boot"; + } + if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { + object.autoDelete = message.autoDelete; + if (options.oneofs) + object._autoDelete = "autoDelete"; + } + if (message.license && message.license.length) { + object.license = []; + for (var j = 0; j < message.license.length; ++j) + object.license[j] = message.license[j]; + } + if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { + object.diskInterface = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] === undefined ? message.diskInterface : $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] : message.diskInterface; + if (options.oneofs) + object._diskInterface = "diskInterface"; + } + if (message.guestOsFeature && message.guestOsFeature.length) { + object.guestOsFeature = []; + for (var j = 0; j < message.guestOsFeature.length; ++j) + object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); + } + if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { + object.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); + if (options.oneofs) + object._diskEncryptionKey = "diskEncryptionKey"; + } + if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { + if (typeof message.diskSizeGb === "number") + object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; + else + object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; + if (options.oneofs) + object._diskSizeGb = "diskSizeGb"; + } + if (message.savedState != null && message.hasOwnProperty("savedState")) { + object.savedState = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] === undefined ? message.savedState : $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] : message.savedState; + if (options.oneofs) + object._savedState = "savedState"; + } + if (message.diskType != null && message.hasOwnProperty("diskType")) { + object.diskType = message.diskType; + if (options.oneofs) + object._diskType = "diskType"; + } + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this AttachedDisk to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @instance + * @returns {Object.} JSON object + */ + AttachedDisk.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for AttachedDisk + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk"; + }; + + AttachedDisk.InitializeParams = (function() { + + /** + * Properties of an InitializeParams. + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @interface IInitializeParams + * @property {string|null} [diskName] InitializeParams diskName + * @property {Array.|null} [replicaZones] InitializeParams replicaZones + */ + + /** + * Constructs a new InitializeParams. + * @memberof google.cloud.backupdr.v1.AttachedDisk + * @classdesc Represents an InitializeParams. + * @implements IInitializeParams + * @constructor + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set + */ + function InitializeParams(properties) { + this.replicaZones = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * InitializeParams diskName. + * @member {string|null|undefined} diskName + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + InitializeParams.prototype.diskName = null; + + /** + * InitializeParams replicaZones. + * @member {Array.} replicaZones + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + */ + InitializeParams.prototype.replicaZones = $util.emptyArray; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(InitializeParams.prototype, "_diskName", { + get: $util.oneOfGetter($oneOfFields = ["diskName"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new InitializeParams instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams instance + */ + InitializeParams.create = function create(properties) { + return new InitializeParams(properties); + }; + + /** + * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeParams.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.diskName != null && Object.hasOwnProperty.call(message, "diskName")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.diskName); + if (message.replicaZones != null && message.replicaZones.length) + for (var i = 0; i < message.replicaZones.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.replicaZones[i]); + return writer; + }; + + /** + * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + InitializeParams.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an InitializeParams message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeParams.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.diskName = reader.string(); + break; + } + case 2: { + if (!(message.replicaZones && message.replicaZones.length)) + message.replicaZones = []; + message.replicaZones.push(reader.string()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an InitializeParams message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + InitializeParams.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an InitializeParams message. + * @function verify + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + InitializeParams.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.diskName != null && message.hasOwnProperty("diskName")) { + properties._diskName = 1; + if (!$util.isString(message.diskName)) + return "diskName: string expected"; + } + if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { + if (!Array.isArray(message.replicaZones)) + return "replicaZones: array expected"; + for (var i = 0; i < message.replicaZones.length; ++i) + if (!$util.isString(message.replicaZones[i])) + return "replicaZones: string[] expected"; + } + return null; + }; + + /** + * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams + */ + InitializeParams.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams) + return object; + var message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); + if (object.diskName != null) + message.diskName = String(object.diskName); + if (object.replicaZones) { + if (!Array.isArray(object.replicaZones)) + throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.InitializeParams.replicaZones: array expected"); + message.replicaZones = []; + for (var i = 0; i < object.replicaZones.length; ++i) + message.replicaZones[i] = String(object.replicaZones[i]); + } + return message; + }; + + /** + * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} message InitializeParams + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + InitializeParams.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.replicaZones = []; + if (message.diskName != null && message.hasOwnProperty("diskName")) { + object.diskName = message.diskName; + if (options.oneofs) + object._diskName = "diskName"; + } + if (message.replicaZones && message.replicaZones.length) { + object.replicaZones = []; + for (var j = 0; j < message.replicaZones.length; ++j) + object.replicaZones[j] = message.replicaZones[j]; + } + return object; + }; + + /** + * Converts this InitializeParams to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @instance + * @returns {Object.} JSON object + */ + InitializeParams.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for InitializeParams + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + InitializeParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk.InitializeParams"; + }; + + return InitializeParams; + })(); + + /** + * DiskType enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskType + * @enum {number} + * @property {number} DISK_TYPE_UNSPECIFIED=0 DISK_TYPE_UNSPECIFIED value + * @property {number} SCRATCH=1 SCRATCH value + * @property {number} PERSISTENT=2 PERSISTENT value + */ + AttachedDisk.DiskType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCRATCH"] = 1; + values[valuesById[2] = "PERSISTENT"] = 2; + return values; + })(); + + /** + * DiskMode enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskMode + * @enum {number} + * @property {number} DISK_MODE_UNSPECIFIED=0 DISK_MODE_UNSPECIFIED value + * @property {number} READ_WRITE=1 READ_WRITE value + * @property {number} READ_ONLY=2 READ_ONLY value + * @property {number} LOCKED=3 LOCKED value + */ + AttachedDisk.DiskMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_MODE_UNSPECIFIED"] = 0; + values[valuesById[1] = "READ_WRITE"] = 1; + values[valuesById[2] = "READ_ONLY"] = 2; + values[valuesById[3] = "LOCKED"] = 3; + return values; + })(); + + /** + * DiskInterface enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskInterface + * @enum {number} + * @property {number} DISK_INTERFACE_UNSPECIFIED=0 DISK_INTERFACE_UNSPECIFIED value + * @property {number} SCSI=1 SCSI value + * @property {number} NVME=2 NVME value + * @property {number} NVDIMM=3 NVDIMM value + * @property {number} ISCSI=4 ISCSI value + */ + AttachedDisk.DiskInterface = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_INTERFACE_UNSPECIFIED"] = 0; + values[valuesById[1] = "SCSI"] = 1; + values[valuesById[2] = "NVME"] = 2; + values[valuesById[3] = "NVDIMM"] = 3; + values[valuesById[4] = "ISCSI"] = 4; + return values; + })(); + + /** + * DiskSavedState enum. + * @name google.cloud.backupdr.v1.AttachedDisk.DiskSavedState + * @enum {number} + * @property {number} DISK_SAVED_STATE_UNSPECIFIED=0 DISK_SAVED_STATE_UNSPECIFIED value + * @property {number} PRESERVED=1 PRESERVED value + */ + AttachedDisk.DiskSavedState = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DISK_SAVED_STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "PRESERVED"] = 1; + return values; + })(); + + return AttachedDisk; + })(); + + v1.GuestOsFeature = (function() { + + /** + * Properties of a GuestOsFeature. + * @memberof google.cloud.backupdr.v1 + * @interface IGuestOsFeature + * @property {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null} [type] GuestOsFeature type + */ + + /** + * Constructs a new GuestOsFeature. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GuestOsFeature. + * @implements IGuestOsFeature + * @constructor + * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set + */ + function GuestOsFeature(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GuestOsFeature type. + * @member {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null|undefined} type + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + */ + GuestOsFeature.prototype.type = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(GuestOsFeature.prototype, "_type", { + get: $util.oneOfGetter($oneOfFields = ["type"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new GuestOsFeature instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature instance + */ + GuestOsFeature.create = function create(properties) { + return new GuestOsFeature(properties); + }; + + /** + * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + return writer; + }; + + /** + * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GuestOsFeature.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GuestOsFeature.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GuestOsFeature message. + * @function verify + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GuestOsFeature.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.type != null && message.hasOwnProperty("type")) { + properties._type = 1; + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + break; + } + } + return null; + }; + + /** + * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature + */ + GuestOsFeature.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GuestOsFeature) + return object; + var message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "FEATURE_TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "VIRTIO_SCSI_MULTIQUEUE": + case 1: + message.type = 1; + break; + case "WINDOWS": + case 2: + message.type = 2; + break; + case "MULTI_IP_SUBNET": + case 3: + message.type = 3; + break; + case "UEFI_COMPATIBLE": + case 4: + message.type = 4; + break; + case "SECURE_BOOT": + case 5: + message.type = 5; + break; + case "GVNIC": + case 6: + message.type = 6; + break; + case "SEV_CAPABLE": + case 7: + message.type = 7; + break; + case "BARE_METAL_LINUX_COMPATIBLE": + case 8: + message.type = 8; + break; + case "SUSPEND_RESUME_COMPATIBLE": + case 9: + message.type = 9; + break; + case "SEV_LIVE_MIGRATABLE": + case 10: + message.type = 10; + break; + case "SEV_SNP_CAPABLE": + case 11: + message.type = 11; + break; + case "TDX_CAPABLE": + case 12: + message.type = 12; + break; + case "IDPF": + case 13: + message.type = 13; + break; + case "SEV_LIVE_MIGRATABLE_V2": + case 14: + message.type = 14; + break; + } + return message; + }; + + /** + * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {google.cloud.backupdr.v1.GuestOsFeature} message GuestOsFeature + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GuestOsFeature.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (message.type != null && message.hasOwnProperty("type")) { + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] : message.type; + if (options.oneofs) + object._type = "type"; + } + return object; + }; + + /** + * Converts this GuestOsFeature to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @instance + * @returns {Object.} JSON object + */ + GuestOsFeature.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GuestOsFeature + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GuestOsFeature + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GuestOsFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GuestOsFeature"; + }; + + /** + * FeatureType enum. + * @name google.cloud.backupdr.v1.GuestOsFeature.FeatureType + * @enum {number} + * @property {number} FEATURE_TYPE_UNSPECIFIED=0 FEATURE_TYPE_UNSPECIFIED value + * @property {number} VIRTIO_SCSI_MULTIQUEUE=1 VIRTIO_SCSI_MULTIQUEUE value + * @property {number} WINDOWS=2 WINDOWS value + * @property {number} MULTI_IP_SUBNET=3 MULTI_IP_SUBNET value + * @property {number} UEFI_COMPATIBLE=4 UEFI_COMPATIBLE value + * @property {number} SECURE_BOOT=5 SECURE_BOOT value + * @property {number} GVNIC=6 GVNIC value + * @property {number} SEV_CAPABLE=7 SEV_CAPABLE value + * @property {number} BARE_METAL_LINUX_COMPATIBLE=8 BARE_METAL_LINUX_COMPATIBLE value + * @property {number} SUSPEND_RESUME_COMPATIBLE=9 SUSPEND_RESUME_COMPATIBLE value + * @property {number} SEV_LIVE_MIGRATABLE=10 SEV_LIVE_MIGRATABLE value + * @property {number} SEV_SNP_CAPABLE=11 SEV_SNP_CAPABLE value + * @property {number} TDX_CAPABLE=12 TDX_CAPABLE value + * @property {number} IDPF=13 IDPF value + * @property {number} SEV_LIVE_MIGRATABLE_V2=14 SEV_LIVE_MIGRATABLE_V2 value + */ + GuestOsFeature.FeatureType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FEATURE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "VIRTIO_SCSI_MULTIQUEUE"] = 1; + values[valuesById[2] = "WINDOWS"] = 2; + values[valuesById[3] = "MULTI_IP_SUBNET"] = 3; + values[valuesById[4] = "UEFI_COMPATIBLE"] = 4; + values[valuesById[5] = "SECURE_BOOT"] = 5; + values[valuesById[6] = "GVNIC"] = 6; + values[valuesById[7] = "SEV_CAPABLE"] = 7; + values[valuesById[8] = "BARE_METAL_LINUX_COMPATIBLE"] = 8; + values[valuesById[9] = "SUSPEND_RESUME_COMPATIBLE"] = 9; + values[valuesById[10] = "SEV_LIVE_MIGRATABLE"] = 10; + values[valuesById[11] = "SEV_SNP_CAPABLE"] = 11; + values[valuesById[12] = "TDX_CAPABLE"] = 12; + values[valuesById[13] = "IDPF"] = 13; + values[valuesById[14] = "SEV_LIVE_MIGRATABLE_V2"] = 14; + return values; + })(); + + return GuestOsFeature; + })(); + + /** + * KeyRevocationActionType enum. + * @name google.cloud.backupdr.v1.KeyRevocationActionType + * @enum {number} + * @property {number} KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED=0 KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED value + * @property {number} NONE=1 NONE value + * @property {number} STOP=2 STOP value + */ + v1.KeyRevocationActionType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "NONE"] = 1; + values[valuesById[2] = "STOP"] = 2; + return values; + })(); + + v1.DataSourceReference = (function() { + + /** + * Properties of a DataSourceReference. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceReference + * @property {string|null} [name] DataSourceReference name + * @property {string|null} [dataSource] DataSourceReference dataSource + * @property {google.protobuf.ITimestamp|null} [createTime] DataSourceReference createTime + * @property {google.cloud.backupdr.v1.BackupConfigState|null} [dataSourceBackupConfigState] DataSourceReference dataSourceBackupConfigState + * @property {number|Long|null} [dataSourceBackupCount] DataSourceReference dataSourceBackupCount + * @property {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null} [dataSourceBackupConfigInfo] DataSourceReference dataSourceBackupConfigInfo + * @property {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null} [dataSourceGcpResourceInfo] DataSourceReference dataSourceGcpResourceInfo + * @property {number|Long|null} [totalStoredBytes] DataSourceReference totalStoredBytes + */ + + /** + * Constructs a new DataSourceReference. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceReference. + * @implements IDataSourceReference + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceReference=} [properties] Properties to set + */ + function DataSourceReference(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceReference name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.name = ""; + + /** + * DataSourceReference dataSource. + * @member {string} dataSource + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.dataSource = ""; + + /** + * DataSourceReference createTime. + * @member {google.protobuf.ITimestamp|null|undefined} createTime + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.createTime = null; + + /** + * DataSourceReference dataSourceBackupConfigState. + * @member {google.cloud.backupdr.v1.BackupConfigState} dataSourceBackupConfigState + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.dataSourceBackupConfigState = 0; + + /** + * DataSourceReference dataSourceBackupCount. + * @member {number|Long} dataSourceBackupCount + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.dataSourceBackupCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * DataSourceReference dataSourceBackupConfigInfo. + * @member {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null|undefined} dataSourceBackupConfigInfo + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.dataSourceBackupConfigInfo = null; + + /** + * DataSourceReference dataSourceGcpResourceInfo. + * @member {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null|undefined} dataSourceGcpResourceInfo + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.dataSourceGcpResourceInfo = null; + + /** + * DataSourceReference totalStoredBytes. + * @member {number|Long|null|undefined} totalStoredBytes + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + */ + DataSourceReference.prototype.totalStoredBytes = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + // Virtual OneOf for proto3 optional field + Object.defineProperty(DataSourceReference.prototype, "_totalStoredBytes", { + get: $util.oneOfGetter($oneOfFields = ["totalStoredBytes"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSourceReference instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {google.cloud.backupdr.v1.IDataSourceReference=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference instance + */ + DataSourceReference.create = function create(properties) { + return new DataSourceReference(properties); + }; + + /** + * Encodes the specified DataSourceReference message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {google.cloud.backupdr.v1.IDataSourceReference} message DataSourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceReference.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSource); + 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.dataSourceBackupConfigState != null && Object.hasOwnProperty.call(message, "dataSourceBackupConfigState")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.dataSourceBackupConfigState); + if (message.dataSourceBackupCount != null && Object.hasOwnProperty.call(message, "dataSourceBackupCount")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.dataSourceBackupCount); + if (message.dataSourceBackupConfigInfo != null && Object.hasOwnProperty.call(message, "dataSourceBackupConfigInfo")) + $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.encode(message.dataSourceBackupConfigInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.dataSourceGcpResourceInfo != null && Object.hasOwnProperty.call(message, "dataSourceGcpResourceInfo")) + $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.encode(message.dataSourceGcpResourceInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.totalStoredBytes); + return writer; + }; + + /** + * Encodes the specified DataSourceReference message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {google.cloud.backupdr.v1.IDataSourceReference} message DataSourceReference message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceReference.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceReference message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceReference.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceReference(); + 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.dataSource = reader.string(); + break; + } + case 3: { + message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 4: { + message.dataSourceBackupConfigState = reader.int32(); + break; + } + case 5: { + message.dataSourceBackupCount = reader.int64(); + break; + } + case 6: { + message.dataSourceBackupConfigInfo = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.decode(reader, reader.uint32()); + break; + } + case 7: { + message.dataSourceGcpResourceInfo = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.decode(reader, reader.uint32()); + break; + } + case 8: { + message.totalStoredBytes = reader.int64(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceReference message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceReference.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceReference message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceReference.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.dataSource != null && message.hasOwnProperty("dataSource")) + if (!$util.isString(message.dataSource)) + return "dataSource: 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.dataSourceBackupConfigState != null && message.hasOwnProperty("dataSourceBackupConfigState")) + switch (message.dataSourceBackupConfigState) { + default: + return "dataSourceBackupConfigState: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.dataSourceBackupCount != null && message.hasOwnProperty("dataSourceBackupCount")) + if (!$util.isInteger(message.dataSourceBackupCount) && !(message.dataSourceBackupCount && $util.isInteger(message.dataSourceBackupCount.low) && $util.isInteger(message.dataSourceBackupCount.high))) + return "dataSourceBackupCount: integer|Long expected"; + if (message.dataSourceBackupConfigInfo != null && message.hasOwnProperty("dataSourceBackupConfigInfo")) { + var error = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify(message.dataSourceBackupConfigInfo); + if (error) + return "dataSourceBackupConfigInfo." + error; + } + if (message.dataSourceGcpResourceInfo != null && message.hasOwnProperty("dataSourceGcpResourceInfo")) { + var error = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify(message.dataSourceGcpResourceInfo); + if (error) + return "dataSourceGcpResourceInfo." + error; + } + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + properties._totalStoredBytes = 1; + if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) + return "totalStoredBytes: integer|Long expected"; + } + return null; + }; + + /** + * Creates a DataSourceReference message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference + */ + DataSourceReference.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceReference) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceReference(); + if (object.name != null) + message.name = String(object.name); + if (object.dataSource != null) + message.dataSource = String(object.dataSource); + if (object.createTime != null) { + if (typeof object.createTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceReference.createTime: object expected"); + message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); + } + switch (object.dataSourceBackupConfigState) { + default: + if (typeof object.dataSourceBackupConfigState === "number") { + message.dataSourceBackupConfigState = object.dataSourceBackupConfigState; + break; + } + break; + case "BACKUP_CONFIG_STATE_UNSPECIFIED": + case 0: + message.dataSourceBackupConfigState = 0; + break; + case "ACTIVE": + case 1: + message.dataSourceBackupConfigState = 1; + break; + case "PASSIVE": + case 2: + message.dataSourceBackupConfigState = 2; + break; + } + if (object.dataSourceBackupCount != null) + if ($util.Long) + (message.dataSourceBackupCount = $util.Long.fromValue(object.dataSourceBackupCount)).unsigned = false; + else if (typeof object.dataSourceBackupCount === "string") + message.dataSourceBackupCount = parseInt(object.dataSourceBackupCount, 10); + else if (typeof object.dataSourceBackupCount === "number") + message.dataSourceBackupCount = object.dataSourceBackupCount; + else if (typeof object.dataSourceBackupCount === "object") + message.dataSourceBackupCount = new $util.LongBits(object.dataSourceBackupCount.low >>> 0, object.dataSourceBackupCount.high >>> 0).toNumber(); + if (object.dataSourceBackupConfigInfo != null) { + if (typeof object.dataSourceBackupConfigInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceReference.dataSourceBackupConfigInfo: object expected"); + message.dataSourceBackupConfigInfo = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.fromObject(object.dataSourceBackupConfigInfo); + } + if (object.dataSourceGcpResourceInfo != null) { + if (typeof object.dataSourceGcpResourceInfo !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceReference.dataSourceGcpResourceInfo: object expected"); + message.dataSourceGcpResourceInfo = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.fromObject(object.dataSourceGcpResourceInfo); + } + if (object.totalStoredBytes != null) + if ($util.Long) + (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; + else if (typeof object.totalStoredBytes === "string") + message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); + else if (typeof object.totalStoredBytes === "number") + message.totalStoredBytes = object.totalStoredBytes; + else if (typeof object.totalStoredBytes === "object") + message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a DataSourceReference message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {google.cloud.backupdr.v1.DataSourceReference} message DataSourceReference + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceReference.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.dataSource = ""; + object.createTime = null; + object.dataSourceBackupConfigState = options.enums === String ? "BACKUP_CONFIG_STATE_UNSPECIFIED" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.dataSourceBackupCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.dataSourceBackupCount = options.longs === String ? "0" : 0; + object.dataSourceBackupConfigInfo = null; + object.dataSourceGcpResourceInfo = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.dataSource != null && message.hasOwnProperty("dataSource")) + object.dataSource = message.dataSource; + if (message.createTime != null && message.hasOwnProperty("createTime")) + object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); + if (message.dataSourceBackupConfigState != null && message.hasOwnProperty("dataSourceBackupConfigState")) + object.dataSourceBackupConfigState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigState[message.dataSourceBackupConfigState] === undefined ? message.dataSourceBackupConfigState : $root.google.cloud.backupdr.v1.BackupConfigState[message.dataSourceBackupConfigState] : message.dataSourceBackupConfigState; + if (message.dataSourceBackupCount != null && message.hasOwnProperty("dataSourceBackupCount")) + if (typeof message.dataSourceBackupCount === "number") + object.dataSourceBackupCount = options.longs === String ? String(message.dataSourceBackupCount) : message.dataSourceBackupCount; + else + object.dataSourceBackupCount = options.longs === String ? $util.Long.prototype.toString.call(message.dataSourceBackupCount) : options.longs === Number ? new $util.LongBits(message.dataSourceBackupCount.low >>> 0, message.dataSourceBackupCount.high >>> 0).toNumber() : message.dataSourceBackupCount; + if (message.dataSourceBackupConfigInfo != null && message.hasOwnProperty("dataSourceBackupConfigInfo")) + object.dataSourceBackupConfigInfo = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.toObject(message.dataSourceBackupConfigInfo, options); + if (message.dataSourceGcpResourceInfo != null && message.hasOwnProperty("dataSourceGcpResourceInfo")) + object.dataSourceGcpResourceInfo = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.toObject(message.dataSourceGcpResourceInfo, options); + if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { + if (typeof message.totalStoredBytes === "number") + object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; + else + object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; + if (options.oneofs) + object._totalStoredBytes = "totalStoredBytes"; + } + return object; + }; + + /** + * Converts this DataSourceReference to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @instance + * @returns {Object.} JSON object + */ + DataSourceReference.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceReference + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceReference + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceReference"; + }; + + return DataSourceReference; + })(); + + v1.DataSourceBackupConfigInfo = (function() { + + /** + * Properties of a DataSourceBackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceBackupConfigInfo + * @property {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null} [lastBackupState] DataSourceBackupConfigInfo lastBackupState + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime + */ + + /** + * Constructs a new DataSourceBackupConfigInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceBackupConfigInfo. + * @implements IDataSourceBackupConfigInfo + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo=} [properties] Properties to set + */ + function DataSourceBackupConfigInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceBackupConfigInfo lastBackupState. + * @member {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState} lastBackupState + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @instance + */ + DataSourceBackupConfigInfo.prototype.lastBackupState = 0; + + /** + * DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @instance + */ + DataSourceBackupConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; + + /** + * Creates a new DataSourceBackupConfigInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo instance + */ + DataSourceBackupConfigInfo.create = function create(properties) { + return new DataSourceBackupConfigInfo(properties); + }; + + /** + * Encodes the specified DataSourceBackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo} message DataSourceBackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupConfigInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lastBackupState); + if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSourceBackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo} message DataSourceBackupConfigInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceBackupConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupConfigInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.lastBackupState = reader.int32(); + break; + } + case 2: { + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceBackupConfigInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceBackupConfigInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceBackupConfigInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + switch (message.lastBackupState) { + default: + return "lastBackupState: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); + if (error) + return "lastSuccessfulBackupConsistencyTime." + error; + } + return null; + }; + + /** + * Creates a DataSourceBackupConfigInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo + */ + DataSourceBackupConfigInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo(); + switch (object.lastBackupState) { + default: + if (typeof object.lastBackupState === "number") { + message.lastBackupState = object.lastBackupState; + break; + } + break; + case "LAST_BACKUP_STATE_UNSPECIFIED": + case 0: + message.lastBackupState = 0; + break; + case "FIRST_BACKUP_PENDING": + case 1: + message.lastBackupState = 1; + break; + case "SUCCEEDED": + case 2: + message.lastBackupState = 2; + break; + case "FAILED": + case 3: + message.lastBackupState = 3; + break; + case "PERMISSION_DENIED": + case 4: + message.lastBackupState = 4; + break; + } + if (object.lastSuccessfulBackupConsistencyTime != null) { + if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceBackupConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); + message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); + } + return message; + }; + + /** + * Creates a plain object from a DataSourceBackupConfigInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} message DataSourceBackupConfigInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceBackupConfigInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; + object.lastSuccessfulBackupConsistencyTime = null; + } + if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) + object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; + if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) + object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); + return object; + }; + + /** + * Converts this DataSourceBackupConfigInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @instance + * @returns {Object.} JSON object + */ + DataSourceBackupConfigInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceBackupConfigInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceBackupConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceBackupConfigInfo"; + }; + + return DataSourceBackupConfigInfo; + })(); + + v1.DataSourceGcpResourceInfo = (function() { + + /** + * Properties of a DataSourceGcpResourceInfo. + * @memberof google.cloud.backupdr.v1 + * @interface IDataSourceGcpResourceInfo + * @property {string|null} [gcpResourcename] DataSourceGcpResourceInfo gcpResourcename + * @property {string|null} [type] DataSourceGcpResourceInfo type + * @property {string|null} [location] DataSourceGcpResourceInfo location + * @property {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null} [cloudSqlInstanceProperties] DataSourceGcpResourceInfo cloudSqlInstanceProperties + */ + + /** + * Constructs a new DataSourceGcpResourceInfo. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a DataSourceGcpResourceInfo. + * @implements IDataSourceGcpResourceInfo + * @constructor + * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo=} [properties] Properties to set + */ + function DataSourceGcpResourceInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * DataSourceGcpResourceInfo gcpResourcename. + * @member {string} gcpResourcename + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @instance + */ + DataSourceGcpResourceInfo.prototype.gcpResourcename = ""; + + /** + * DataSourceGcpResourceInfo type. + * @member {string} type + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @instance + */ + DataSourceGcpResourceInfo.prototype.type = ""; + + /** + * DataSourceGcpResourceInfo location. + * @member {string} location + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @instance + */ + DataSourceGcpResourceInfo.prototype.location = ""; + + /** + * DataSourceGcpResourceInfo cloudSqlInstanceProperties. + * @member {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null|undefined} cloudSqlInstanceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @instance + */ + DataSourceGcpResourceInfo.prototype.cloudSqlInstanceProperties = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * DataSourceGcpResourceInfo resourceProperties. + * @member {"cloudSqlInstanceProperties"|undefined} resourceProperties + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @instance + */ + Object.defineProperty(DataSourceGcpResourceInfo.prototype, "resourceProperties", { + get: $util.oneOfGetter($oneOfFields = ["cloudSqlInstanceProperties"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new DataSourceGcpResourceInfo instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo instance + */ + DataSourceGcpResourceInfo.create = function create(properties) { + return new DataSourceGcpResourceInfo(properties); + }; + + /** + * Encodes the specified DataSourceGcpResourceInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo} message DataSourceGcpResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResourceInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); + if (message.location != null && Object.hasOwnProperty.call(message, "location")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); + if (message.cloudSqlInstanceProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceProperties")) + $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.encode(message.cloudSqlInstanceProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified DataSourceGcpResourceInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo} message DataSourceGcpResourceInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DataSourceGcpResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResourceInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.gcpResourcename = reader.string(); + break; + } + case 2: { + message.type = reader.string(); + break; + } + case 3: { + message.location = reader.string(); + break; + } + case 4: { + message.cloudSqlInstanceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DataSourceGcpResourceInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DataSourceGcpResourceInfo message. + * @function verify + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DataSourceGcpResourceInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + if (!$util.isString(message.gcpResourcename)) + return "gcpResourcename: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + if (!$util.isString(message.type)) + return "type: string expected"; + if (message.location != null && message.hasOwnProperty("location")) + if (!$util.isString(message.location)) + return "location: string expected"; + if (message.cloudSqlInstanceProperties != null && message.hasOwnProperty("cloudSqlInstanceProperties")) { + properties.resourceProperties = 1; + { + var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify(message.cloudSqlInstanceProperties); + if (error) + return "cloudSqlInstanceProperties." + error; + } + } + return null; + }; + + /** + * Creates a DataSourceGcpResourceInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo + */ + DataSourceGcpResourceInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo) + return object; + var message = new $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo(); + if (object.gcpResourcename != null) + message.gcpResourcename = String(object.gcpResourcename); + if (object.type != null) + message.type = String(object.type); + if (object.location != null) + message.location = String(object.location); + if (object.cloudSqlInstanceProperties != null) { + if (typeof object.cloudSqlInstanceProperties !== "object") + throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResourceInfo.cloudSqlInstanceProperties: object expected"); + message.cloudSqlInstanceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.fromObject(object.cloudSqlInstanceProperties); + } + return message; + }; + + /** + * Creates a plain object from a DataSourceGcpResourceInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} message DataSourceGcpResourceInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DataSourceGcpResourceInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.gcpResourcename = ""; + object.type = ""; + object.location = ""; + } + if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) + object.gcpResourcename = message.gcpResourcename; + if (message.type != null && message.hasOwnProperty("type")) + object.type = message.type; + if (message.location != null && message.hasOwnProperty("location")) + object.location = message.location; + if (message.cloudSqlInstanceProperties != null && message.hasOwnProperty("cloudSqlInstanceProperties")) { + object.cloudSqlInstanceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.toObject(message.cloudSqlInstanceProperties, options); + if (options.oneofs) + object.resourceProperties = "cloudSqlInstanceProperties"; + } + return object; + }; + + /** + * Converts this DataSourceGcpResourceInfo to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @instance + * @returns {Object.} JSON object + */ + DataSourceGcpResourceInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for DataSourceGcpResourceInfo + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + DataSourceGcpResourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceGcpResourceInfo"; + }; + + return DataSourceGcpResourceInfo; + })(); + + v1.GetDataSourceReferenceRequest = (function() { + + /** + * Properties of a GetDataSourceReferenceRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IGetDataSourceReferenceRequest + * @property {string|null} [name] GetDataSourceReferenceRequest name + */ + + /** + * Constructs a new GetDataSourceReferenceRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a GetDataSourceReferenceRequest. + * @implements IGetDataSourceReferenceRequest + * @constructor + * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest=} [properties] Properties to set + */ + function GetDataSourceReferenceRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * GetDataSourceReferenceRequest name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @instance + */ + GetDataSourceReferenceRequest.prototype.name = ""; + + /** + * Creates a new GetDataSourceReferenceRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest instance + */ + GetDataSourceReferenceRequest.create = function create(properties) { + return new GetDataSourceReferenceRequest(properties); + }; + + /** + * Encodes the specified GetDataSourceReferenceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} message GetDataSourceReferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceReferenceRequest.encode = function encode(message, writer) { + 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 GetDataSourceReferenceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} message GetDataSourceReferenceRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GetDataSourceReferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GetDataSourceReferenceRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceReferenceRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest(); + 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 GetDataSourceReferenceRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GetDataSourceReferenceRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GetDataSourceReferenceRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GetDataSourceReferenceRequest.verify = function verify(message) { + if (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 GetDataSourceReferenceRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest + */ + GetDataSourceReferenceRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest(); + if (object.name != null) + message.name = String(object.name); + return message; + }; + + /** + * Creates a plain object from a GetDataSourceReferenceRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} message GetDataSourceReferenceRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GetDataSourceReferenceRequest.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 GetDataSourceReferenceRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @instance + * @returns {Object.} JSON object + */ + GetDataSourceReferenceRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for GetDataSourceReferenceRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + GetDataSourceReferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.GetDataSourceReferenceRequest"; + }; + + return GetDataSourceReferenceRequest; + })(); + + v1.ListDataSourceReferencesRequest = (function() { + + /** + * Properties of a ListDataSourceReferencesRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourceReferencesRequest + * @property {string|null} [parent] ListDataSourceReferencesRequest parent + * @property {number|null} [pageSize] ListDataSourceReferencesRequest pageSize + * @property {string|null} [pageToken] ListDataSourceReferencesRequest pageToken + * @property {string|null} [filter] ListDataSourceReferencesRequest filter + * @property {string|null} [orderBy] ListDataSourceReferencesRequest orderBy + */ + + /** + * Constructs a new ListDataSourceReferencesRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourceReferencesRequest. + * @implements IListDataSourceReferencesRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest=} [properties] Properties to set + */ + function ListDataSourceReferencesRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListDataSourceReferencesRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @instance + */ + ListDataSourceReferencesRequest.prototype.parent = ""; + + /** + * ListDataSourceReferencesRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @instance + */ + ListDataSourceReferencesRequest.prototype.pageSize = 0; + + /** + * ListDataSourceReferencesRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @instance + */ + ListDataSourceReferencesRequest.prototype.pageToken = ""; + + /** + * ListDataSourceReferencesRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @instance + */ + ListDataSourceReferencesRequest.prototype.filter = ""; + + /** + * ListDataSourceReferencesRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @instance + */ + ListDataSourceReferencesRequest.prototype.orderBy = ""; + + /** + * Creates a new ListDataSourceReferencesRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest instance + */ + ListDataSourceReferencesRequest.create = function create(properties) { + return new ListDataSourceReferencesRequest(properties); + }; + + /** + * Encodes the specified ListDataSourceReferencesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} message ListDataSourceReferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourceReferencesRequest.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 ListDataSourceReferencesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} message ListDataSourceReferencesRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourceReferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourceReferencesRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourceReferencesRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest(); + 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 ListDataSourceReferencesRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourceReferencesRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourceReferencesRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourceReferencesRequest.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 ListDataSourceReferencesRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest + */ + ListDataSourceReferencesRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest(); + 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 ListDataSourceReferencesRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} message ListDataSourceReferencesRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourceReferencesRequest.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 ListDataSourceReferencesRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @instance + * @returns {Object.} JSON object + */ + ListDataSourceReferencesRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourceReferencesRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourceReferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourceReferencesRequest"; + }; + + return ListDataSourceReferencesRequest; + })(); + + v1.ListDataSourceReferencesResponse = (function() { + + /** + * Properties of a ListDataSourceReferencesResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListDataSourceReferencesResponse + * @property {Array.|null} [dataSourceReferences] ListDataSourceReferencesResponse dataSourceReferences + * @property {string|null} [nextPageToken] ListDataSourceReferencesResponse nextPageToken + * @property {Array.|null} [unreachable] ListDataSourceReferencesResponse unreachable + */ + + /** + * Constructs a new ListDataSourceReferencesResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListDataSourceReferencesResponse. + * @implements IListDataSourceReferencesResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse=} [properties] Properties to set + */ + function ListDataSourceReferencesResponse(properties) { + this.dataSourceReferences = []; + 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]]; + } + + /** + * ListDataSourceReferencesResponse dataSourceReferences. + * @member {Array.} dataSourceReferences + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @instance + */ + ListDataSourceReferencesResponse.prototype.dataSourceReferences = $util.emptyArray; + + /** + * ListDataSourceReferencesResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @instance + */ + ListDataSourceReferencesResponse.prototype.nextPageToken = ""; + + /** + * ListDataSourceReferencesResponse unreachable. + * @member {Array.} unreachable + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @instance + */ + ListDataSourceReferencesResponse.prototype.unreachable = $util.emptyArray; + + /** + * Creates a new ListDataSourceReferencesResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse instance + */ + ListDataSourceReferencesResponse.create = function create(properties) { + return new ListDataSourceReferencesResponse(properties); + }; + + /** + * Encodes the specified ListDataSourceReferencesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse} message ListDataSourceReferencesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourceReferencesResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSourceReferences != null && message.dataSourceReferences.length) + for (var i = 0; i < message.dataSourceReferences.length; ++i) + $root.google.cloud.backupdr.v1.DataSourceReference.encode(message.dataSourceReferences[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 ListDataSourceReferencesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse} message ListDataSourceReferencesResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListDataSourceReferencesResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListDataSourceReferencesResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourceReferencesResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataSourceReferences && message.dataSourceReferences.length)) + message.dataSourceReferences = []; + message.dataSourceReferences.push($root.google.cloud.backupdr.v1.DataSourceReference.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 ListDataSourceReferencesResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListDataSourceReferencesResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListDataSourceReferencesResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListDataSourceReferencesResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSourceReferences != null && message.hasOwnProperty("dataSourceReferences")) { + if (!Array.isArray(message.dataSourceReferences)) + return "dataSourceReferences: array expected"; + for (var i = 0; i < message.dataSourceReferences.length; ++i) { + var error = $root.google.cloud.backupdr.v1.DataSourceReference.verify(message.dataSourceReferences[i]); + if (error) + return "dataSourceReferences." + 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 ListDataSourceReferencesResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse + */ + ListDataSourceReferencesResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse(); + if (object.dataSourceReferences) { + if (!Array.isArray(object.dataSourceReferences)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourceReferencesResponse.dataSourceReferences: array expected"); + message.dataSourceReferences = []; + for (var i = 0; i < object.dataSourceReferences.length; ++i) { + if (typeof object.dataSourceReferences[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListDataSourceReferencesResponse.dataSourceReferences: object expected"); + message.dataSourceReferences[i] = $root.google.cloud.backupdr.v1.DataSourceReference.fromObject(object.dataSourceReferences[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + if (object.unreachable) { + if (!Array.isArray(object.unreachable)) + throw TypeError(".google.cloud.backupdr.v1.ListDataSourceReferencesResponse.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 ListDataSourceReferencesResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} message ListDataSourceReferencesResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListDataSourceReferencesResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dataSourceReferences = []; + object.unreachable = []; + } + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSourceReferences && message.dataSourceReferences.length) { + object.dataSourceReferences = []; + for (var j = 0; j < message.dataSourceReferences.length; ++j) + object.dataSourceReferences[j] = $root.google.cloud.backupdr.v1.DataSourceReference.toObject(message.dataSourceReferences[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 ListDataSourceReferencesResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @instance + * @returns {Object.} JSON object + */ + ListDataSourceReferencesResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListDataSourceReferencesResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListDataSourceReferencesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourceReferencesResponse"; + }; + + return ListDataSourceReferencesResponse; + })(); + + v1.FetchDataSourceReferencesForResourceTypeRequest = (function() { + + /** + * Properties of a FetchDataSourceReferencesForResourceTypeRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchDataSourceReferencesForResourceTypeRequest + * @property {string|null} [parent] FetchDataSourceReferencesForResourceTypeRequest parent + * @property {string|null} [resourceType] FetchDataSourceReferencesForResourceTypeRequest resourceType + * @property {number|null} [pageSize] FetchDataSourceReferencesForResourceTypeRequest pageSize + * @property {string|null} [pageToken] FetchDataSourceReferencesForResourceTypeRequest pageToken + * @property {string|null} [filter] FetchDataSourceReferencesForResourceTypeRequest filter + * @property {string|null} [orderBy] FetchDataSourceReferencesForResourceTypeRequest orderBy + */ + + /** + * Constructs a new FetchDataSourceReferencesForResourceTypeRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchDataSourceReferencesForResourceTypeRequest. + * @implements IFetchDataSourceReferencesForResourceTypeRequest + * @constructor + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest=} [properties] Properties to set + */ + function FetchDataSourceReferencesForResourceTypeRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchDataSourceReferencesForResourceTypeRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.parent = ""; + + /** + * FetchDataSourceReferencesForResourceTypeRequest resourceType. + * @member {string} resourceType + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.resourceType = ""; + + /** + * FetchDataSourceReferencesForResourceTypeRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.pageSize = 0; + + /** + * FetchDataSourceReferencesForResourceTypeRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.pageToken = ""; + + /** + * FetchDataSourceReferencesForResourceTypeRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.filter = ""; + + /** + * FetchDataSourceReferencesForResourceTypeRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.orderBy = ""; + + /** + * Creates a new FetchDataSourceReferencesForResourceTypeRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest instance + */ + FetchDataSourceReferencesForResourceTypeRequest.create = function create(properties) { + return new FetchDataSourceReferencesForResourceTypeRequest(properties); + }; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDataSourceReferencesForResourceTypeRequest.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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); + if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); + if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); + if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); + if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); + return writer; + }; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDataSourceReferencesForResourceTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDataSourceReferencesForResourceTypeRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest(); + 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.resourceType = reader.string(); + break; + } + case 3: { + message.pageSize = reader.int32(); + break; + } + case 4: { + message.pageToken = reader.string(); + break; + } + case 5: { + message.filter = reader.string(); + break; + } + case 6: { + message.orderBy = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDataSourceReferencesForResourceTypeRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDataSourceReferencesForResourceTypeRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDataSourceReferencesForResourceTypeRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) + if (!$util.isString(message.resourceType)) + return "resourceType: 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 FetchDataSourceReferencesForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest + */ + FetchDataSourceReferencesForResourceTypeRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest(); + if (object.parent != null) + message.parent = String(object.parent); + if (object.resourceType != null) + message.resourceType = String(object.resourceType); + 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 FetchDataSourceReferencesForResourceTypeRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} message FetchDataSourceReferencesForResourceTypeRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDataSourceReferencesForResourceTypeRequest.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.parent = ""; + object.resourceType = ""; + object.pageSize = 0; + object.pageToken = ""; + object.filter = ""; + object.orderBy = ""; + } + if (message.parent != null && message.hasOwnProperty("parent")) + object.parent = message.parent; + if (message.resourceType != null && message.hasOwnProperty("resourceType")) + object.resourceType = message.resourceType; + 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 FetchDataSourceReferencesForResourceTypeRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @instance + * @returns {Object.} JSON object + */ + FetchDataSourceReferencesForResourceTypeRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDataSourceReferencesForResourceTypeRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDataSourceReferencesForResourceTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest"; + }; + + return FetchDataSourceReferencesForResourceTypeRequest; + })(); + + v1.FetchDataSourceReferencesForResourceTypeResponse = (function() { + + /** + * Properties of a FetchDataSourceReferencesForResourceTypeResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IFetchDataSourceReferencesForResourceTypeResponse + * @property {Array.|null} [dataSourceReferences] FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences + * @property {string|null} [nextPageToken] FetchDataSourceReferencesForResourceTypeResponse nextPageToken + */ + + /** + * Constructs a new FetchDataSourceReferencesForResourceTypeResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a FetchDataSourceReferencesForResourceTypeResponse. + * @implements IFetchDataSourceReferencesForResourceTypeResponse + * @constructor + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse=} [properties] Properties to set + */ + function FetchDataSourceReferencesForResourceTypeResponse(properties) { + this.dataSourceReferences = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences. + * @member {Array.} dataSourceReferences + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @instance + */ + FetchDataSourceReferencesForResourceTypeResponse.prototype.dataSourceReferences = $util.emptyArray; + + /** + * FetchDataSourceReferencesForResourceTypeResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @instance + */ + FetchDataSourceReferencesForResourceTypeResponse.prototype.nextPageToken = ""; + + /** + * Creates a new FetchDataSourceReferencesForResourceTypeResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse instance + */ + FetchDataSourceReferencesForResourceTypeResponse.create = function create(properties) { + return new FetchDataSourceReferencesForResourceTypeResponse(properties); + }; + + /** + * Encodes the specified FetchDataSourceReferencesForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse} message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDataSourceReferencesForResourceTypeResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.dataSourceReferences != null && message.dataSourceReferences.length) + for (var i = 0; i < message.dataSourceReferences.length; ++i) + $root.google.cloud.backupdr.v1.DataSourceReference.encode(message.dataSourceReferences[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 FetchDataSourceReferencesForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse} message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FetchDataSourceReferencesForResourceTypeResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDataSourceReferencesForResourceTypeResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.dataSourceReferences && message.dataSourceReferences.length)) + message.dataSourceReferences = []; + message.dataSourceReferences.push($root.google.cloud.backupdr.v1.DataSourceReference.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FetchDataSourceReferencesForResourceTypeResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FetchDataSourceReferencesForResourceTypeResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FetchDataSourceReferencesForResourceTypeResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.dataSourceReferences != null && message.hasOwnProperty("dataSourceReferences")) { + if (!Array.isArray(message.dataSourceReferences)) + return "dataSourceReferences: array expected"; + for (var i = 0; i < message.dataSourceReferences.length; ++i) { + var error = $root.google.cloud.backupdr.v1.DataSourceReference.verify(message.dataSourceReferences[i]); + if (error) + return "dataSourceReferences." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a FetchDataSourceReferencesForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse + */ + FetchDataSourceReferencesForResourceTypeResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse(); + if (object.dataSourceReferences) { + if (!Array.isArray(object.dataSourceReferences)) + throw TypeError(".google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.dataSourceReferences: array expected"); + message.dataSourceReferences = []; + for (var i = 0; i < object.dataSourceReferences.length; ++i) { + if (typeof object.dataSourceReferences[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.dataSourceReferences: object expected"); + message.dataSourceReferences[i] = $root.google.cloud.backupdr.v1.DataSourceReference.fromObject(object.dataSourceReferences[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a FetchDataSourceReferencesForResourceTypeResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} message FetchDataSourceReferencesForResourceTypeResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FetchDataSourceReferencesForResourceTypeResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.dataSourceReferences = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.dataSourceReferences && message.dataSourceReferences.length) { + object.dataSourceReferences = []; + for (var j = 0; j < message.dataSourceReferences.length; ++j) + object.dataSourceReferences[j] = $root.google.cloud.backupdr.v1.DataSourceReference.toObject(message.dataSourceReferences[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this FetchDataSourceReferencesForResourceTypeResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @instance + * @returns {Object.} JSON object + */ + FetchDataSourceReferencesForResourceTypeResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FetchDataSourceReferencesForResourceTypeResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FetchDataSourceReferencesForResourceTypeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse"; + }; + + return FetchDataSourceReferencesForResourceTypeResponse; + })(); + + v1.BackupDrProtectionSummary = (function() { + + /** + * Constructs a new BackupDrProtectionSummary service. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrProtectionSummary + * @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 BackupDrProtectionSummary(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BackupDrProtectionSummary.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackupDrProtectionSummary; + + /** + * Creates new BackupDrProtectionSummary service using the specified rpc implementation. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @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 {BackupDrProtectionSummary} RPC service. Useful where requests and/or responses are streamed. + */ + BackupDrProtectionSummary.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDrProtectionSummary|listResourceBackupConfigs}. + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @typedef ListResourceBackupConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} [response] ListResourceBackupConfigsResponse + */ + + /** + * Calls ListResourceBackupConfigs. + * @function listResourceBackupConfigs + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @instance + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} request ListResourceBackupConfigsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceBackupConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDrProtectionSummary.prototype.listResourceBackupConfigs = function listResourceBackupConfigs(request, callback) { + return this.rpcCall(listResourceBackupConfigs, $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest, $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse, request, callback); + }, "name", { value: "ListResourceBackupConfigs" }); + + /** + * Calls ListResourceBackupConfigs. + * @function listResourceBackupConfigs + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @instance + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} request ListResourceBackupConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BackupDrProtectionSummary; + })(); + + v1.ListResourceBackupConfigsRequest = (function() { + + /** + * Properties of a ListResourceBackupConfigsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListResourceBackupConfigsRequest + * @property {string|null} [parent] ListResourceBackupConfigsRequest parent + * @property {number|null} [pageSize] ListResourceBackupConfigsRequest pageSize + * @property {string|null} [pageToken] ListResourceBackupConfigsRequest pageToken + * @property {string|null} [filter] ListResourceBackupConfigsRequest filter + * @property {string|null} [orderBy] ListResourceBackupConfigsRequest orderBy + */ + + /** + * Constructs a new ListResourceBackupConfigsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListResourceBackupConfigsRequest. + * @implements IListResourceBackupConfigsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest=} [properties] Properties to set + */ + function ListResourceBackupConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceBackupConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.parent = ""; + + /** + * ListResourceBackupConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.pageSize = 0; + + /** + * ListResourceBackupConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.pageToken = ""; + + /** + * ListResourceBackupConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.filter = ""; + + /** + * ListResourceBackupConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListResourceBackupConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest instance + */ + ListResourceBackupConfigsRequest.create = function create(properties) { + return new ListResourceBackupConfigsRequest(properties); + }; + + /** + * Encodes the specified ListResourceBackupConfigsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest(); + 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 ListResourceBackupConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceBackupConfigsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest + */ + ListResourceBackupConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest(); + 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 ListResourceBackupConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourceBackupConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceBackupConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceBackupConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListResourceBackupConfigsRequest"; + }; + + return ListResourceBackupConfigsRequest; + })(); + + v1.ListResourceBackupConfigsResponse = (function() { + + /** + * Properties of a ListResourceBackupConfigsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListResourceBackupConfigsResponse + * @property {Array.|null} [resourceBackupConfigs] ListResourceBackupConfigsResponse resourceBackupConfigs + * @property {string|null} [nextPageToken] ListResourceBackupConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListResourceBackupConfigsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListResourceBackupConfigsResponse. + * @implements IListResourceBackupConfigsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse=} [properties] Properties to set + */ + function ListResourceBackupConfigsResponse(properties) { + this.resourceBackupConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceBackupConfigsResponse resourceBackupConfigs. + * @member {Array.} resourceBackupConfigs + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @instance + */ + ListResourceBackupConfigsResponse.prototype.resourceBackupConfigs = $util.emptyArray; + + /** + * ListResourceBackupConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @instance + */ + ListResourceBackupConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListResourceBackupConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse instance + */ + ListResourceBackupConfigsResponse.create = function create(properties) { + return new ListResourceBackupConfigsResponse(properties); + }; + + /** + * Encodes the specified ListResourceBackupConfigsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceBackupConfigs != null && message.resourceBackupConfigs.length) + for (var i = 0; i < message.resourceBackupConfigs.length; ++i) + $root.google.cloud.backupdr.v1.ResourceBackupConfig.encode(message.resourceBackupConfigs[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 ListResourceBackupConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceBackupConfigs && message.resourceBackupConfigs.length)) + message.resourceBackupConfigs = []; + message.resourceBackupConfigs.push($root.google.cloud.backupdr.v1.ResourceBackupConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceBackupConfigsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceBackupConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceBackupConfigs != null && message.hasOwnProperty("resourceBackupConfigs")) { + if (!Array.isArray(message.resourceBackupConfigs)) + return "resourceBackupConfigs: array expected"; + for (var i = 0; i < message.resourceBackupConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ResourceBackupConfig.verify(message.resourceBackupConfigs[i]); + if (error) + return "resourceBackupConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListResourceBackupConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse + */ + ListResourceBackupConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse(); + if (object.resourceBackupConfigs) { + if (!Array.isArray(object.resourceBackupConfigs)) + throw TypeError(".google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.resourceBackupConfigs: array expected"); + message.resourceBackupConfigs = []; + for (var i = 0; i < object.resourceBackupConfigs.length; ++i) { + if (typeof object.resourceBackupConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.resourceBackupConfigs: object expected"); + message.resourceBackupConfigs[i] = $root.google.cloud.backupdr.v1.ResourceBackupConfig.fromObject(object.resourceBackupConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListResourceBackupConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceBackupConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceBackupConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceBackupConfigs && message.resourceBackupConfigs.length) { + object.resourceBackupConfigs = []; + for (var j = 0; j < message.resourceBackupConfigs.length; ++j) + object.resourceBackupConfigs[j] = $root.google.cloud.backupdr.v1.ResourceBackupConfig.toObject(message.resourceBackupConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListResourceBackupConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListResourceBackupConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceBackupConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceBackupConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListResourceBackupConfigsResponse"; + }; + + return ListResourceBackupConfigsResponse; + })(); + + v1.ResourceBackupConfig = (function() { + + /** + * Properties of a ResourceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IResourceBackupConfig + * @property {string|null} [name] ResourceBackupConfig name + * @property {string|null} [uid] ResourceBackupConfig uid + * @property {string|null} [targetResource] ResourceBackupConfig targetResource + * @property {string|null} [targetResourceDisplayName] ResourceBackupConfig targetResourceDisplayName + * @property {google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|null} [targetResourceType] ResourceBackupConfig targetResourceType + * @property {Object.|null} [targetResourceLabels] ResourceBackupConfig targetResourceLabels + * @property {Array.|null} [backupConfigsDetails] ResourceBackupConfig backupConfigsDetails + * @property {boolean|null} [backupConfigured] ResourceBackupConfig backupConfigured + * @property {boolean|null} [vaulted] ResourceBackupConfig vaulted + */ + + /** + * Constructs a new ResourceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ResourceBackupConfig. + * @implements IResourceBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IResourceBackupConfig=} [properties] Properties to set + */ + function ResourceBackupConfig(properties) { + this.targetResourceLabels = {}; + this.backupConfigsDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceBackupConfig name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.name = ""; + + /** + * ResourceBackupConfig uid. + * @member {string} uid + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.uid = ""; + + /** + * ResourceBackupConfig targetResource. + * @member {string} targetResource + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResource = ""; + + /** + * ResourceBackupConfig targetResourceDisplayName. + * @member {string} targetResourceDisplayName + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResourceDisplayName = ""; + + /** + * ResourceBackupConfig targetResourceType. + * @member {google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType} targetResourceType + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResourceType = 0; + + /** + * ResourceBackupConfig targetResourceLabels. + * @member {Object.} targetResourceLabels + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResourceLabels = $util.emptyObject; + + /** + * ResourceBackupConfig backupConfigsDetails. + * @member {Array.} backupConfigsDetails + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.backupConfigsDetails = $util.emptyArray; + + /** + * ResourceBackupConfig backupConfigured. + * @member {boolean} backupConfigured + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.backupConfigured = false; + + /** + * ResourceBackupConfig vaulted. + * @member {boolean} vaulted + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.vaulted = false; + + /** + * Creates a new ResourceBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IResourceBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig instance + */ + ResourceBackupConfig.create = function create(properties) { + return new ResourceBackupConfig(properties); + }; + + /** + * Encodes the specified ResourceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IResourceBackupConfig} message ResourceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetResource); + if (message.targetResourceDisplayName != null && Object.hasOwnProperty.call(message, "targetResourceDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetResourceDisplayName); + if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.targetResourceType); + if (message.targetResourceLabels != null && Object.hasOwnProperty.call(message, "targetResourceLabels")) + for (var keys = Object.keys(message.targetResourceLabels), 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.targetResourceLabels[keys[i]]).ldelim(); + if (message.backupConfigsDetails != null && message.backupConfigsDetails.length) + for (var i = 0; i < message.backupConfigsDetails.length; ++i) + $root.google.cloud.backupdr.v1.BackupConfigDetails.encode(message.backupConfigsDetails[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.backupConfigured != null && Object.hasOwnProperty.call(message, "backupConfigured")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.backupConfigured); + if (message.vaulted != null && Object.hasOwnProperty.call(message, "vaulted")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.vaulted); + return writer; + }; + + /** + * Encodes the specified ResourceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IResourceBackupConfig} message ResourceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ResourceBackupConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.targetResource = reader.string(); + break; + } + case 4: { + message.targetResourceDisplayName = reader.string(); + break; + } + case 5: { + message.targetResourceType = reader.int32(); + break; + } + case 6: { + if (message.targetResourceLabels === $util.emptyObject) + message.targetResourceLabels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetResourceLabels[key] = value; + break; + } + case 7: { + if (!(message.backupConfigsDetails && message.backupConfigsDetails.length)) + message.backupConfigsDetails = []; + message.backupConfigsDetails.push($root.google.cloud.backupdr.v1.BackupConfigDetails.decode(reader, reader.uint32())); + break; + } + case 8: { + message.backupConfigured = reader.bool(); + break; + } + case 9: { + message.vaulted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + if (!$util.isString(message.targetResource)) + return "targetResource: string expected"; + if (message.targetResourceDisplayName != null && message.hasOwnProperty("targetResourceDisplayName")) + if (!$util.isString(message.targetResourceDisplayName)) + return "targetResourceDisplayName: string expected"; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + switch (message.targetResourceType) { + default: + return "targetResourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.targetResourceLabels != null && message.hasOwnProperty("targetResourceLabels")) { + if (!$util.isObject(message.targetResourceLabels)) + return "targetResourceLabels: object expected"; + var key = Object.keys(message.targetResourceLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.targetResourceLabels[key[i]])) + return "targetResourceLabels: string{k:string} expected"; + } + if (message.backupConfigsDetails != null && message.hasOwnProperty("backupConfigsDetails")) { + if (!Array.isArray(message.backupConfigsDetails)) + return "backupConfigsDetails: array expected"; + for (var i = 0; i < message.backupConfigsDetails.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupConfigDetails.verify(message.backupConfigsDetails[i]); + if (error) + return "backupConfigsDetails." + error; + } + } + if (message.backupConfigured != null && message.hasOwnProperty("backupConfigured")) + if (typeof message.backupConfigured !== "boolean") + return "backupConfigured: boolean expected"; + if (message.vaulted != null && message.hasOwnProperty("vaulted")) + if (typeof message.vaulted !== "boolean") + return "vaulted: boolean expected"; + return null; + }; + + /** + * Creates a ResourceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig + */ + ResourceBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ResourceBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.ResourceBackupConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.targetResource != null) + message.targetResource = String(object.targetResource); + if (object.targetResourceDisplayName != null) + message.targetResourceDisplayName = String(object.targetResourceDisplayName); + switch (object.targetResourceType) { + default: + if (typeof object.targetResourceType === "number") { + message.targetResourceType = object.targetResourceType; + break; + } + break; + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.targetResourceType = 0; + break; + case "CLOUD_SQL_INSTANCE": + case 1: + message.targetResourceType = 1; + break; + case "COMPUTE_ENGINE_VM": + case 2: + message.targetResourceType = 2; + break; + case "COMPUTE_ENGINE_DISK": + case 3: + message.targetResourceType = 3; + break; + case "COMPUTE_ENGINE_REGIONAL_DISK": + case 4: + message.targetResourceType = 4; + break; + } + if (object.targetResourceLabels) { + if (typeof object.targetResourceLabels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.targetResourceLabels: object expected"); + message.targetResourceLabels = {}; + for (var keys = Object.keys(object.targetResourceLabels), i = 0; i < keys.length; ++i) + message.targetResourceLabels[keys[i]] = String(object.targetResourceLabels[keys[i]]); + } + if (object.backupConfigsDetails) { + if (!Array.isArray(object.backupConfigsDetails)) + throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.backupConfigsDetails: array expected"); + message.backupConfigsDetails = []; + for (var i = 0; i < object.backupConfigsDetails.length; ++i) { + if (typeof object.backupConfigsDetails[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.backupConfigsDetails: object expected"); + message.backupConfigsDetails[i] = $root.google.cloud.backupdr.v1.BackupConfigDetails.fromObject(object.backupConfigsDetails[i]); + } + } + if (object.backupConfigured != null) + message.backupConfigured = Boolean(object.backupConfigured); + if (object.vaulted != null) + message.vaulted = Boolean(object.vaulted); + return message; + }; + + /** + * Creates a plain object from a ResourceBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.ResourceBackupConfig} message ResourceBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupConfigsDetails = []; + if (options.objects || options.defaults) + object.targetResourceLabels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.targetResource = ""; + object.targetResourceDisplayName = ""; + object.targetResourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.backupConfigured = false; + object.vaulted = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + object.targetResource = message.targetResource; + if (message.targetResourceDisplayName != null && message.hasOwnProperty("targetResourceDisplayName")) + object.targetResourceDisplayName = message.targetResourceDisplayName; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + object.targetResourceType = options.enums === String ? $root.google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType[message.targetResourceType] === undefined ? message.targetResourceType : $root.google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType[message.targetResourceType] : message.targetResourceType; + var keys2; + if (message.targetResourceLabels && (keys2 = Object.keys(message.targetResourceLabels)).length) { + object.targetResourceLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetResourceLabels[keys2[j]] = message.targetResourceLabels[keys2[j]]; + } + if (message.backupConfigsDetails && message.backupConfigsDetails.length) { + object.backupConfigsDetails = []; + for (var j = 0; j < message.backupConfigsDetails.length; ++j) + object.backupConfigsDetails[j] = $root.google.cloud.backupdr.v1.BackupConfigDetails.toObject(message.backupConfigsDetails[j], options); + } + if (message.backupConfigured != null && message.hasOwnProperty("backupConfigured")) + object.backupConfigured = message.backupConfigured; + if (message.vaulted != null && message.hasOwnProperty("vaulted")) + object.vaulted = message.vaulted; + return object; + }; + + /** + * Converts this ResourceBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + * @returns {Object.} JSON object + */ + ResourceBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ResourceBackupConfig"; + }; + + /** + * ResourceType enum. + * @name google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} CLOUD_SQL_INSTANCE=1 CLOUD_SQL_INSTANCE value + * @property {number} COMPUTE_ENGINE_VM=2 COMPUTE_ENGINE_VM value + * @property {number} COMPUTE_ENGINE_DISK=3 COMPUTE_ENGINE_DISK value + * @property {number} COMPUTE_ENGINE_REGIONAL_DISK=4 COMPUTE_ENGINE_REGIONAL_DISK value + */ + ResourceBackupConfig.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_SQL_INSTANCE"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_VM"] = 2; + values[valuesById[3] = "COMPUTE_ENGINE_DISK"] = 3; + values[valuesById[4] = "COMPUTE_ENGINE_REGIONAL_DISK"] = 4; + return values; + })(); + + return ResourceBackupConfig; + })(); + + v1.BackupConfigDetails = (function() { + + /** + * Properties of a BackupConfigDetails. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupConfigDetails + * @property {string|null} [backupConfigSource] BackupConfigDetails backupConfigSource + * @property {string|null} [backupConfigSourceDisplayName] BackupConfigDetails backupConfigSourceDisplayName + * @property {google.cloud.backupdr.v1.BackupConfigDetails.Type|null} [type] BackupConfigDetails type + * @property {google.cloud.backupdr.v1.BackupConfigDetails.State|null} [state] BackupConfigDetails state + * @property {google.cloud.backupdr.v1.IPitrSettings|null} [pitrSettings] BackupConfigDetails pitrSettings + * @property {google.protobuf.ITimestamp|null} [latestSuccessfulBackupTime] BackupConfigDetails latestSuccessfulBackupTime + * @property {string|null} [applicableResource] BackupConfigDetails applicableResource + * @property {string|null} [backupVault] BackupConfigDetails backupVault + * @property {Array.|null} [backupLocations] BackupConfigDetails backupLocations + * @property {google.cloud.backupdr.v1.IBackupDrPlanConfig|null} [backupDrPlanConfig] BackupConfigDetails backupDrPlanConfig + * @property {google.cloud.backupdr.v1.IBackupDrTemplateConfig|null} [backupDrTemplateConfig] BackupConfigDetails backupDrTemplateConfig + */ + + /** + * Constructs a new BackupConfigDetails. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupConfigDetails. + * @implements IBackupConfigDetails + * @constructor + * @param {google.cloud.backupdr.v1.IBackupConfigDetails=} [properties] Properties to set + */ + function BackupConfigDetails(properties) { + this.backupLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupConfigDetails backupConfigSource. + * @member {string} backupConfigSource + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupConfigSource = ""; + + /** + * BackupConfigDetails backupConfigSourceDisplayName. + * @member {string} backupConfigSourceDisplayName + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupConfigSourceDisplayName = ""; + + /** + * BackupConfigDetails type. + * @member {google.cloud.backupdr.v1.BackupConfigDetails.Type} type + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.type = 0; + + /** + * BackupConfigDetails state. + * @member {google.cloud.backupdr.v1.BackupConfigDetails.State} state + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.state = 0; + + /** + * BackupConfigDetails pitrSettings. + * @member {google.cloud.backupdr.v1.IPitrSettings|null|undefined} pitrSettings + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.pitrSettings = null; + + /** + * BackupConfigDetails latestSuccessfulBackupTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestSuccessfulBackupTime + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.latestSuccessfulBackupTime = null; + + /** + * BackupConfigDetails applicableResource. + * @member {string} applicableResource + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.applicableResource = ""; + + /** + * BackupConfigDetails backupVault. + * @member {string} backupVault + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupVault = ""; + + /** + * BackupConfigDetails backupLocations. + * @member {Array.} backupLocations + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupLocations = $util.emptyArray; + + /** + * BackupConfigDetails backupDrPlanConfig. + * @member {google.cloud.backupdr.v1.IBackupDrPlanConfig|null|undefined} backupDrPlanConfig + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupDrPlanConfig = null; + + /** + * BackupConfigDetails backupDrTemplateConfig. + * @member {google.cloud.backupdr.v1.IBackupDrTemplateConfig|null|undefined} backupDrTemplateConfig + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupDrTemplateConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupConfigDetails planSpecificConfig. + * @member {"backupDrPlanConfig"|"backupDrTemplateConfig"|undefined} planSpecificConfig + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + Object.defineProperty(BackupConfigDetails.prototype, "planSpecificConfig", { + get: $util.oneOfGetter($oneOfFields = ["backupDrPlanConfig", "backupDrTemplateConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupConfigDetails instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigDetails=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails instance + */ + BackupConfigDetails.create = function create(properties) { + return new BackupConfigDetails(properties); + }; + + /** + * Encodes the specified BackupConfigDetails message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigDetails} message BackupConfigDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupConfigSource != null && Object.hasOwnProperty.call(message, "backupConfigSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupConfigSource); + if (message.backupConfigSourceDisplayName != null && Object.hasOwnProperty.call(message, "backupConfigSourceDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupConfigSourceDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.pitrSettings != null && Object.hasOwnProperty.call(message, "pitrSettings")) + $root.google.cloud.backupdr.v1.PitrSettings.encode(message.pitrSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.latestSuccessfulBackupTime != null && Object.hasOwnProperty.call(message, "latestSuccessfulBackupTime")) + $root.google.protobuf.Timestamp.encode(message.latestSuccessfulBackupTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.applicableResource != null && Object.hasOwnProperty.call(message, "applicableResource")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.applicableResource); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.backupVault); + if (message.backupDrPlanConfig != null && Object.hasOwnProperty.call(message, "backupDrPlanConfig")) + $root.google.cloud.backupdr.v1.BackupDrPlanConfig.encode(message.backupDrPlanConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.backupDrTemplateConfig != null && Object.hasOwnProperty.call(message, "backupDrTemplateConfig")) + $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.encode(message.backupDrTemplateConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.backupLocations != null && message.backupLocations.length) + for (var i = 0; i < message.backupLocations.length; ++i) + $root.google.cloud.backupdr.v1.BackupLocation.encode(message.backupLocations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupConfigDetails message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigDetails} message BackupConfigDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupConfigSource = reader.string(); + break; + } + case 2: { + message.backupConfigSourceDisplayName = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.applicableResource = reader.string(); + break; + } + case 8: { + message.backupVault = reader.string(); + break; + } + case 12: { + if (!(message.backupLocations && message.backupLocations.length)) + message.backupLocations = []; + message.backupLocations.push($root.google.cloud.backupdr.v1.BackupLocation.decode(reader, reader.uint32())); + break; + } + case 10: { + message.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupConfigDetails message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupConfigDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupConfigSource != null && message.hasOwnProperty("backupConfigSource")) + if (!$util.isString(message.backupConfigSource)) + return "backupConfigSource: string expected"; + if (message.backupConfigSourceDisplayName != null && message.hasOwnProperty("backupConfigSourceDisplayName")) + if (!$util.isString(message.backupConfigSourceDisplayName)) + return "backupConfigSourceDisplayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + 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.pitrSettings != null && message.hasOwnProperty("pitrSettings")) { + var error = $root.google.cloud.backupdr.v1.PitrSettings.verify(message.pitrSettings); + if (error) + return "pitrSettings." + error; + } + if (message.latestSuccessfulBackupTime != null && message.hasOwnProperty("latestSuccessfulBackupTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestSuccessfulBackupTime); + if (error) + return "latestSuccessfulBackupTime." + error; + } + if (message.applicableResource != null && message.hasOwnProperty("applicableResource")) + if (!$util.isString(message.applicableResource)) + return "applicableResource: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + if (!$util.isString(message.backupVault)) + return "backupVault: string expected"; + if (message.backupLocations != null && message.hasOwnProperty("backupLocations")) { + if (!Array.isArray(message.backupLocations)) + return "backupLocations: array expected"; + for (var i = 0; i < message.backupLocations.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLocation.verify(message.backupLocations[i]); + if (error) + return "backupLocations." + error; + } + } + if (message.backupDrPlanConfig != null && message.hasOwnProperty("backupDrPlanConfig")) { + properties.planSpecificConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.verify(message.backupDrPlanConfig); + if (error) + return "backupDrPlanConfig." + error; + } + } + if (message.backupDrTemplateConfig != null && message.hasOwnProperty("backupDrTemplateConfig")) { + if (properties.planSpecificConfig === 1) + return "planSpecificConfig: multiple values"; + properties.planSpecificConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.verify(message.backupDrTemplateConfig); + if (error) + return "backupDrTemplateConfig." + error; + } + } + return null; + }; + + /** + * Creates a BackupConfigDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails + */ + BackupConfigDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigDetails) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupConfigDetails(); + if (object.backupConfigSource != null) + message.backupConfigSource = String(object.backupConfigSource); + if (object.backupConfigSourceDisplayName != null) + message.backupConfigSourceDisplayName = String(object.backupConfigSourceDisplayName); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CLOUD_SQL_INSTANCE_BACKUP_CONFIG": + case 1: + message.type = 1; + break; + case "COMPUTE_ENGINE_RESOURCE_POLICY": + case 2: + message.type = 2; + break; + case "BACKUPDR_BACKUP_PLAN": + case 3: + message.type = 3; + break; + case "BACKUPDR_TEMPLATE": + case 4: + message.type = 4; + break; + } + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + } + if (object.pitrSettings != null) { + if (typeof object.pitrSettings !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.pitrSettings: object expected"); + message.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.fromObject(object.pitrSettings); + } + if (object.latestSuccessfulBackupTime != null) { + if (typeof object.latestSuccessfulBackupTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.latestSuccessfulBackupTime: object expected"); + message.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.fromObject(object.latestSuccessfulBackupTime); + } + if (object.applicableResource != null) + message.applicableResource = String(object.applicableResource); + if (object.backupVault != null) + message.backupVault = String(object.backupVault); + if (object.backupLocations) { + if (!Array.isArray(object.backupLocations)) + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupLocations: array expected"); + message.backupLocations = []; + for (var i = 0; i < object.backupLocations.length; ++i) { + if (typeof object.backupLocations[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupLocations: object expected"); + message.backupLocations[i] = $root.google.cloud.backupdr.v1.BackupLocation.fromObject(object.backupLocations[i]); + } + } + if (object.backupDrPlanConfig != null) { + if (typeof object.backupDrPlanConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupDrPlanConfig: object expected"); + message.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.fromObject(object.backupDrPlanConfig); + } + if (object.backupDrTemplateConfig != null) { + if (typeof object.backupDrTemplateConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupDrTemplateConfig: object expected"); + message.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.fromObject(object.backupDrTemplateConfig); + } + return message; + }; + + /** + * Creates a plain object from a BackupConfigDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.BackupConfigDetails} message BackupConfigDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupConfigDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupLocations = []; + if (options.defaults) { + object.backupConfigSource = ""; + object.backupConfigSourceDisplayName = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.pitrSettings = null; + object.latestSuccessfulBackupTime = null; + object.applicableResource = ""; + object.backupVault = ""; + } + if (message.backupConfigSource != null && message.hasOwnProperty("backupConfigSource")) + object.backupConfigSource = message.backupConfigSource; + if (message.backupConfigSourceDisplayName != null && message.hasOwnProperty("backupConfigSourceDisplayName")) + object.backupConfigSourceDisplayName = message.backupConfigSourceDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigDetails.Type[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.BackupConfigDetails.Type[message.type] : message.type; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigDetails.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupConfigDetails.State[message.state] : message.state; + if (message.pitrSettings != null && message.hasOwnProperty("pitrSettings")) + object.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.toObject(message.pitrSettings, options); + if (message.latestSuccessfulBackupTime != null && message.hasOwnProperty("latestSuccessfulBackupTime")) + object.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.toObject(message.latestSuccessfulBackupTime, options); + if (message.applicableResource != null && message.hasOwnProperty("applicableResource")) + object.applicableResource = message.applicableResource; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = message.backupVault; + if (message.backupDrPlanConfig != null && message.hasOwnProperty("backupDrPlanConfig")) { + object.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.toObject(message.backupDrPlanConfig, options); + if (options.oneofs) + object.planSpecificConfig = "backupDrPlanConfig"; + } + if (message.backupDrTemplateConfig != null && message.hasOwnProperty("backupDrTemplateConfig")) { + object.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.toObject(message.backupDrTemplateConfig, options); + if (options.oneofs) + object.planSpecificConfig = "backupDrTemplateConfig"; + } + if (message.backupLocations && message.backupLocations.length) { + object.backupLocations = []; + for (var j = 0; j < message.backupLocations.length; ++j) + object.backupLocations[j] = $root.google.cloud.backupdr.v1.BackupLocation.toObject(message.backupLocations[j], options); + } + return object; + }; + + /** + * Converts this BackupConfigDetails to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + * @returns {Object.} JSON object + */ + BackupConfigDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupConfigDetails + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupConfigDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigDetails"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.BackupConfigDetails.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CLOUD_SQL_INSTANCE_BACKUP_CONFIG=1 CLOUD_SQL_INSTANCE_BACKUP_CONFIG value + * @property {number} COMPUTE_ENGINE_RESOURCE_POLICY=2 COMPUTE_ENGINE_RESOURCE_POLICY value + * @property {number} BACKUPDR_BACKUP_PLAN=3 BACKUPDR_BACKUP_PLAN value + * @property {number} BACKUPDR_TEMPLATE=4 BACKUPDR_TEMPLATE value + */ + BackupConfigDetails.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_SQL_INSTANCE_BACKUP_CONFIG"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_RESOURCE_POLICY"] = 2; + values[valuesById[3] = "BACKUPDR_BACKUP_PLAN"] = 3; + values[valuesById[4] = "BACKUPDR_TEMPLATE"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupConfigDetails.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + * @property {number} ERROR=3 ERROR value + */ + BackupConfigDetails.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return BackupConfigDetails; + })(); + + v1.PitrSettings = (function() { + + /** + * Properties of a PitrSettings. + * @memberof google.cloud.backupdr.v1 + * @interface IPitrSettings + * @property {number|null} [retentionDays] PitrSettings retentionDays + */ + + /** + * Constructs a new PitrSettings. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a PitrSettings. + * @implements IPitrSettings + * @constructor + * @param {google.cloud.backupdr.v1.IPitrSettings=} [properties] Properties to set + */ + function PitrSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PitrSettings retentionDays. + * @member {number} retentionDays + * @memberof google.cloud.backupdr.v1.PitrSettings + * @instance + */ + PitrSettings.prototype.retentionDays = 0; + + /** + * Creates a new PitrSettings instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.IPitrSettings=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings instance + */ + PitrSettings.create = function create(properties) { + return new PitrSettings(properties); + }; + + /** + * Encodes the specified PitrSettings message. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.IPitrSettings} message PitrSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PitrSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionDays); + return writer; + }; + + /** + * Encodes the specified PitrSettings message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.IPitrSettings} message PitrSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PitrSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PitrSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PitrSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.PitrSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionDays = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PitrSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PitrSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PitrSettings message. + * @function verify + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PitrSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) + if (!$util.isInteger(message.retentionDays)) + return "retentionDays: integer expected"; + return null; + }; + + /** + * Creates a PitrSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings + */ + PitrSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.PitrSettings) + return object; + var message = new $root.google.cloud.backupdr.v1.PitrSettings(); + if (object.retentionDays != null) + message.retentionDays = object.retentionDays | 0; + return message; + }; + + /** + * Creates a plain object from a PitrSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.PitrSettings} message PitrSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PitrSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionDays = 0; + if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) + object.retentionDays = message.retentionDays; + return object; + }; + + /** + * Converts this PitrSettings to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.PitrSettings + * @instance + * @returns {Object.} JSON object + */ + PitrSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PitrSettings + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PitrSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.PitrSettings"; + }; + + return PitrSettings; + })(); + + v1.BackupDrTemplateConfig = (function() { + + /** + * Properties of a BackupDrTemplateConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupDrTemplateConfig + * @property {string|null} [firstPartyManagementUri] BackupDrTemplateConfig firstPartyManagementUri + * @property {string|null} [thirdPartyManagementUri] BackupDrTemplateConfig thirdPartyManagementUri + */ + + /** + * Constructs a new BackupDrTemplateConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrTemplateConfig. + * @implements IBackupDrTemplateConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig=} [properties] Properties to set + */ + function BackupDrTemplateConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDrTemplateConfig firstPartyManagementUri. + * @member {string} firstPartyManagementUri + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @instance + */ + BackupDrTemplateConfig.prototype.firstPartyManagementUri = ""; + + /** + * BackupDrTemplateConfig thirdPartyManagementUri. + * @member {string} thirdPartyManagementUri + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @instance + */ + BackupDrTemplateConfig.prototype.thirdPartyManagementUri = ""; + + /** + * Creates a new BackupDrTemplateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig instance + */ + BackupDrTemplateConfig.create = function create(properties) { + return new BackupDrTemplateConfig(properties); + }; + + /** + * Encodes the specified BackupDrTemplateConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig} message BackupDrTemplateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrTemplateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstPartyManagementUri != null && Object.hasOwnProperty.call(message, "firstPartyManagementUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyManagementUri); + if (message.thirdPartyManagementUri != null && Object.hasOwnProperty.call(message, "thirdPartyManagementUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyManagementUri); + return writer; + }; + + /** + * Encodes the specified BackupDrTemplateConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig} message BackupDrTemplateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrTemplateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrTemplateConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrTemplateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.firstPartyManagementUri = reader.string(); + break; + } + case 2: { + message.thirdPartyManagementUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrTemplateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDrTemplateConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDrTemplateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) + if (!$util.isString(message.firstPartyManagementUri)) + return "firstPartyManagementUri: string expected"; + if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) + if (!$util.isString(message.thirdPartyManagementUri)) + return "thirdPartyManagementUri: string expected"; + return null; + }; + + /** + * Creates a BackupDrTemplateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig + */ + BackupDrTemplateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupDrTemplateConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupDrTemplateConfig(); + if (object.firstPartyManagementUri != null) + message.firstPartyManagementUri = String(object.firstPartyManagementUri); + if (object.thirdPartyManagementUri != null) + message.thirdPartyManagementUri = String(object.thirdPartyManagementUri); + return message; + }; + + /** + * Creates a plain object from a BackupDrTemplateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.BackupDrTemplateConfig} message BackupDrTemplateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDrTemplateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstPartyManagementUri = ""; + object.thirdPartyManagementUri = ""; + } + if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) + object.firstPartyManagementUri = message.firstPartyManagementUri; + if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) + object.thirdPartyManagementUri = message.thirdPartyManagementUri; + return object; + }; + + /** + * Converts this BackupDrTemplateConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @instance + * @returns {Object.} JSON object + */ + BackupDrTemplateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDrTemplateConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDrTemplateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrTemplateConfig"; + }; + + return BackupDrTemplateConfig; + })(); + + v1.BackupDrPlanConfig = (function() { + + /** + * Properties of a BackupDrPlanConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupDrPlanConfig + * @property {Array.|null} [backupDrPlanRules] BackupDrPlanConfig backupDrPlanRules + */ + + /** + * Constructs a new BackupDrPlanConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrPlanConfig. + * @implements IBackupDrPlanConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig=} [properties] Properties to set + */ + function BackupDrPlanConfig(properties) { + this.backupDrPlanRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDrPlanConfig backupDrPlanRules. + * @member {Array.} backupDrPlanRules + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @instance + */ + BackupDrPlanConfig.prototype.backupDrPlanRules = $util.emptyArray; + + /** + * Creates a new BackupDrPlanConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig instance + */ + BackupDrPlanConfig.create = function create(properties) { + return new BackupDrPlanConfig(properties); + }; + + /** + * Encodes the specified BackupDrPlanConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig} message BackupDrPlanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupDrPlanRules != null && message.backupDrPlanRules.length) + for (var i = 0; i < message.backupDrPlanRules.length; ++i) + $root.google.cloud.backupdr.v1.BackupDrPlanRule.encode(message.backupDrPlanRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupDrPlanConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig} message BackupDrPlanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrPlanConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupDrPlanRules && message.backupDrPlanRules.length)) + message.backupDrPlanRules = []; + message.backupDrPlanRules.push($root.google.cloud.backupdr.v1.BackupDrPlanRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDrPlanConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDrPlanConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupDrPlanRules != null && message.hasOwnProperty("backupDrPlanRules")) { + if (!Array.isArray(message.backupDrPlanRules)) + return "backupDrPlanRules: array expected"; + for (var i = 0; i < message.backupDrPlanRules.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupDrPlanRule.verify(message.backupDrPlanRules[i]); + if (error) + return "backupDrPlanRules." + error; + } + } + return null; + }; + + /** + * Creates a BackupDrPlanConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig + */ + BackupDrPlanConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupDrPlanConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupDrPlanConfig(); + if (object.backupDrPlanRules) { + if (!Array.isArray(object.backupDrPlanRules)) + throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanConfig.backupDrPlanRules: array expected"); + message.backupDrPlanRules = []; + for (var i = 0; i < object.backupDrPlanRules.length; ++i) { + if (typeof object.backupDrPlanRules[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanConfig.backupDrPlanRules: object expected"); + message.backupDrPlanRules[i] = $root.google.cloud.backupdr.v1.BackupDrPlanRule.fromObject(object.backupDrPlanRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BackupDrPlanConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.BackupDrPlanConfig} message BackupDrPlanConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDrPlanConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupDrPlanRules = []; + if (message.backupDrPlanRules && message.backupDrPlanRules.length) { + object.backupDrPlanRules = []; + for (var j = 0; j < message.backupDrPlanRules.length; ++j) + object.backupDrPlanRules[j] = $root.google.cloud.backupdr.v1.BackupDrPlanRule.toObject(message.backupDrPlanRules[j], options); + } + return object; + }; + + /** + * Converts this BackupDrPlanConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @instance + * @returns {Object.} JSON object + */ + BackupDrPlanConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDrPlanConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDrPlanConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrPlanConfig"; + }; + + return BackupDrPlanConfig; + })(); + + v1.BackupDrPlanRule = (function() { + + /** + * Properties of a BackupDrPlanRule. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupDrPlanRule + * @property {string|null} [ruleId] BackupDrPlanRule ruleId + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupTime] BackupDrPlanRule lastSuccessfulBackupTime + */ + + /** + * Constructs a new BackupDrPlanRule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrPlanRule. + * @implements IBackupDrPlanRule + * @constructor + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule=} [properties] Properties to set + */ + function BackupDrPlanRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDrPlanRule ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @instance + */ + BackupDrPlanRule.prototype.ruleId = ""; + + /** + * BackupDrPlanRule lastSuccessfulBackupTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupTime + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @instance + */ + BackupDrPlanRule.prototype.lastSuccessfulBackupTime = null; + + /** + * Creates a new BackupDrPlanRule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule instance + */ + BackupDrPlanRule.create = function create(properties) { + return new BackupDrPlanRule(properties); + }; + + /** + * Encodes the specified BackupDrPlanRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule} message BackupDrPlanRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.lastSuccessfulBackupTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupDrPlanRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule} message BackupDrPlanRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrPlanRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 2: { + message.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDrPlanRule message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDrPlanRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.lastSuccessfulBackupTime != null && message.hasOwnProperty("lastSuccessfulBackupTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupTime); + if (error) + return "lastSuccessfulBackupTime." + error; + } + return null; + }; + + /** + * Creates a BackupDrPlanRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule + */ + BackupDrPlanRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupDrPlanRule) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupDrPlanRule(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.lastSuccessfulBackupTime != null) { + if (typeof object.lastSuccessfulBackupTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanRule.lastSuccessfulBackupTime: object expected"); + message.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupDrPlanRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.BackupDrPlanRule} message BackupDrPlanRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDrPlanRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.lastSuccessfulBackupTime = null; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.lastSuccessfulBackupTime != null && message.hasOwnProperty("lastSuccessfulBackupTime")) + object.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupTime, options); + return object; + }; + + /** + * Converts this BackupDrPlanRule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @instance + * @returns {Object.} JSON object + */ + BackupDrPlanRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDrPlanRule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDrPlanRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrPlanRule"; + }; + + return BackupDrPlanRule; + })(); + + v1.BackupLocation = (function() { + + /** + * Properties of a BackupLocation. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupLocation + * @property {google.cloud.backupdr.v1.BackupLocation.Type|null} [type] BackupLocation type + * @property {string|null} [locationId] BackupLocation locationId + */ + + /** + * Constructs a new BackupLocation. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupLocation. + * @implements IBackupLocation + * @constructor + * @param {google.cloud.backupdr.v1.IBackupLocation=} [properties] Properties to set + */ + function BackupLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupLocation type. + * @member {google.cloud.backupdr.v1.BackupLocation.Type} type + * @memberof google.cloud.backupdr.v1.BackupLocation + * @instance + */ + BackupLocation.prototype.type = 0; + + /** + * BackupLocation locationId. + * @member {string} locationId + * @memberof google.cloud.backupdr.v1.BackupLocation + * @instance + */ + BackupLocation.prototype.locationId = ""; + + /** + * Creates a new BackupLocation instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.IBackupLocation=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation instance + */ + BackupLocation.create = function create(properties) { + return new BackupLocation(properties); + }; + + /** + * Encodes the specified BackupLocation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.IBackupLocation} message BackupLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified BackupLocation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.IBackupLocation} message BackupLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLocation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupLocation message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a BackupLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation + */ + BackupLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupLocation) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupLocation(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ZONAL": + case 1: + message.type = 1; + break; + case "REGIONAL": + case 2: + message.type = 2; + break; + case "MULTI_REGIONAL": + case 3: + message.type = 3; + break; + } + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a BackupLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.BackupLocation} message BackupLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.locationId = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.BackupLocation.Type[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.BackupLocation.Type[message.type] : message.type; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this BackupLocation to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupLocation + * @instance + * @returns {Object.} JSON object + */ + BackupLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupLocation + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLocation"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.BackupLocation.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + * @property {number} MULTI_REGIONAL=3 MULTI_REGIONAL value + */ + BackupLocation.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + values[valuesById[3] = "MULTI_REGIONAL"] = 3; + return values; + })(); + + return BackupLocation; + })(); + + return v1; + })(); + + return backupdr; + })(); + + 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.FieldInfo = (function() { + + /** + * Properties of a FieldInfo. + * @memberof google.api + * @interface IFieldInfo + * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format + */ + + /** + * Constructs a new FieldInfo. + * @memberof google.api + * @classdesc Represents a FieldInfo. + * @implements IFieldInfo + * @constructor + * @param {google.api.IFieldInfo=} [properties] Properties to set + */ + function FieldInfo(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldInfo format. + * @member {google.api.FieldInfo.Format} format + * @memberof google.api.FieldInfo + * @instance + */ + FieldInfo.prototype.format = 0; + + /** + * Creates a new FieldInfo instance using the specified properties. + * @function create + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo=} [properties] Properties to set + * @returns {google.api.FieldInfo} FieldInfo instance + */ + FieldInfo.create = function create(properties) { + return new FieldInfo(properties); + }; + + /** + * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encode + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.format != null && Object.hasOwnProperty.call(message, "format")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); + return writer; + }; + + /** + * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer. + * @function decode + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.format = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.api.FieldInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.api.FieldInfo} FieldInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldInfo message. + * @function verify + * @memberof google.api.FieldInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.format != null && message.hasOwnProperty("format")) + switch (message.format) { + default: + return "format: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + return null; + }; + + /** + * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.api.FieldInfo + * @static + * @param {Object.} object Plain object + * @returns {google.api.FieldInfo} FieldInfo + */ + FieldInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.api.FieldInfo) + return object; + var message = new $root.google.api.FieldInfo(); + switch (object.format) { + default: + if (typeof object.format === "number") { + message.format = object.format; + break; + } + break; + case "FORMAT_UNSPECIFIED": + case 0: + message.format = 0; + break; + case "UUID4": + case 1: + message.format = 1; + break; + case "IPV4": + case 2: + message.format = 2; + break; + case "IPV6": + case 3: + message.format = 3; + break; + case "IPV4_OR_IPV6": + case 4: + message.format = 4; + break; + } + return message; + }; + + /** + * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.api.FieldInfo + * @static + * @param {google.api.FieldInfo} message FieldInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; + if (message.format != null && message.hasOwnProperty("format")) + object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; + return object; + }; + + /** + * Converts this FieldInfo to JSON. + * @function toJSON + * @memberof google.api.FieldInfo + * @instance + * @returns {Object.} JSON object + */ + FieldInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldInfo + * @function getTypeUrl + * @memberof google.api.FieldInfo + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.api.FieldInfo"; + }; + + /** + * Format enum. + * @name google.api.FieldInfo.Format + * @enum {number} + * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value + * @property {number} UUID4=1 UUID4 value + * @property {number} IPV4=2 IPV4 value + * @property {number} IPV6=3 IPV6 value + * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value + */ + FieldInfo.Format = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; + values[valuesById[1] = "UUID4"] = 1; + values[valuesById[2] = "IPV4"] = 2; + values[valuesById[3] = "IPV6"] = 3; + values[valuesById[4] = "IPV4_OR_IPV6"] = 4; + return values; + })(); + + return FieldInfo; + })(); + + api.ResourceDescriptor = (function() { + + /** + * Properties of a ResourceDescriptor. + * @memberof google.api + * @interface IResourceDescriptor + * @property {string|null} [type] ResourceDescriptor type + * @property {Array.|null} [pattern] ResourceDescriptor pattern + * @property {string|null} [nameField] ResourceDescriptor nameField + * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history + * @property {string|null} [plural] ResourceDescriptor plural + * @property {string|null} [singular] ResourceDescriptor singular + * @property {Array.|null} [style] ResourceDescriptor style + */ + + /** + * Constructs a new ResourceDescriptor. + * @memberof google.api + * @classdesc Represents a ResourceDescriptor. + * @implements IResourceDescriptor + * @constructor + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + */ + function ResourceDescriptor(properties) { + this.pattern = []; + this.style = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceDescriptor type. + * @member {string} type + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.type = ""; + + /** + * ResourceDescriptor pattern. + * @member {Array.} pattern + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.pattern = $util.emptyArray; + + /** + * ResourceDescriptor nameField. + * @member {string} nameField + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.nameField = ""; + + /** + * ResourceDescriptor history. + * @member {google.api.ResourceDescriptor.History} history + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.history = 0; + + /** + * ResourceDescriptor plural. + * @member {string} plural + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.plural = ""; + + /** + * ResourceDescriptor singular. + * @member {string} singular + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.singular = ""; + + /** + * ResourceDescriptor style. + * @member {Array.} style + * @memberof google.api.ResourceDescriptor + * @instance + */ + ResourceDescriptor.prototype.style = $util.emptyArray; + + /** + * Creates a new ResourceDescriptor instance using the specified properties. + * @function create + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor=} [properties] Properties to set + * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance + */ + ResourceDescriptor.create = function create(properties) { + return new ResourceDescriptor(properties); + }; + + /** + * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encode + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); + if (message.pattern != null && message.pattern.length) + for (var i = 0; i < message.pattern.length; ++i) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); + if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); + if (message.history != null && Object.hasOwnProperty.call(message, "history")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); + if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); + if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); + if (message.style != null && message.style.length) { + writer.uint32(/* id 10, wireType 2 =*/82).fork(); + for (var i = 0; i < message.style.length; ++i) + writer.int32(message.style[i]); + writer.ldelim(); + } + return writer; + }; + + /** + * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. + * @function encodeDelimited + * @memberof google.api.ResourceDescriptor + * @static + * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceDescriptor message from the specified reader or buffer. + * @function decode + * @memberof google.api.ResourceDescriptor + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.api.ResourceDescriptor} ResourceDescriptor + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceDescriptor.decode = function decode(reader, length, 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo + * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.targets = []; + this.editionDefaults = []; + this.uninterpretedOption = []; + this[".google.api.fieldBehavior"] = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions unverifiedLazy. + * @member {boolean} unverifiedLazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.unverifiedLazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions debugRedact. + * @member {boolean} debugRedact + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.debugRedact = false; + + /** + * FieldOptions retention. + * @member {google.protobuf.FieldOptions.OptionRetention} retention + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.retention = 0; + + /** + * FieldOptions targets. + * @member {Array.} targets + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.targets = $util.emptyArray; + + /** + * FieldOptions editionDefaults. + * @member {Array.} editionDefaults + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.editionDefaults = $util.emptyArray; + + /** + * FieldOptions features. + * @member {google.protobuf.IFeatureSet|null|undefined} features + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.features = null; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldBehavior. + * @member {Array.} .google.api.fieldBehavior + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; + + /** + * FieldOptions .google.api.fieldInfo. + * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.fieldInfo"] = null; + + /** + * FieldOptions .google.api.resourceReference. + * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".google.api.resourceReference"] = null; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) + writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); + if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); + if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) + writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); + if (message.targets != null && message.targets.length) + for (var i = 0; i < message.targets.length; ++i) + writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); + if (message.editionDefaults != null && message.editionDefaults.length) + for (var i = 0; i < message.editionDefaults.length; ++i) + $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); + if (message.features != null && Object.hasOwnProperty.call(message, "features")) + $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); + if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) + $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); + if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) + $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decode = function decode(reader, length, 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 291403980: { + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); + break; + } + case 1055: { + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + if (typeof message.unverifiedLazy !== "boolean") + return "unverifiedLazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + if (typeof message.debugRedact !== "boolean") + return "debugRedact: boolean expected"; + if (message.retention != null && message.hasOwnProperty("retention")) + switch (message.retention) { + default: + return "retention: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.targets != null && message.hasOwnProperty("targets")) { + if (!Array.isArray(message.targets)) + return "targets: array expected"; + for (var i = 0; i < message.targets.length; ++i) + switch (message.targets[i]) { + default: + return "targets: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + break; + } + } + if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { + if (!Array.isArray(message.editionDefaults)) + return "editionDefaults: array expected"; + for (var i = 0; i < message.editionDefaults.length; ++i) { + var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); + if (error) + return "editionDefaults." + error; + } + } + if (message.features != null && message.hasOwnProperty("features")) { + var error = $root.google.protobuf.FeatureSet.verify(message.features); + if (error) + return "features." + error; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { + if (!Array.isArray(message[".google.api.fieldBehavior"])) + return ".google.api.fieldBehavior: array expected"; + for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) + switch (message[".google.api.fieldBehavior"][i]) { + default: + return ".google.api.fieldBehavior: enum value[] expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + break; + } + } + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { + var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); + if (error) + return ".google.api.fieldInfo." + error; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { + var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); + if (error) + return ".google.api.resourceReference." + error; + } + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + default: + if (typeof object.ctype === "number") { + message.ctype = object.ctype; + break; + } + break; + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + default: + if (typeof object.jstype === "number") { + message.jstype = object.jstype; + break; + } + break; + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.unverifiedLazy != null) + message.unverifiedLazy = Boolean(object.unverifiedLazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.debugRedact != null) + message.debugRedact = Boolean(object.debugRedact); + switch (object.retention) { + default: + if (typeof object.retention === "number") { + message.retention = object.retention; + break; + } + break; + case "RETENTION_UNKNOWN": + case 0: + message.retention = 0; + break; + case "RETENTION_RUNTIME": + case 1: + message.retention = 1; + break; + case "RETENTION_SOURCE": + case 2: + message.retention = 2; + break; + } + if (object.targets) { + if (!Array.isArray(object.targets)) + throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); + message.targets = []; + for (var i = 0; i < object.targets.length; ++i) + switch (object.targets[i]) { + default: + if (typeof object.targets[i] === "number") { + message.targets[i] = object.targets[i]; + break; + } + case "TARGET_TYPE_UNKNOWN": + case 0: + message.targets[i] = 0; + break; + case "TARGET_TYPE_FILE": + case 1: + message.targets[i] = 1; + break; + case "TARGET_TYPE_EXTENSION_RANGE": + case 2: + message.targets[i] = 2; + break; + case "TARGET_TYPE_MESSAGE": + case 3: + message.targets[i] = 3; + break; + case "TARGET_TYPE_FIELD": + case 4: + message.targets[i] = 4; + break; + case "TARGET_TYPE_ONEOF": + case 5: + message.targets[i] = 5; + break; + case "TARGET_TYPE_ENUM": + case 6: + message.targets[i] = 6; + break; + case "TARGET_TYPE_ENUM_ENTRY": + case 7: + message.targets[i] = 7; + break; + case "TARGET_TYPE_SERVICE": + case 8: + message.targets[i] = 8; + break; + case "TARGET_TYPE_METHOD": + case 9: + message.targets[i] = 9; + break; + } + } + if (object.editionDefaults) { + if (!Array.isArray(object.editionDefaults)) + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); + message.editionDefaults = []; + for (var i = 0; i < object.editionDefaults.length; ++i) { + if (typeof object.editionDefaults[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); + message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); + } + } + if (object.features != null) { + if (typeof object.features !== "object") + throw TypeError(".google.protobuf.FieldOptions.features: object expected"); + message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".google.api.fieldBehavior"]) { + if (!Array.isArray(object[".google.api.fieldBehavior"])) + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); + message[".google.api.fieldBehavior"] = []; + for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) + switch (object[".google.api.fieldBehavior"][i]) { + default: + if (typeof object[".google.api.fieldBehavior"][i] === "number") { + message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; + break; + } + case "FIELD_BEHAVIOR_UNSPECIFIED": + case 0: + message[".google.api.fieldBehavior"][i] = 0; + break; + case "OPTIONAL": + case 1: + message[".google.api.fieldBehavior"][i] = 1; + break; + case "REQUIRED": + case 2: + message[".google.api.fieldBehavior"][i] = 2; + break; + case "OUTPUT_ONLY": + case 3: + message[".google.api.fieldBehavior"][i] = 3; + break; + case "INPUT_ONLY": + case 4: + message[".google.api.fieldBehavior"][i] = 4; + break; + case "IMMUTABLE": + case 5: + message[".google.api.fieldBehavior"][i] = 5; + break; + case "UNORDERED_LIST": + case 6: + message[".google.api.fieldBehavior"][i] = 6; + break; + case "NON_EMPTY_DEFAULT": + case 7: + message[".google.api.fieldBehavior"][i] = 7; + break; + case "IDENTIFIER": + case 8: + message[".google.api.fieldBehavior"][i] = 8; + break; + } + } + if (object[".google.api.fieldInfo"] != null) { + if (typeof object[".google.api.fieldInfo"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); + message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); + } + if (object[".google.api.resourceReference"] != null) { + if (typeof object[".google.api.resourceReference"] !== "object") + throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); + message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); + } + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.targets = []; + object.editionDefaults = []; + object.uninterpretedOption = []; + object[".google.api.fieldBehavior"] = []; + } + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object.unverifiedLazy = false; + object.debugRedact = false; + object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; + object.features = null; + object[".google.api.resourceReference"] = null; + object[".google.api.fieldInfo"] = null; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) + object.unverifiedLazy = message.unverifiedLazy; + if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) + object.debugRedact = message.debugRedact; + if (message.retention != null && message.hasOwnProperty("retention")) + object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; + if (message.targets && message.targets.length) { + object.targets = []; + for (var j = 0; j < message.targets.length; ++j) + object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; + } + if (message.editionDefaults && message.editionDefaults.length) { + object.editionDefaults = []; + for (var j = 0; j < message.editionDefaults.length; ++j) + object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); + } + if (message.features != null && message.hasOwnProperty("features")) + object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { + object[".google.api.fieldBehavior"] = []; + for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) + object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; + } + if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) + object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); + if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) + object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for FieldOptions + * @function getTypeUrl + * @memberof google.protobuf.FieldOptions + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.protobuf.FieldOptions"; + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + /** + * OptionRetention enum. + * @name google.protobuf.FieldOptions.OptionRetention + * @enum {number} + * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value + * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value + * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value + */ + FieldOptions.OptionRetention = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; + values[valuesById[1] = "RETENTION_RUNTIME"] = 1; + values[valuesById[2] = "RETENTION_SOURCE"] = 2; + return values; + })(); + + /** + * OptionTargetType enum. + * @name google.protobuf.FieldOptions.OptionTargetType + * @enum {number} + * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value + * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value + * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value + * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value + * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value + * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value + * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value + * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value + * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value + * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value + */ + FieldOptions.OptionTargetType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; + values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; + values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; + values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; + values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; + values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; + values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; + values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; + values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; + values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; + return values; + })(); + + FieldOptions.EditionDefault = (function() { + + /** + * Properties of an EditionDefault. + * @memberof google.protobuf.FieldOptions + * @interface IEditionDefault + * @property {google.protobuf.Edition|null} [edition] EditionDefault edition + * @property {string|null} [value] EditionDefault value + */ + + /** + * Constructs a new EditionDefault. + * @memberof google.protobuf.FieldOptions + * @classdesc Represents an EditionDefault. + * @implements IEditionDefault + * @constructor + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + */ + function EditionDefault(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * EditionDefault edition. + * @member {google.protobuf.Edition} edition + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.edition = 0; + + /** + * EditionDefault value. + * @member {string} value + * @memberof google.protobuf.FieldOptions.EditionDefault + * @instance + */ + EditionDefault.prototype.value = ""; + + /** + * Creates a new EditionDefault instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance + */ + EditionDefault.create = function create(properties) { + return new EditionDefault(properties); + }; + + /** + * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.value != null && Object.hasOwnProperty.call(message, "value")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); + if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); + return writer; + }; + + /** + * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EditionDefault message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions.EditionDefault + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EditionDefault.decode = function decode(reader, length, 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.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.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.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.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.type = (function() { + + /** + * Namespace type. + * @memberof google + * @namespace + */ + var type = {}; + + /** + * DayOfWeek enum. + * @name google.type.DayOfWeek + * @enum {number} + * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value + * @property {number} MONDAY=1 MONDAY value + * @property {number} TUESDAY=2 TUESDAY value + * @property {number} WEDNESDAY=3 WEDNESDAY value + * @property {number} THURSDAY=4 THURSDAY value + * @property {number} FRIDAY=5 FRIDAY value + * @property {number} SATURDAY=6 SATURDAY value + * @property {number} SUNDAY=7 SUNDAY value + */ + type.DayOfWeek = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; + values[valuesById[1] = "MONDAY"] = 1; + values[valuesById[2] = "TUESDAY"] = 2; + values[valuesById[3] = "WEDNESDAY"] = 3; + values[valuesById[4] = "THURSDAY"] = 4; + values[valuesById[5] = "FRIDAY"] = 5; + values[valuesById[6] = "SATURDAY"] = 6; + values[valuesById[7] = "SUNDAY"] = 7; + return values; + })(); + + /** + * Month enum. + * @name google.type.Month + * @enum {number} + * @property {number} MONTH_UNSPECIFIED=0 MONTH_UNSPECIFIED value + * @property {number} JANUARY=1 JANUARY value + * @property {number} FEBRUARY=2 FEBRUARY value + * @property {number} MARCH=3 MARCH value + * @property {number} APRIL=4 APRIL value + * @property {number} MAY=5 MAY value + * @property {number} JUNE=6 JUNE value + * @property {number} JULY=7 JULY value + * @property {number} AUGUST=8 AUGUST value + * @property {number} SEPTEMBER=9 SEPTEMBER value + * @property {number} OCTOBER=10 OCTOBER value + * @property {number} NOVEMBER=11 NOVEMBER value + * @property {number} DECEMBER=12 DECEMBER value + */ + type.Month = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "MONTH_UNSPECIFIED"] = 0; + values[valuesById[1] = "JANUARY"] = 1; + values[valuesById[2] = "FEBRUARY"] = 2; + values[valuesById[3] = "MARCH"] = 3; + values[valuesById[4] = "APRIL"] = 4; + values[valuesById[5] = "MAY"] = 5; + values[valuesById[6] = "JUNE"] = 6; + values[valuesById[7] = "JULY"] = 7; + values[valuesById[8] = "AUGUST"] = 8; + values[valuesById[9] = "SEPTEMBER"] = 9; + values[valuesById[10] = "OCTOBER"] = 10; + values[valuesById[11] = "NOVEMBER"] = 11; + values[valuesById[12] = "DECEMBER"] = 12; + return values; + })(); + + return type; + })(); + + 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.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; + })(); + + return google; + })(); + + return $root; +}); diff --git a/owl-bot-staging/google-cloud-backupdr/protos/protos.json b/owl-bot-staging/google-cloud-backupdr/protos/protos.json new file mode 100644 index 00000000000..44ce9ef7529 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/protos/protos.json @@ -0,0 +1,9151 @@ +{ + "nested": { + "google": { + "nested": { + "cloud": { + "nested": { + "backupdr": { + "nested": { + "v1": { + "options": { + "csharp_namespace": "Google.Cloud.BackupDR.V1", + "go_package": "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb", + "java_multiple_files": true, + "java_outer_classname": "ProtectionSummaryProto", + "java_package": "com.google.cloud.backupdr.v1", + "php_namespace": "Google\\Cloud\\BackupDR\\V1", + "ruby_package": "Google::Cloud::BackupDR::V1", + "(google.api.resource_definition).type": "compute.googleapis.com/StoragePool", + "(google.api.resource_definition).pattern": "projects/{project}/zones/{zone}/storagePools/{storage_pool}" + }, + "nested": { + "BackupDR": { + "options": { + "(google.api.default_host)": "backupdr.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListManagementServers": { + "requestType": "ListManagementServersRequest", + "responseType": "ListManagementServersResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/managementServers", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/managementServers" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetManagementServer": { + "requestType": "GetManagementServerRequest", + "responseType": "ManagementServer", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/managementServers/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/managementServers/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "CreateManagementServer": { + "requestType": "CreateManagementServerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/managementServers", + "(google.api.http).body": "management_server", + "(google.api.method_signature)": "parent,management_server,management_server_id", + "(google.longrunning.operation_info).response_type": "ManagementServer", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/managementServers", + "body": "management_server" + } + }, + { + "(google.api.method_signature)": "parent,management_server,management_server_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "ManagementServer", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteManagementServer": { + "requestType": "DeleteManagementServerRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/managementServers/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/managementServers/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateBackupVault": { + "requestType": "CreateBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupVaults", + "(google.api.http).body": "backup_vault", + "(google.api.method_signature)": "parent,backup_vault,backup_vault_id", + "(google.longrunning.operation_info).response_type": "BackupVault", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupVaults", + "body": "backup_vault" + } + }, + { + "(google.api.method_signature)": "parent,backup_vault,backup_vault_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupVault", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackupVaults": { + "requestType": "ListBackupVaultsRequest", + "responseType": "ListBackupVaultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupVaults" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FetchUsableBackupVaults": { + "requestType": "FetchUsableBackupVaultsRequest", + "responseType": "FetchUsableBackupVaultsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetBackupVault": { + "requestType": "GetBackupVaultRequest", + "responseType": "BackupVault", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackupVault": { + "requestType": "UpdateBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", + "(google.api.http).body": "backup_vault", + "(google.api.method_signature)": "backup_vault,update_mask", + "(google.longrunning.operation_info).response_type": "BackupVault", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", + "body": "backup_vault" + } + }, + { + "(google.api.method_signature)": "backup_vault,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupVault", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackupVault": { + "requestType": "DeleteBackupVaultRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupVaults/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListDataSources": { + "requestType": "ListDataSourcesRequest", + "responseType": "ListDataSourcesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "GetDataSource": { + "requestType": "GetDataSourceRequest", + "responseType": "DataSource", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateDataSource": { + "requestType": "UpdateDataSourceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "(google.api.http).body": "data_source", + "(google.api.method_signature)": "data_source,update_mask", + "(google.longrunning.operation_info).response_type": "DataSource", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", + "body": "data_source" + } + }, + { + "(google.api.method_signature)": "data_source,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "DataSource", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "ListBackups": { + "requestType": "ListBackupsRequest", + "responseType": "ListBackupsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FetchBackupsForResourceType": { + "requestType": "FetchBackupsForResourceTypeRequest", + "responseType": "FetchBackupsForResourceTypeResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType", + "(google.api.method_signature)": "parent,resource_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType" + } + }, + { + "(google.api.method_signature)": "parent,resource_type" + } + ] + }, + "GetBackup": { + "requestType": "GetBackupRequest", + "responseType": "Backup", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "UpdateBackup": { + "requestType": "UpdateBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.http).body": "backup", + "(google.api.method_signature)": "backup,update_mask", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "body": "backup" + } + }, + { + "(google.api.method_signature)": "backup,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "DeleteBackup": { + "requestType": "DeleteBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "Backup", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "Backup", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "RestoreBackup": { + "requestType": "RestoreBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "RestoreBackupResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "RestoreBackupResponse", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "CreateBackupPlan": { + "requestType": "CreateBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlans", + "(google.api.http).body": "backup_plan", + "(google.api.method_signature)": "parent,backup_plan,backup_plan_id", + "(google.longrunning.operation_info).response_type": "BackupPlan", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupPlans", + "body": "backup_plan" + } + }, + { + "(google.api.method_signature)": "parent,backup_plan,backup_plan_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlan", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateBackupPlan": { + "requestType": "UpdateBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}", + "(google.api.http).body": "backup_plan", + "(google.api.method_signature)": "backup_plan,update_mask", + "(google.longrunning.operation_info).response_type": "BackupPlan", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}", + "body": "backup_plan" + } + }, + { + "(google.api.method_signature)": "backup_plan,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlan", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlan": { + "requestType": "GetBackupPlanRequest", + "responseType": "BackupPlan", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlans": { + "requestType": "ListBackupPlansRequest", + "responseType": "ListBackupPlansResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlans", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlans" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "DeleteBackupPlan": { + "requestType": "DeleteBackupPlanRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlans/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupPlans/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlanRevision": { + "requestType": "GetBackupPlanRevisionRequest", + "responseType": "BackupPlanRevision", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*/revisions/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlans/*/revisions/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlanRevisions": { + "requestType": "ListBackupPlanRevisionsRequest", + "responseType": "ListBackupPlanRevisionsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupPlans/*}/revisions", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*/backupPlans/*}/revisions" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "CreateBackupPlanAssociation": { + "requestType": "CreateBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "(google.api.http).body": "backup_plan_association", + "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "body": "backup_plan_association" + } + }, + { + "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "UpdateBackupPlanAssociation": { + "requestType": "UpdateBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).patch": "/v1/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.http).body": "backup_plan_association", + "(google.api.method_signature)": "backup_plan_association,update_mask", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "patch": "/v1/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}", + "body": "backup_plan_association" + } + }, + { + "(google.api.method_signature)": "backup_plan_association,update_mask" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetBackupPlanAssociation": { + "requestType": "GetBackupPlanAssociationRequest", + "responseType": "BackupPlanAssociation", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListBackupPlanAssociations": { + "requestType": "ListBackupPlanAssociationsRequest", + "responseType": "ListBackupPlanAssociationsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FetchBackupPlanAssociationsForResourceType": { + "requestType": "FetchBackupPlanAssociationsForResourceTypeRequest", + "responseType": "FetchBackupPlanAssociationsForResourceTypeResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType", + "(google.api.method_signature)": "parent,resource_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType" + } + }, + { + "(google.api.method_signature)": "parent,resource_type" + } + ] + }, + "DeleteBackupPlanAssociation": { + "requestType": "DeleteBackupPlanAssociationRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", + "(google.api.method_signature)": "name", + "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" + } + }, + { + "(google.api.method_signature)": "name" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "google.protobuf.Empty", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "TriggerBackup": { + "requestType": "TriggerBackupRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", + "(google.api.http).body": "*", + "(google.api.method_signature)": "name,rule_id", + "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", + "body": "*" + } + }, + { + "(google.api.method_signature)": "name,rule_id" + }, + { + "(google.longrunning.operation_info)": { + "response_type": "BackupPlanAssociation", + "metadata_type": "OperationMetadata" + } + } + ] + }, + "GetDataSourceReference": { + "requestType": "GetDataSourceReferenceRequest", + "responseType": "DataSourceReference", + "options": { + "(google.api.http).get": "/v1/{name=projects/*/locations/*/dataSourceReferences/*}", + "(google.api.method_signature)": "name" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{name=projects/*/locations/*/dataSourceReferences/*}" + } + }, + { + "(google.api.method_signature)": "name" + } + ] + }, + "ListDataSourceReferences": { + "requestType": "ListDataSourceReferencesRequest", + "responseType": "ListDataSourceReferencesResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + }, + "FetchDataSourceReferencesForResourceType": { + "requestType": "FetchDataSourceReferencesForResourceTypeRequest", + "responseType": "FetchDataSourceReferencesForResourceTypeResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences:fetchForResourceType", + "(google.api.method_signature)": "parent,resource_type" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences:fetchForResourceType" + } + }, + { + "(google.api.method_signature)": "parent,resource_type" + } + ] + }, + "InitializeService": { + "requestType": "InitializeServiceRequest", + "responseType": "google.longrunning.Operation", + "options": { + "(google.api.http).post": "/v1/{name=projects/*/locations/*/serviceConfig}:initialize", + "(google.api.http).body": "*", + "(google.longrunning.operation_info).response_type": "InitializeServiceResponse", + "(google.longrunning.operation_info).metadata_type": "OperationMetadata" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "post": "/v1/{name=projects/*/locations/*/serviceConfig}:initialize", + "body": "*" + } + }, + { + "(google.longrunning.operation_info)": { + "response_type": "InitializeServiceResponse", + "metadata_type": "OperationMetadata" + } + } + ] + } + } + }, + "NetworkConfig": { + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "peeringMode": { + "type": "PeeringMode", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "PeeringMode": { + "values": { + "PEERING_MODE_UNSPECIFIED": 0, + "PRIVATE_SERVICE_ACCESS": 1 + } + } + } + }, + "ManagementURI": { + "fields": { + "webUi": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "api": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkforceIdentityBasedManagementURI": { + "fields": { + "firstPartyManagementUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyManagementUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "WorkforceIdentityBasedOAuth2ClientID": { + "fields": { + "firstPartyOauth2ClientId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyOauth2ClientId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "ManagementServer": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/ManagementServer", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/managementServers/{managementserver}", + "(google.api.resource).plural": "managementServers", + "(google.api.resource).singular": "managementServer" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "InstanceType", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "managementUri": { + "type": "ManagementURI", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workforceIdentityBasedManagementUri": { + "type": "WorkforceIdentityBasedManagementURI", + "id": 16, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "InstanceState", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "networks": { + "rule": "repeated", + "type": "NetworkConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "oauth2ClientId": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "workforceIdentityBasedOauth2ClientId": { + "type": "WorkforceIdentityBasedOAuth2ClientID", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "baProxyUri": { + "rule": "repeated", + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "google.protobuf.BoolValue", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "InstanceType": { + "values": { + "INSTANCE_TYPE_UNSPECIFIED": 0, + "BACKUP_RESTORE": 1 + } + }, + "InstanceState": { + "values": { + "INSTANCE_STATE_UNSPECIFIED": 0, + "CREATING": 1, + "READY": 2, + "UPDATING": 3, + "DELETING": 4, + "REPAIRING": 5, + "MAINTENANCE": 6, + "ERROR": 7 + } + } + } + }, + "ListManagementServersRequest": { + "oneofs": { + "_filter": { + "oneof": [ + "filter" + ] + }, + "_orderBy": { + "oneof": [ + "orderBy" + ] + } + }, + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + } + }, + "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", + "proto3_optional": true + } + }, + "orderBy": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ListManagementServersResponse": { + "fields": { + "managementServers": { + "rule": "repeated", + "type": "ManagementServer", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetManagementServerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + } + } + } + }, + "CreateManagementServerRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" + } + }, + "managementServerId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "managementServer": { + "type": "ManagementServer", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteManagementServerRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InitializeServiceRequest": { + "oneofs": { + "initializationConfig": { + "oneof": [ + "cloudSqlInstanceInitializationConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "cloudSqlInstanceInitializationConfig": { + "type": "CloudSqlInstanceInitializationConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "InitializeServiceResponse": { + "fields": { + "backupVaultName": { + "type": "string", + "id": 1 + }, + "backupPlanName": { + "type": "string", + "id": 2 + } + } + }, + "OperationMetadata": { + "fields": { + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "endTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "target": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "verb": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "statusMessage": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "requestedCancellation": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "apiVersion": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "additionalInfo": { + "keyType": "string", + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupPlan": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlan", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}", + "(google.api.resource).plural": "backupPlans", + "(google.api.resource).singular": "backupPlan" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "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" + } + }, + "backupRules": { + "rule": "repeated", + "type": "BackupRule", + "id": 6, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backupVault": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "backupVaultServiceAccount": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "logRetentionDays": { + "type": "int64", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "supportedResourceTypes": { + "rule": "repeated", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionId": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "revisionName": { + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4, + "UPDATING": 5 + } + } + } + }, + "BackupRule": { + "oneofs": { + "backupScheduleOneof": { + "oneof": [ + "standardSchedule" + ] + } + }, + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IMMUTABLE" + } + }, + "backupRetentionDays": { + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "standardSchedule": { + "type": "StandardSchedule", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "StandardSchedule": { + "fields": { + "recurrenceType": { + "type": "RecurrenceType", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "hourlyFrequency": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysOfWeek": { + "rule": "repeated", + "type": "google.type.DayOfWeek", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "daysOfMonth": { + "rule": "repeated", + "type": "int32", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "weekDayOfMonth": { + "type": "WeekDayOfMonth", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "months": { + "rule": "repeated", + "type": "google.type.Month", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "backupWindow": { + "type": "BackupWindow", + "id": 7, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "timeZone": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "RecurrenceType": { + "values": { + "RECURRENCE_TYPE_UNSPECIFIED": 0, + "HOURLY": 1, + "DAILY": 2, + "WEEKLY": 3, + "MONTHLY": 4, + "YEARLY": 5 + } + } + } + }, + "BackupWindow": { + "fields": { + "startHourOfDay": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "endHourOfDay": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "WeekDayOfMonth": { + "fields": { + "weekOfMonth": { + "type": "WeekOfMonth", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dayOfWeek": { + "type": "google.type.DayOfWeek", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "WeekOfMonth": { + "values": { + "WEEK_OF_MONTH_UNSPECIFIED": 0, + "FIRST": 1, + "SECOND": 2, + "THIRD": 3, + "FOURTH": 4, + "LAST": 5 + } + } + } + }, + "CreateBackupPlanRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlan": { + "type": "BackupPlan", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlansRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" + } + }, + "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" + } + } + } + }, + "ListBackupPlansResponse": { + "fields": { + "backupPlans": { + "rule": "repeated", + "type": "BackupPlan", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + } + } + }, + "DeleteBackupPlanRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupPlanRequest": { + "fields": { + "backupPlan": { + "type": "BackupPlan", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "BackupPlanRevision": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlanRevision", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}", + "(google.api.resource).plural": "backupPlanRevisions", + "(google.api.resource).singular": "backupPlanRevision" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "revisionId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupPlanSnapshot": { + "type": "BackupPlan", + "id": 4 + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4 + } + } + } + }, + "GetBackupPlanRevisionRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanRevision" + } + } + } + }, + "ListBackupPlanRevisionsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanRevision" + } + }, + "pageSize": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlanRevisionsResponse": { + "fields": { + "backupPlanRevisions": { + "rule": "repeated", + "type": "BackupPlanRevision", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "BackupPlanAssociation": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupPlanAssociation", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}", + "(google.api.resource).plural": "backupPlanAssociations", + "(google.api.resource).singular": "backupPlanAssociation" + }, + "oneofs": { + "resourceProperties": { + "oneof": [ + "cloudSqlInstanceBackupPlanAssociationProperties" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "resource": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlan": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "rulesConfigInfo": { + "rule": "repeated", + "type": "RuleConfigInfo", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSource": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudSqlInstanceBackupPlanAssociationProperties": { + "type": "CloudSqlInstanceBackupPlanAssociationProperties", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupPlanRevisionId": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupPlanRevisionName": { + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "INACTIVE": 4, + "UPDATING": 5 + } + } + } + }, + "RuleConfigInfo": { + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupState": { + "type": "LastBackupState", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupError": { + "type": "google.rpc.Status", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "LastBackupState": { + "values": { + "LAST_BACKUP_STATE_UNSPECIFIED": 0, + "FIRST_BACKUP_PENDING": 1, + "PERMISSION_DENIED": 2, + "SUCCEEDED": 3, + "FAILED": 4 + } + } + } + }, + "CreateBackupPlanAssociationRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "backupPlanAssociationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupPlanAssociation": { + "type": "BackupPlanAssociation", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupPlanAssociationsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "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" + } + } + } + }, + "ListBackupPlanAssociationsResponse": { + "fields": { + "backupPlanAssociations": { + "rule": "repeated", + "type": "BackupPlanAssociation", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "FetchBackupPlanAssociationsForResourceTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchBackupPlanAssociationsForResourceTypeResponse": { + "fields": { + "backupPlanAssociations": { + "rule": "repeated", + "type": "BackupPlanAssociation", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "nextPageToken": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetBackupPlanAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + } + } + }, + "DeleteBackupPlanAssociationRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupPlanAssociationRequest": { + "fields": { + "backupPlanAssociation": { + "type": "BackupPlanAssociation", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "TriggerBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "ruleId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "CloudSqlInstanceDataSourceProperties": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "sqladmin.googleapis.com/Instance" + } + }, + "databaseInstalledVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceTier": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CloudSqlInstanceBackupProperties": { + "fields": { + "databaseInstalledVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "finalBackup": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "sourceInstance": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "sqladmin.googleapis.com/Instance" + } + }, + "instanceCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceTier": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceDeleteTime": { + "type": "google.protobuf.Timestamp", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CloudSqlInstanceDataSourceReferenceProperties": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "sqladmin.googleapis.com/Instance" + } + }, + "databaseInstalledVersion": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "instanceTier": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "CloudSqlInstanceInitializationConfig": { + "fields": { + "edition": { + "type": "Edition", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + }, + "nested": { + "Edition": { + "values": { + "EDITION_UNSPECIFIED": 0, + "ENTERPRISE": 1, + "ENTERPRISE_PLUS": 2 + } + } + } + }, + "CloudSqlInstanceBackupPlanAssociationProperties": { + "fields": { + "instanceCreateTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupVault": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/BackupVault", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}", + "(google.api.resource).plural": "backupVaults", + "(google.api.resource).singular": "backupVault" + }, + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_backupMinimumEnforcedRetentionDuration": { + "oneof": [ + "backupMinimumEnforcedRetentionDuration" + ] + }, + "_backupRetentionInheritance": { + "oneof": [ + "backupRetentionInheritance" + ] + }, + "_deletable": { + "oneof": [ + "deletable" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "_effectiveTime": { + "oneof": [ + "effectiveTime" + ] + }, + "_encryptionConfig": { + "oneof": [ + "encryptionConfig" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "backupMinimumEnforcedRetentionDuration": { + "type": "google.protobuf.Duration", + "id": 20, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "backupRetentionInheritance": { + "type": "BackupRetentionInheritance", + "id": 27, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deletable": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 10, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "effectiveTime": { + "type": "google.protobuf.Timestamp", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "backupCount": { + "type": "int64", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceAccount": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "uid": { + "type": "string", + "id": 21, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "annotations": { + "keyType": "string", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "accessRestriction": { + "type": "AccessRestriction", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "encryptionConfig": { + "type": "EncryptionConfig", + "id": 29, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "BackupRetentionInheritance": { + "values": { + "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED": 0, + "INHERIT_VAULT_RETENTION": 1, + "MATCH_BACKUP_EXPIRE_TIME": 2 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4, + "UPDATING": 5 + } + }, + "AccessRestriction": { + "values": { + "ACCESS_RESTRICTION_UNSPECIFIED": 0, + "WITHIN_PROJECT": 1, + "WITHIN_ORGANIZATION": 2, + "UNRESTRICTED": 3, + "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA": 4 + } + }, + "EncryptionConfig": { + "oneofs": { + "_kmsKeyName": { + "oneof": [ + "kmsKeyName" + ] + } + }, + "fields": { + "kmsKeyName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey", + "proto3_optional": true + } + } + } + } + } + }, + "DataSource": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/DataSource", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}", + "(google.api.resource).plural": "dataSources", + "(google.api.resource).singular": "dataSource" + }, + "oneofs": { + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_backupCount": { + "oneof": [ + "backupCount" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "_totalStoredBytes": { + "oneof": [ + "totalStoredBytes" + ] + }, + "sourceResource": { + "oneof": [ + "dataSourceGcpResource", + "dataSourceBackupApplianceApplication" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "state": { + "type": "State", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "backupCount": { + "type": "int64", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 14, + "options": { + "proto3_optional": true + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 23, + "options": { + "proto3_optional": true + } + }, + "configState": { + "type": "BackupConfigState", + "id": 24, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupConfigInfo": { + "type": "BackupConfigInfo", + "id": 25, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceGcpResource": { + "type": "DataSourceGcpResource", + "id": 26 + }, + "dataSourceBackupApplianceApplication": { + "type": "DataSourceBackupApplianceApplication", + "id": 27 + }, + "backupBlockedByVaultAccessRestriction": { + "type": "bool", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4 + } + } + } + }, + "BackupConfigInfo": { + "oneofs": { + "backupConfig": { + "oneof": [ + "gcpBackupConfig", + "backupApplianceBackupConfig" + ] + } + }, + "fields": { + "lastBackupState": { + "type": "LastBackupState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastBackupError": { + "type": "google.rpc.Status", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcpBackupConfig": { + "type": "GcpBackupConfig", + "id": 4 + }, + "backupApplianceBackupConfig": { + "type": "BackupApplianceBackupConfig", + "id": 5 + } + }, + "nested": { + "LastBackupState": { + "values": { + "LAST_BACKUP_STATE_UNSPECIFIED": 0, + "FIRST_BACKUP_PENDING": 1, + "SUCCEEDED": 2, + "FAILED": 3, + "PERMISSION_DENIED": 4 + } + } + } + }, + "GcpBackupConfig": { + "fields": { + "backupPlan": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanDescription": { + "type": "string", + "id": 2 + }, + "backupPlanAssociation": { + "type": "string", + "id": 3, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" + } + }, + "backupPlanRules": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "backupPlanRevisionName": { + "type": "string", + "id": 5 + }, + "backupPlanRevisionId": { + "type": "string", + "id": 6 + } + } + }, + "BackupApplianceBackupConfig": { + "fields": { + "backupApplianceName": { + "type": "string", + "id": 1 + }, + "backupApplianceId": { + "type": "int64", + "id": 2 + }, + "slaId": { + "type": "int64", + "id": 3 + }, + "applicationName": { + "type": "string", + "id": 4 + }, + "hostName": { + "type": "string", + "id": 5 + }, + "sltName": { + "type": "string", + "id": 6 + }, + "slpName": { + "type": "string", + "id": 7 + } + } + }, + "DataSourceGcpResource": { + "oneofs": { + "gcpResourceProperties": { + "oneof": [ + "computeInstanceDatasourceProperties", + "cloudSqlInstanceDatasourceProperties", + "diskDatasourceProperties" + ] + } + }, + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "computeInstanceDatasourceProperties": { + "type": "ComputeInstanceDataSourceProperties", + "id": 4 + }, + "cloudSqlInstanceDatasourceProperties": { + "type": "CloudSqlInstanceDataSourceProperties", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diskDatasourceProperties": { + "type": "DiskDataSourceProperties", + "id": 7 + } + } + }, + "DataSourceBackupApplianceApplication": { + "fields": { + "applicationName": { + "type": "string", + "id": 1 + }, + "backupAppliance": { + "type": "string", + "id": 2 + }, + "applianceId": { + "type": "int64", + "id": 3 + }, + "type": { + "type": "string", + "id": 4 + }, + "applicationId": { + "type": "int64", + "id": 8 + }, + "hostname": { + "type": "string", + "id": 6 + }, + "hostId": { + "type": "int64", + "id": 7 + } + } + }, + "ServiceLockInfo": { + "fields": { + "operation": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupApplianceLockInfo": { + "oneofs": { + "lockSource": { + "oneof": [ + "jobName", + "backupImage", + "slaId" + ] + } + }, + "fields": { + "backupApplianceId": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupApplianceName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "lockReason": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "jobName": { + "type": "string", + "id": 6 + }, + "backupImage": { + "type": "string", + "id": 7 + }, + "slaId": { + "type": "int64", + "id": 8 + } + } + }, + "BackupLock": { + "oneofs": { + "ClientLockInfo": { + "oneof": [ + "backupApplianceLockInfo", + "serviceLockInfo" + ] + } + }, + "fields": { + "lockUntilTime": { + "type": "google.protobuf.Timestamp", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupApplianceLockInfo": { + "type": "BackupApplianceLockInfo", + "id": 3 + }, + "serviceLockInfo": { + "type": "ServiceLockInfo", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "Backup": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/Backup", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}", + "(google.api.resource).plural": "backups", + "(google.api.resource).singular": "backup" + }, + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_createTime": { + "oneof": [ + "createTime" + ] + }, + "_updateTime": { + "oneof": [ + "updateTime" + ] + }, + "_enforcedRetentionEndTime": { + "oneof": [ + "enforcedRetentionEndTime" + ] + }, + "_backupRetentionInheritance": { + "oneof": [ + "backupRetentionInheritance" + ] + }, + "_expireTime": { + "oneof": [ + "expireTime" + ] + }, + "_consistencyTime": { + "oneof": [ + "consistencyTime" + ] + }, + "_etag": { + "oneof": [ + "etag" + ] + }, + "backupProperties": { + "oneof": [ + "computeInstanceBackupProperties", + "cloudSqlInstanceBackupProperties", + "backupApplianceBackupProperties", + "diskBackupProperties" + ] + }, + "planInfo": { + "oneof": [ + "gcpBackupPlanInfo" + ] + }, + "_satisfiesPzs": { + "oneof": [ + "satisfiesPzs" + ] + }, + "_satisfiesPzi": { + "oneof": [ + "satisfiesPzi" + ] + }, + "sourceResource": { + "oneof": [ + "gcpResource" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "updateTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "enforcedRetentionEndTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "backupRetentionInheritance": { + "type": "BackupVault.BackupRetentionInheritance", + "id": 30, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "expireTime": { + "type": "google.protobuf.Timestamp", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "consistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "etag": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "state": { + "type": "State", + "id": 15, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "serviceLocks": { + "rule": "repeated", + "type": "BackupLock", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupApplianceLocks": { + "rule": "repeated", + "type": "BackupLock", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeInstanceBackupProperties": { + "type": "ComputeInstanceBackupProperties", + "id": 19, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudSqlInstanceBackupProperties": { + "type": "CloudSqlInstanceBackupProperties", + "id": 26, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupApplianceBackupProperties": { + "type": "BackupApplianceBackupProperties", + "id": 21, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "diskBackupProperties": { + "type": "DiskBackupProperties", + "id": 28, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupType": { + "type": "BackupType", + "id": 20, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "gcpBackupPlanInfo": { + "type": "GCPBackupPlanInfo", + "id": 22, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "resourceSizeBytes": { + "type": "int64", + "id": 23, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "satisfiesPzs": { + "type": "bool", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "satisfiesPzi": { + "type": "bool", + "id": 25, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "gcpResource": { + "type": "BackupGcpResource", + "id": 31, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "kmsKeyVersions": { + "rule": "repeated", + "type": "string", + "id": 33, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" + } + } + }, + "nested": { + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "CREATING": 1, + "ACTIVE": 2, + "DELETING": 3, + "ERROR": 4, + "UPLOADING": 5 + } + }, + "BackupType": { + "values": { + "BACKUP_TYPE_UNSPECIFIED": 0, + "SCHEDULED": 1, + "ON_DEMAND": 2, + "ON_DEMAND_OPERATIONAL": 3 + } + }, + "GCPBackupPlanInfo": { + "fields": { + "backupPlan": { + "type": "string", + "id": 1, + "options": { + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" + } + }, + "backupPlanRuleId": { + "type": "string", + "id": 2 + }, + "backupPlanRevisionName": { + "type": "string", + "id": 3 + }, + "backupPlanRevisionId": { + "type": "string", + "id": 4 + } + } + } + } + }, + "CreateBackupVaultRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "backupVaultId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupVault": { + "type": "BackupVault", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupVaultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "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" + } + }, + "view": { + "type": "BackupVaultView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupVaultsResponse": { + "fields": { + "backupVaults": { + "rule": "repeated", + "type": "BackupVault", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "FetchUsableBackupVaultsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" + } + }, + "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" + } + } + } + }, + "FetchUsableBackupVaultsResponse": { + "fields": { + "backupVaults": { + "rule": "repeated", + "type": "BackupVault", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "FetchBackupsForResourceTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/Backup" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "view": { + "type": "BackupView", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchBackupsForResourceTypeResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "GetBackupVaultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "view": { + "type": "BackupVaultView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupVaultRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backupVault": { + "type": "BackupVault", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "validateOnly": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "forceUpdateAccessRestriction": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupVaultRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "force": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "etag": { + "type": "string", + "id": 4 + }, + "validateOnly": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ignoreBackupPlanReferences": { + "type": "bool", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListDataSourcesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSource" + } + }, + "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" + } + } + } + }, + "ListDataSourcesResponse": { + "fields": { + "dataSources": { + "rule": "repeated", + "type": "DataSource", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetDataSourceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSource" + } + } + } + }, + "UpdateDataSourceRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "dataSource": { + "type": "DataSource", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "allowMissing": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/Backup" + } + }, + "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" + } + }, + "view": { + "type": "BackupView", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "ListBackupsResponse": { + "fields": { + "backups": { + "rule": "repeated", + "type": "Backup", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "GetBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "view": { + "type": "BackupView", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "UpdateBackupRequest": { + "fields": { + "updateMask": { + "type": "google.protobuf.FieldMask", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "backup": { + "type": "Backup", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "requestId": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DeleteBackupRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "RestoreBackupRequest": { + "oneofs": { + "targetEnvironment": { + "oneof": [ + "computeInstanceTargetEnvironment", + "diskTargetEnvironment", + "regionDiskTargetEnvironment" + ] + }, + "instanceProperties": { + "oneof": [ + "computeInstanceRestoreProperties", + "diskRestoreProperties" + ] + }, + "_clearOverridesFieldMask": { + "oneof": [ + "clearOverridesFieldMask" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" + } + }, + "requestId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "computeInstanceTargetEnvironment": { + "type": "ComputeInstanceTargetEnvironment", + "id": 3 + }, + "diskTargetEnvironment": { + "type": "DiskTargetEnvironment", + "id": 5 + }, + "regionDiskTargetEnvironment": { + "type": "RegionDiskTargetEnvironment", + "id": 6 + }, + "computeInstanceRestoreProperties": { + "type": "ComputeInstanceRestoreProperties", + "id": 4 + }, + "diskRestoreProperties": { + "type": "DiskRestoreProperties", + "id": 7 + }, + "clearOverridesFieldMask": { + "type": "google.protobuf.FieldMask", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "RestoreBackupResponse": { + "fields": { + "targetResource": { + "type": "TargetResource", + "id": 1 + } + } + }, + "TargetResource": { + "oneofs": { + "targetResourceInfo": { + "oneof": [ + "gcpResource" + ] + } + }, + "fields": { + "gcpResource": { + "type": "GcpResource", + "id": 1 + } + } + }, + "GcpResource": { + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + } + } + }, + "BackupGcpResource": { + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1 + }, + "location": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + } + } + }, + "BackupConfigState": { + "values": { + "BACKUP_CONFIG_STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "PASSIVE": 2 + } + }, + "BackupView": { + "values": { + "BACKUP_VIEW_UNSPECIFIED": 0, + "BACKUP_VIEW_BASIC": 1, + "BACKUP_VIEW_FULL": 2 + } + }, + "BackupVaultView": { + "values": { + "BACKUP_VAULT_VIEW_UNSPECIFIED": 0, + "BACKUP_VAULT_VIEW_BASIC": 1, + "BACKUP_VAULT_VIEW_FULL": 2 + } + }, + "BackupApplianceBackupProperties": { + "oneofs": { + "_generationId": { + "oneof": [ + "generationId" + ] + }, + "_finalizeTime": { + "oneof": [ + "finalizeTime" + ] + }, + "_recoveryRangeStartTime": { + "oneof": [ + "recoveryRangeStartTime" + ] + }, + "_recoveryRangeEndTime": { + "oneof": [ + "recoveryRangeEndTime" + ] + } + }, + "fields": { + "generationId": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "finalizeTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "recoveryRangeStartTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "recoveryRangeEndTime": { + "type": "google.protobuf.Timestamp", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "DiskTargetEnvironment": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "RegionDiskTargetEnvironment": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "region": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "replicaZones": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "DiskRestoreProperties": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_sizeGb": { + "oneof": [ + "sizeGb" + ] + }, + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_physicalBlockSizeBytes": { + "oneof": [ + "physicalBlockSizeBytes" + ] + }, + "_provisionedIops": { + "oneof": [ + "provisionedIops" + ] + }, + "_provisionedThroughput": { + "oneof": [ + "provisionedThroughput" + ] + }, + "_enableConfidentialCompute": { + "oneof": [ + "enableConfidentialCompute" + ] + }, + "_storagePool": { + "oneof": [ + "storagePool" + ] + }, + "_accessMode": { + "oneof": [ + "accessMode" + ] + }, + "_architecture": { + "oneof": [ + "architecture" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "sizeGb": { + "type": "int64", + "id": 3, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "licenses": { + "rule": "repeated", + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "guestOsFeature": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "physicalBlockSizeBytes": { + "type": "int64", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "provisionedIops": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "provisionedThroughput": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableConfidentialCompute": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "storagePool": { + "type": "string", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "(google.api.resource_reference).type": "compute.googleapis.com/StoragePool", + "proto3_optional": true + } + }, + "accessMode": { + "type": "AccessMode", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "architecture": { + "type": "Architecture", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "resourcePolicy": { + "rule": "repeated", + "type": "string", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "type": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "resourceManagerTags": { + "keyType": "string", + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "AccessMode": { + "values": { + "READ_WRITE_SINGLE": 0, + "READ_WRITE_MANY": 1, + "READ_ONLY_MANY": 2 + } + }, + "Architecture": { + "values": { + "ARCHITECTURE_UNSPECIFIED": 0, + "X86_64": 1, + "ARM64": 2 + } + } + } + }, + "DiskBackupProperties": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_architecture": { + "oneof": [ + "architecture" + ] + }, + "_type": { + "oneof": [ + "type" + ] + }, + "_sizeGb": { + "oneof": [ + "sizeGb" + ] + }, + "_region": { + "oneof": [ + "region" + ] + }, + "_zone": { + "oneof": [ + "zone" + ] + }, + "_sourceDisk": { + "oneof": [ + "sourceDisk" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "licenses": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "guestOsFeature": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 3 + }, + "architecture": { + "type": "Architecture", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "type": { + "type": "string", + "id": 5, + "options": { + "proto3_optional": true + } + }, + "sizeGb": { + "type": "int64", + "id": 6, + "options": { + "proto3_optional": true + } + }, + "region": { + "type": "string", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "zone": { + "type": "string", + "id": 8, + "options": { + "proto3_optional": true + } + }, + "replicaZones": { + "rule": "repeated", + "type": "string", + "id": 9 + }, + "sourceDisk": { + "type": "string", + "id": 10, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "Architecture": { + "values": { + "ARCHITECTURE_UNSPECIFIED": 0, + "X86_64": 1, + "ARM64": 2 + } + } + } + }, + "DiskDataSourceProperties": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "type": { + "type": "string", + "id": 3 + }, + "sizeGb": { + "type": "int64", + "id": 4 + } + } + }, + "ComputeInstanceBackupProperties": { + "oneofs": { + "_description": { + "oneof": [ + "description" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_keyRevocationActionType": { + "oneof": [ + "keyRevocationActionType" + ] + }, + "_sourceInstance": { + "oneof": [ + "sourceInstance" + ] + } + }, + "fields": { + "description": { + "type": "string", + "id": 1, + "options": { + "proto3_optional": true + } + }, + "tags": { + "type": "Tags", + "id": 2, + "options": { + "proto3_optional": true + } + }, + "machineType": { + "type": "string", + "id": 3, + "options": { + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 4, + "options": { + "proto3_optional": true + } + }, + "networkInterface": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 5 + }, + "disk": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 6 + }, + "metadata": { + "type": "Metadata", + "id": 7, + "options": { + "proto3_optional": true + } + }, + "serviceAccount": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 8 + }, + "scheduling": { + "type": "Scheduling", + "id": 9, + "options": { + "proto3_optional": true + } + }, + "guestAccelerator": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 10 + }, + "minCpuPlatform": { + "type": "string", + "id": 11, + "options": { + "proto3_optional": true + } + }, + "keyRevocationActionType": { + "type": "KeyRevocationActionType", + "id": 12, + "options": { + "proto3_optional": true + } + }, + "sourceInstance": { + "type": "string", + "id": 13, + "options": { + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 14 + } + } + }, + "ComputeInstanceRestoreProperties": { + "oneofs": { + "_name": { + "oneof": [ + "name" + ] + }, + "_advancedMachineFeatures": { + "oneof": [ + "advancedMachineFeatures" + ] + }, + "_canIpForward": { + "oneof": [ + "canIpForward" + ] + }, + "_confidentialInstanceConfig": { + "oneof": [ + "confidentialInstanceConfig" + ] + }, + "_deletionProtection": { + "oneof": [ + "deletionProtection" + ] + }, + "_description": { + "oneof": [ + "description" + ] + }, + "_displayDevice": { + "oneof": [ + "displayDevice" + ] + }, + "_hostname": { + "oneof": [ + "hostname" + ] + }, + "_instanceEncryptionKey": { + "oneof": [ + "instanceEncryptionKey" + ] + }, + "_keyRevocationActionType": { + "oneof": [ + "keyRevocationActionType" + ] + }, + "_machineType": { + "oneof": [ + "machineType" + ] + }, + "_metadata": { + "oneof": [ + "metadata" + ] + }, + "_minCpuPlatform": { + "oneof": [ + "minCpuPlatform" + ] + }, + "_networkPerformanceConfig": { + "oneof": [ + "networkPerformanceConfig" + ] + }, + "_params": { + "oneof": [ + "params" + ] + }, + "_privateIpv6GoogleAccess": { + "oneof": [ + "privateIpv6GoogleAccess" + ] + }, + "_allocationAffinity": { + "oneof": [ + "allocationAffinity" + ] + }, + "_scheduling": { + "oneof": [ + "scheduling" + ] + }, + "_tags": { + "oneof": [ + "tags" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "proto3_optional": true + } + }, + "advancedMachineFeatures": { + "type": "AdvancedMachineFeatures", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "canIpForward": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "confidentialInstanceConfig": { + "type": "ConfidentialInstanceConfig", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deletionProtection": { + "type": "bool", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "description": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "disks": { + "rule": "repeated", + "type": "AttachedDisk", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "displayDevice": { + "type": "DisplayDevice", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "guestAccelerators": { + "rule": "repeated", + "type": "AcceleratorConfig", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "hostname": { + "type": "string", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "instanceEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "keyRevocationActionType": { + "type": "KeyRevocationActionType", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "labels": { + "keyType": "string", + "type": "string", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "machineType": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "metadata": { + "type": "Metadata", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "minCpuPlatform": { + "type": "string", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkInterfaces": { + "rule": "repeated", + "type": "NetworkInterface", + "id": 17, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "networkPerformanceConfig": { + "type": "NetworkPerformanceConfig", + "id": 18, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "params": { + "type": "InstanceParams", + "id": 19, + "options": { + "(google.api.field_behavior)": "INPUT_ONLY", + "proto3_optional": true + } + }, + "privateIpv6GoogleAccess": { + "type": "InstancePrivateIpv6GoogleAccess", + "id": 20, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "allocationAffinity": { + "type": "AllocationAffinity", + "id": 21, + "options": { + "json_name": "reservationAffinity", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "resourcePolicies": { + "rule": "repeated", + "type": "string", + "id": 22, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "scheduling": { + "type": "Scheduling", + "id": 23, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "serviceAccounts": { + "rule": "repeated", + "type": "ServiceAccount", + "id": 24, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "tags": { + "type": "Tags", + "id": 26, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "InstancePrivateIpv6GoogleAccess": { + "values": { + "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": 0, + "INHERIT_FROM_SUBNETWORK": 1, + "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 2, + "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 3 + } + } + } + }, + "ComputeInstanceTargetEnvironment": { + "fields": { + "project": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "zone": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + } + } + }, + "ComputeInstanceDataSourceProperties": { + "fields": { + "name": { + "type": "string", + "id": 1 + }, + "description": { + "type": "string", + "id": 2 + }, + "machineType": { + "type": "string", + "id": 3 + }, + "totalDiskCount": { + "type": "int64", + "id": 4 + }, + "totalDiskSizeGb": { + "type": "int64", + "id": 5 + } + } + }, + "AdvancedMachineFeatures": { + "oneofs": { + "_enableNestedVirtualization": { + "oneof": [ + "enableNestedVirtualization" + ] + }, + "_threadsPerCore": { + "oneof": [ + "threadsPerCore" + ] + }, + "_visibleCoreCount": { + "oneof": [ + "visibleCoreCount" + ] + }, + "_enableUefiNetworking": { + "oneof": [ + "enableUefiNetworking" + ] + } + }, + "fields": { + "enableNestedVirtualization": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "threadsPerCore": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "visibleCoreCount": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "enableUefiNetworking": { + "type": "bool", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ConfidentialInstanceConfig": { + "oneofs": { + "_enableConfidentialCompute": { + "oneof": [ + "enableConfidentialCompute" + ] + } + }, + "fields": { + "enableConfidentialCompute": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "DisplayDevice": { + "oneofs": { + "_enableDisplay": { + "oneof": [ + "enableDisplay" + ] + } + }, + "fields": { + "enableDisplay": { + "type": "bool", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "AcceleratorConfig": { + "oneofs": { + "_acceleratorType": { + "oneof": [ + "acceleratorType" + ] + }, + "_acceleratorCount": { + "oneof": [ + "acceleratorCount" + ] + } + }, + "fields": { + "acceleratorType": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "acceleratorCount": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "CustomerEncryptionKey": { + "oneofs": { + "key": { + "oneof": [ + "rawKey", + "rsaEncryptedKey", + "kmsKeyName" + ] + }, + "_kmsKeyServiceAccount": { + "oneof": [ + "kmsKeyServiceAccount" + ] + } + }, + "fields": { + "rawKey": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "rsaEncryptedKey": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyName": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "kmsKeyServiceAccount": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Entry": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_value": { + "oneof": [ + "value" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "value": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "Metadata": { + "fields": { + "items": { + "rule": "repeated", + "type": "Entry", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "NetworkInterface": { + "oneofs": { + "_network": { + "oneof": [ + "network" + ] + }, + "_subnetwork": { + "oneof": [ + "subnetwork" + ] + }, + "_ipAddress": { + "oneof": [ + "ipAddress" + ] + }, + "_ipv6Address": { + "oneof": [ + "ipv6Address" + ] + }, + "_internalIpv6PrefixLength": { + "oneof": [ + "internalIpv6PrefixLength" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_stackType": { + "oneof": [ + "stackType" + ] + }, + "_ipv6AccessType": { + "oneof": [ + "ipv6AccessType" + ] + }, + "_queueCount": { + "oneof": [ + "queueCount" + ] + }, + "_nicType": { + "oneof": [ + "nicType" + ] + }, + "_networkAttachment": { + "oneof": [ + "networkAttachment" + ] + } + }, + "fields": { + "network": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "subnetwork": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ipAddress": { + "type": "string", + "id": 3, + "options": { + "json_name": "networkIP", + "(google.api.field_info).format": "IPV4", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "ipv6Address": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_info).format": "IPV6", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "internalIpv6PrefixLength": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "accessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "ipv6AccessConfigs": { + "rule": "repeated", + "type": "AccessConfig", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "aliasIpRanges": { + "rule": "repeated", + "type": "AliasIpRange", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "stackType": { + "type": "StackType", + "id": 10, + "options": { + "proto3_optional": true + } + }, + "ipv6AccessType": { + "type": "Ipv6AccessType", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "queueCount": { + "type": "int32", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "nicType": { + "type": "NicType", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkAttachment": { + "type": "string", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "StackType": { + "values": { + "STACK_TYPE_UNSPECIFIED": 0, + "IPV4_ONLY": 1, + "IPV4_IPV6": 2 + } + }, + "Ipv6AccessType": { + "values": { + "UNSPECIFIED_IPV6_ACCESS_TYPE": 0, + "INTERNAL": 1, + "EXTERNAL": 2 + } + }, + "NicType": { + "values": { + "NIC_TYPE_UNSPECIFIED": 0, + "VIRTIO_NET": 1, + "GVNIC": 2 + } + } + } + }, + "NetworkPerformanceConfig": { + "oneofs": { + "_totalEgressBandwidthTier": { + "oneof": [ + "totalEgressBandwidthTier" + ] + } + }, + "fields": { + "totalEgressBandwidthTier": { + "type": "Tier", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "Tier": { + "values": { + "TIER_UNSPECIFIED": 0, + "DEFAULT": 1, + "TIER_1": 2 + } + } + } + }, + "AccessConfig": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + }, + "_name": { + "oneof": [ + "name" + ] + }, + "_externalIp": { + "oneof": [ + "externalIp" + ] + }, + "_externalIpv6": { + "oneof": [ + "externalIpv6" + ] + }, + "_externalIpv6PrefixLength": { + "oneof": [ + "externalIpv6PrefixLength" + ] + }, + "_setPublicPtr": { + "oneof": [ + "setPublicPtr" + ] + }, + "_publicPtrDomainName": { + "oneof": [ + "publicPtrDomainName" + ] + }, + "_networkTier": { + "oneof": [ + "networkTier" + ] + } + }, + "fields": { + "type": { + "type": "AccessType", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "name": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIp": { + "type": "string", + "id": 3, + "options": { + "json_name": "natIP", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIpv6": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "externalIpv6PrefixLength": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "setPublicPtr": { + "type": "bool", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "publicPtrDomainName": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "networkTier": { + "type": "NetworkTier", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "AccessType": { + "values": { + "ACCESS_TYPE_UNSPECIFIED": 0, + "ONE_TO_ONE_NAT": 1, + "DIRECT_IPV6": 2 + } + }, + "NetworkTier": { + "values": { + "NETWORK_TIER_UNSPECIFIED": 0, + "PREMIUM": 1, + "STANDARD": 2 + } + } + } + }, + "AliasIpRange": { + "oneofs": { + "_ipCidrRange": { + "oneof": [ + "ipCidrRange" + ] + }, + "_subnetworkRangeName": { + "oneof": [ + "subnetworkRangeName" + ] + } + }, + "fields": { + "ipCidrRange": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "subnetworkRangeName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "InstanceParams": { + "fields": { + "resourceManagerTags": { + "keyType": "string", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AllocationAffinity": { + "oneofs": { + "_consumeAllocationType": { + "oneof": [ + "consumeAllocationType" + ] + }, + "_key": { + "oneof": [ + "key" + ] + } + }, + "fields": { + "consumeAllocationType": { + "type": "Type", + "id": 1, + "options": { + "json_name": "consumeReservationType", + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "key": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "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 + } + } + } + }, + "Scheduling": { + "oneofs": { + "_onHostMaintenance": { + "oneof": [ + "onHostMaintenance" + ] + }, + "_automaticRestart": { + "oneof": [ + "automaticRestart" + ] + }, + "_preemptible": { + "oneof": [ + "preemptible" + ] + }, + "_minNodeCpus": { + "oneof": [ + "minNodeCpus" + ] + }, + "_provisioningModel": { + "oneof": [ + "provisioningModel" + ] + }, + "_instanceTerminationAction": { + "oneof": [ + "instanceTerminationAction" + ] + }, + "_localSsdRecoveryTimeout": { + "oneof": [ + "localSsdRecoveryTimeout" + ] + } + }, + "fields": { + "onHostMaintenance": { + "type": "OnHostMaintenance", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "automaticRestart": { + "type": "bool", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "preemptible": { + "type": "bool", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "nodeAffinities": { + "rule": "repeated", + "type": "NodeAffinity", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "minNodeCpus": { + "type": "int32", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "provisioningModel": { + "type": "ProvisioningModel", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "instanceTerminationAction": { + "type": "InstanceTerminationAction", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "localSsdRecoveryTimeout": { + "type": "SchedulingDuration", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "OnHostMaintenance": { + "values": { + "ON_HOST_MAINTENANCE_UNSPECIFIED": 0, + "TERMINATE": 1, + "MIGRATE": 1000 + } + }, + "NodeAffinity": { + "oneofs": { + "_key": { + "oneof": [ + "key" + ] + }, + "_operator": { + "oneof": [ + "operator" + ] + } + }, + "fields": { + "key": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "operator": { + "type": "Operator", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "values": { + "rule": "repeated", + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + }, + "nested": { + "Operator": { + "values": { + "OPERATOR_UNSPECIFIED": 0, + "IN": 1, + "NOT_IN": 2 + } + } + } + }, + "ProvisioningModel": { + "values": { + "PROVISIONING_MODEL_UNSPECIFIED": 0, + "STANDARD": 1, + "SPOT": 2 + } + }, + "InstanceTerminationAction": { + "values": { + "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": 0, + "DELETE": 1, + "STOP": 2 + } + } + } + }, + "SchedulingDuration": { + "oneofs": { + "_seconds": { + "oneof": [ + "seconds" + ] + }, + "_nanos": { + "oneof": [ + "nanos" + ] + } + }, + "fields": { + "seconds": { + "type": "int64", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "nanos": { + "type": "int32", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + } + }, + "ServiceAccount": { + "oneofs": { + "_email": { + "oneof": [ + "email" + ] + } + }, + "fields": { + "email": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "scopes": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "Tags": { + "fields": { + "items": { + "rule": "repeated", + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "AttachedDisk": { + "oneofs": { + "_initializeParams": { + "oneof": [ + "initializeParams" + ] + }, + "_deviceName": { + "oneof": [ + "deviceName" + ] + }, + "_kind": { + "oneof": [ + "kind" + ] + }, + "_diskTypeDeprecated": { + "oneof": [ + "diskTypeDeprecated" + ] + }, + "_mode": { + "oneof": [ + "mode" + ] + }, + "_source": { + "oneof": [ + "source" + ] + }, + "_index": { + "oneof": [ + "index" + ] + }, + "_boot": { + "oneof": [ + "boot" + ] + }, + "_autoDelete": { + "oneof": [ + "autoDelete" + ] + }, + "_diskInterface": { + "oneof": [ + "diskInterface" + ] + }, + "_diskEncryptionKey": { + "oneof": [ + "diskEncryptionKey" + ] + }, + "_diskSizeGb": { + "oneof": [ + "diskSizeGb" + ] + }, + "_savedState": { + "oneof": [ + "savedState" + ] + }, + "_diskType": { + "oneof": [ + "diskType" + ] + }, + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "initializeParams": { + "type": "InitializeParams", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "deviceName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "kind": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "diskTypeDeprecated": { + "type": "DiskType", + "id": 6, + "options": { + "deprecated": true, + "proto3_optional": true + } + }, + "mode": { + "type": "DiskMode", + "id": 7, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "source": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "index": { + "type": "int64", + "id": 9, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "boot": { + "type": "bool", + "id": 10, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "autoDelete": { + "type": "bool", + "id": 11, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "license": { + "rule": "repeated", + "type": "string", + "id": 12, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diskInterface": { + "type": "DiskInterface", + "id": 13, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "guestOsFeature": { + "rule": "repeated", + "type": "GuestOsFeature", + "id": 14, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "diskEncryptionKey": { + "type": "CustomerEncryptionKey", + "id": 15, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "diskSizeGb": { + "type": "int64", + "id": 16, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "savedState": { + "type": "DiskSavedState", + "id": 17, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "diskType": { + "type": "string", + "id": 18, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + }, + "type": { + "type": "DiskType", + "id": 19, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + } + }, + "nested": { + "InitializeParams": { + "oneofs": { + "_diskName": { + "oneof": [ + "diskName" + ] + } + }, + "fields": { + "diskName": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OPTIONAL", + "proto3_optional": true + } + }, + "replicaZones": { + "rule": "repeated", + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "DiskType": { + "values": { + "DISK_TYPE_UNSPECIFIED": 0, + "SCRATCH": 1, + "PERSISTENT": 2 + } + }, + "DiskMode": { + "values": { + "DISK_MODE_UNSPECIFIED": 0, + "READ_WRITE": 1, + "READ_ONLY": 2, + "LOCKED": 3 + } + }, + "DiskInterface": { + "values": { + "DISK_INTERFACE_UNSPECIFIED": 0, + "SCSI": 1, + "NVME": 2, + "NVDIMM": 3, + "ISCSI": 4 + } + }, + "DiskSavedState": { + "values": { + "DISK_SAVED_STATE_UNSPECIFIED": 0, + "PRESERVED": 1 + } + } + } + }, + "GuestOsFeature": { + "oneofs": { + "_type": { + "oneof": [ + "type" + ] + } + }, + "fields": { + "type": { + "type": "FeatureType", + "id": 1, + "options": { + "proto3_optional": true + } + } + }, + "nested": { + "FeatureType": { + "values": { + "FEATURE_TYPE_UNSPECIFIED": 0, + "VIRTIO_SCSI_MULTIQUEUE": 1, + "WINDOWS": 2, + "MULTI_IP_SUBNET": 3, + "UEFI_COMPATIBLE": 4, + "SECURE_BOOT": 5, + "GVNIC": 6, + "SEV_CAPABLE": 7, + "BARE_METAL_LINUX_COMPATIBLE": 8, + "SUSPEND_RESUME_COMPATIBLE": 9, + "SEV_LIVE_MIGRATABLE": 10, + "SEV_SNP_CAPABLE": 11, + "TDX_CAPABLE": 12, + "IDPF": 13, + "SEV_LIVE_MIGRATABLE_V2": 14 + } + } + } + }, + "KeyRevocationActionType": { + "values": { + "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": 0, + "NONE": 1, + "STOP": 2 + } + }, + "DataSourceReference": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/DataSourceReference", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}", + "(google.api.resource).plural": "dataSourceReferences", + "(google.api.resource).singular": "dataSourceReference" + }, + "oneofs": { + "_totalStoredBytes": { + "oneof": [ + "totalStoredBytes" + ] + } + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "dataSource": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSource" + } + }, + "createTime": { + "type": "google.protobuf.Timestamp", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceBackupConfigState": { + "type": "BackupConfigState", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceBackupCount": { + "type": "int64", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceBackupConfigInfo": { + "type": "DataSourceBackupConfigInfo", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "dataSourceGcpResourceInfo": { + "type": "DataSourceGcpResourceInfo", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "totalStoredBytes": { + "type": "int64", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY", + "proto3_optional": true + } + } + } + }, + "DataSourceBackupConfigInfo": { + "fields": { + "lastBackupState": { + "type": "BackupConfigInfo.LastBackupState", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupConsistencyTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "DataSourceGcpResourceInfo": { + "oneofs": { + "resourceProperties": { + "oneof": [ + "cloudSqlInstanceProperties" + ] + } + }, + "fields": { + "gcpResourcename": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "location": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "cloudSqlInstanceProperties": { + "type": "CloudSqlInstanceDataSourceReferenceProperties", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "GetDataSourceReferenceRequest": { + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSourceReference" + } + } + } + }, + "ListDataSourceReferencesRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSourceReference" + } + }, + "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" + } + } + } + }, + "ListDataSourceReferencesResponse": { + "fields": { + "dataSourceReferences": { + "rule": "repeated", + "type": "DataSourceReference", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + }, + "unreachable": { + "rule": "repeated", + "type": "string", + "id": 3 + } + } + }, + "FetchDataSourceReferencesForResourceTypeRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSourceReference" + } + }, + "resourceType": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "REQUIRED" + } + }, + "pageSize": { + "type": "int32", + "id": 3, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "pageToken": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "filter": { + "type": "string", + "id": 5, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + }, + "orderBy": { + "type": "string", + "id": 6, + "options": { + "(google.api.field_behavior)": "OPTIONAL" + } + } + } + }, + "FetchDataSourceReferencesForResourceTypeResponse": { + "fields": { + "dataSourceReferences": { + "rule": "repeated", + "type": "DataSourceReference", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "BackupDrProtectionSummary": { + "options": { + "(google.api.default_host)": "backupdr.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListResourceBackupConfigs": { + "requestType": "ListResourceBackupConfigsRequest", + "responseType": "ListResourceBackupConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ListResourceBackupConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "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" + } + } + } + }, + "ListResourceBackupConfigsResponse": { + "fields": { + "resourceBackupConfigs": { + "rule": "repeated", + "type": "ResourceBackupConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ResourceBackupConfig": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/ResourceBackupConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}", + "(google.api.resource).plural": "resourceBackupConfigs", + "(google.api.resource).singular": "resourceBackupConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResource": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResourceDisplayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResourceType": { + "type": "ResourceType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResourceLabels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "backupConfigsDetails": { + "rule": "repeated", + "type": "BackupConfigDetails", + "id": 7 + }, + "backupConfigured": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vaulted": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "CLOUD_SQL_INSTANCE": 1, + "COMPUTE_ENGINE_VM": 2, + "COMPUTE_ENGINE_DISK": 3, + "COMPUTE_ENGINE_REGIONAL_DISK": 4 + } + } + } + }, + "BackupConfigDetails": { + "oneofs": { + "planSpecificConfig": { + "oneof": [ + "backupDrPlanConfig", + "backupDrTemplateConfig" + ] + } + }, + "fields": { + "backupConfigSource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupConfigSourceDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pitrSettings": { + "type": "PitrSettings", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestSuccessfulBackupTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "applicableResource": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupVault": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupLocations": { + "rule": "repeated", + "type": "BackupLocation", + "id": 12 + }, + "backupDrPlanConfig": { + "type": "BackupDrPlanConfig", + "id": 10 + }, + "backupDrTemplateConfig": { + "type": "BackupDrTemplateConfig", + "id": 11 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "CLOUD_SQL_INSTANCE_BACKUP_CONFIG": 1, + "COMPUTE_ENGINE_RESOURCE_POLICY": 2, + "BACKUPDR_BACKUP_PLAN": 3, + "BACKUPDR_TEMPLATE": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2, + "ERROR": 3 + } + } + } + }, + "PitrSettings": { + "fields": { + "retentionDays": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupDrTemplateConfig": { + "fields": { + "firstPartyManagementUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyManagementUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupDrPlanConfig": { + "fields": { + "backupDrPlanRules": { + "rule": "repeated", + "type": "BackupDrPlanRule", + "id": 1 + } + } + }, + "BackupDrPlanRule": { + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupLocation": { + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "locationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ZONAL": 1, + "REGIONAL": 2, + "MULTI_REGIONAL": 3 + } + } + } + } + } + } + } + } + } + }, + "api": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", + "java_multiple_files": true, + "java_outer_classname": "ResourceProto", + "java_package": "com.google.api", + "objc_class_prefix": "GAPI", + "cc_enable_arenas": true + }, + "nested": { + "http": { + "type": "HttpRule", + "id": 72295728, + "extend": "google.protobuf.MethodOptions" + }, + "Http": { + "fields": { + "rules": { + "rule": "repeated", + "type": "HttpRule", + "id": 1 + }, + "fullyDecodeReservedExpansion": { + "type": "bool", + "id": 2 + } + } + }, + "HttpRule": { + "oneofs": { + "pattern": { + "oneof": [ + "get", + "put", + "post", + "delete", + "patch", + "custom" + ] + } + }, + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "get": { + "type": "string", + "id": 2 + }, + "put": { + "type": "string", + "id": 3 + }, + "post": { + "type": "string", + "id": 4 + }, + "delete": { + "type": "string", + "id": 5 + }, + "patch": { + "type": "string", + "id": 6 + }, + "custom": { + "type": "CustomHttpPattern", + "id": 8 + }, + "body": { + "type": "string", + "id": 7 + }, + "responseBody": { + "type": "string", + "id": 12 + }, + "additionalBindings": { + "rule": "repeated", + "type": "HttpRule", + "id": 11 + } + } + }, + "CustomHttpPattern": { + "fields": { + "kind": { + "type": "string", + "id": 1 + }, + "path": { + "type": "string", + "id": 2 + } + } + }, + "methodSignature": { + "rule": "repeated", + "type": "string", + "id": 1051, + "extend": "google.protobuf.MethodOptions" + }, + "defaultHost": { + "type": "string", + "id": 1049, + "extend": "google.protobuf.ServiceOptions" + }, + "oauthScopes": { + "type": "string", + "id": 1050, + "extend": "google.protobuf.ServiceOptions" + }, + "apiVersion": { + "type": "string", + "id": 525000001, + "extend": "google.protobuf.ServiceOptions" + }, + "CommonLanguageSettings": { + "fields": { + "referenceDocsUri": { + "type": "string", + "id": 1, + "options": { + "deprecated": true + } + }, + "destinations": { + "rule": "repeated", + "type": "ClientLibraryDestination", + "id": 2 + } + } + }, + "ClientLibrarySettings": { + "fields": { + "version": { + "type": "string", + "id": 1 + }, + "launchStage": { + "type": "LaunchStage", + "id": 2 + }, + "restNumericEnums": { + "type": "bool", + "id": 3 + }, + "javaSettings": { + "type": "JavaSettings", + "id": 21 + }, + "cppSettings": { + "type": "CppSettings", + "id": 22 + }, + "phpSettings": { + "type": "PhpSettings", + "id": 23 + }, + "pythonSettings": { + "type": "PythonSettings", + "id": 24 + }, + "nodeSettings": { + "type": "NodeSettings", + "id": 25 + }, + "dotnetSettings": { + "type": "DotnetSettings", + "id": 26 + }, + "rubySettings": { + "type": "RubySettings", + "id": 27 + }, + "goSettings": { + "type": "GoSettings", + "id": 28 + } + } + }, + "Publishing": { + "fields": { + "methodSettings": { + "rule": "repeated", + "type": "MethodSettings", + "id": 2 + }, + "newIssueUri": { + "type": "string", + "id": 101 + }, + "documentationUri": { + "type": "string", + "id": 102 + }, + "apiShortName": { + "type": "string", + "id": 103 + }, + "githubLabel": { + "type": "string", + "id": 104 + }, + "codeownerGithubTeams": { + "rule": "repeated", + "type": "string", + "id": 105 + }, + "docTagPrefix": { + "type": "string", + "id": 106 + }, + "organization": { + "type": "ClientLibraryOrganization", + "id": 107 + }, + "librarySettings": { + "rule": "repeated", + "type": "ClientLibrarySettings", + "id": 109 + }, + "protoReferenceDocumentationUri": { + "type": "string", + "id": 110 + }, + "restReferenceDocumentationUri": { + "type": "string", + "id": 111 + } + } + }, + "JavaSettings": { + "fields": { + "libraryPackage": { + "type": "string", + "id": 1 + }, + "serviceClassNames": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "common": { + "type": "CommonLanguageSettings", + "id": 3 + } + } + }, + "CppSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PhpSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "PythonSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "NodeSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "DotnetSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + }, + "renamedServices": { + "keyType": "string", + "type": "string", + "id": 2 + }, + "renamedResources": { + "keyType": "string", + "type": "string", + "id": 3 + }, + "ignoredResources": { + "rule": "repeated", + "type": "string", + "id": 4 + }, + "forcedNamespaceAliases": { + "rule": "repeated", + "type": "string", + "id": 5 + }, + "handwrittenSignatures": { + "rule": "repeated", + "type": "string", + "id": 6 + } + } + }, + "RubySettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "GoSettings": { + "fields": { + "common": { + "type": "CommonLanguageSettings", + "id": 1 + } + } + }, + "MethodSettings": { + "fields": { + "selector": { + "type": "string", + "id": 1 + }, + "longRunning": { + "type": "LongRunning", + "id": 2 + }, + "autoPopulatedFields": { + "rule": "repeated", + "type": "string", + "id": 3 + } + }, + "nested": { + "LongRunning": { + "fields": { + "initialPollDelay": { + "type": "google.protobuf.Duration", + "id": 1 + }, + "pollDelayMultiplier": { + "type": "float", + "id": 2 + }, + "maxPollDelay": { + "type": "google.protobuf.Duration", + "id": 3 + }, + "totalPollTimeout": { + "type": "google.protobuf.Duration", + "id": 4 + } + } + } + } + }, + "ClientLibraryOrganization": { + "values": { + "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, + "CLOUD": 1, + "ADS": 2, + "PHOTOS": 3, + "STREET_VIEW": 4, + "SHOPPING": 5, + "GEO": 6, + "GENERATIVE_AI": 7 + } + }, + "ClientLibraryDestination": { + "values": { + "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, + "GITHUB": 10, + "PACKAGE_MANAGER": 20 + } + }, + "LaunchStage": { + "values": { + "LAUNCH_STAGE_UNSPECIFIED": 0, + "UNIMPLEMENTED": 6, + "PRELAUNCH": 7, + "EARLY_ACCESS": 1, + "ALPHA": 2, + "BETA": 3, + "GA": 4, + "DEPRECATED": 5 + } + }, + "fieldBehavior": { + "rule": "repeated", + "type": "google.api.FieldBehavior", + "id": 1052, + "extend": "google.protobuf.FieldOptions", + "options": { + "packed": false + } + }, + "FieldBehavior": { + "values": { + "FIELD_BEHAVIOR_UNSPECIFIED": 0, + "OPTIONAL": 1, + "REQUIRED": 2, + "OUTPUT_ONLY": 3, + "INPUT_ONLY": 4, + "IMMUTABLE": 5, + "UNORDERED_LIST": 6, + "NON_EMPTY_DEFAULT": 7, + "IDENTIFIER": 8 + } + }, + "fieldInfo": { + "type": "google.api.FieldInfo", + "id": 291403980, + "extend": "google.protobuf.FieldOptions" + }, + "FieldInfo": { + "fields": { + "format": { + "type": "Format", + "id": 1 + } + }, + "nested": { + "Format": { + "values": { + "FORMAT_UNSPECIFIED": 0, + "UUID4": 1, + "IPV4": 2, + "IPV6": 3, + "IPV4_OR_IPV6": 4 + } + } + } + }, + "resourceReference": { + "type": "google.api.ResourceReference", + "id": 1055, + "extend": "google.protobuf.FieldOptions" + }, + "resourceDefinition": { + "rule": "repeated", + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.FileOptions" + }, + "resource": { + "type": "google.api.ResourceDescriptor", + "id": 1053, + "extend": "google.protobuf.MessageOptions" + }, + "ResourceDescriptor": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "pattern": { + "rule": "repeated", + "type": "string", + "id": 2 + }, + "nameField": { + "type": "string", + "id": 3 + }, + "history": { + "type": "History", + "id": 4 + }, + "plural": { + "type": "string", + "id": 5 + }, + "singular": { + "type": "string", + "id": 6 + }, + "style": { + "rule": "repeated", + "type": "Style", + "id": 10 + } + }, + "nested": { + "History": { + "values": { + "HISTORY_UNSPECIFIED": 0, + "ORIGINALLY_SINGLE_PATTERN": 1, + "FUTURE_MULTI_PATTERN": 2 + } + }, + "Style": { + "values": { + "STYLE_UNSPECIFIED": 0, + "DECLARATIVE_FRIENDLY": 1 + } + } + } + }, + "ResourceReference": { + "fields": { + "type": { + "type": "string", + "id": 1 + }, + "childType": { + "type": "string", + "id": 2 + } + } + } + } + }, + "protobuf": { + "options": { + "go_package": "google.golang.org/protobuf/types/descriptorpb", + "java_package": "com.google.protobuf", + "java_outer_classname": "DescriptorProtos", + "csharp_namespace": "Google.Protobuf.Reflection", + "objc_class_prefix": "GPB", + "cc_enable_arenas": true, + "optimize_for": "SPEED" + }, + "nested": { + "FileDescriptorSet": { + "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 + } + } + }, + "FieldMask": { + "fields": { + "paths": { + "rule": "repeated", + "type": "string", + "id": 1 + } + } + }, + "Timestamp": { + "fields": { + "seconds": { + "type": "int64", + "id": 1 + }, + "nanos": { + "type": "int32", + "id": 2 + } + } + }, + "Any": { + "fields": { + "type_url": { + "type": "string", + "id": 1 + }, + "value": { + "type": "bytes", + "id": 2 + } + } + }, + "Empty": { + "fields": {} + }, + "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 + } + } + } + } + }, + "type": { + "options": { + "go_package": "google.golang.org/genproto/googleapis/type/month;month", + "java_multiple_files": true, + "java_outer_classname": "MonthProto", + "java_package": "com.google.type", + "objc_class_prefix": "GTP" + }, + "nested": { + "DayOfWeek": { + "values": { + "DAY_OF_WEEK_UNSPECIFIED": 0, + "MONDAY": 1, + "TUESDAY": 2, + "WEDNESDAY": 3, + "THURSDAY": 4, + "FRIDAY": 5, + "SATURDAY": 6, + "SUNDAY": 7 + } + }, + "Month": { + "values": { + "MONTH_UNSPECIFIED": 0, + "JANUARY": 1, + "FEBRUARY": 2, + "MARCH": 3, + "APRIL": 4, + "MAY": 5, + "JUNE": 6, + "JULY": 7, + "AUGUST": 8, + "SEPTEMBER": 9, + "OCTOBER": 10, + "NOVEMBER": 11, + "DECEMBER": 12 + } + } + } + }, + "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 + } + } + } + } + }, + "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 + } + } + } + } + } + } + } + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js new file mode 100644 index 00000000000..744efb47244 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.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(parent, backupPlanId, backupPlan) { + // [START backupdr_v1_generated_BackupDR_CreateBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /[a-z][a-z0-9-]{,62}/. + */ + // const backupPlanId = 'abc123' + /** + * Required. The `BackupPlan` resource object to create. + */ + // const backupPlan = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupPlan() { + // Construct request + const request = { + parent, + backupPlanId, + backupPlan, + }; + + // Run request + const [operation] = await backupdrClient.createBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlan(); + // [END backupdr_v1_generated_BackupDR_CreateBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js new file mode 100644 index 00000000000..71be228e09e --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, backupPlanAssociationId, backupPlanAssociation) { + // [START backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + */ + // const backupPlanAssociationId = 'abc123' + /** + * Required. The resource being created + */ + // const backupPlanAssociation = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupPlanAssociation() { + // Construct request + const request = { + parent, + backupPlanAssociationId, + backupPlanAssociation, + }; + + // Run request + const [operation] = await backupdrClient.createBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js new file mode 100644 index 00000000000..aa8fe7e1485 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.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, backupVaultId, backupVault) { + // [START backupdr_v1_generated_BackupDR_CreateBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Value for parent. + */ + // const parent = 'abc123' + /** + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + */ + // const backupVaultId = 'abc123' + /** + * Required. The resource being created + */ + // const backupVault = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateBackupVault() { + // Construct request + const request = { + parent, + backupVaultId, + backupVault, + }; + + // Run request + const [operation] = await backupdrClient.createBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateBackupVault(); + // [END backupdr_v1_generated_BackupDR_CreateBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js new file mode 100644 index 00000000000..19d882e52e5 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.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(parent, managementServerId, managementServer) { + // [START backupdr_v1_generated_BackupDR_CreateManagementServer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + */ + // const parent = 'abc123' + /** + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + */ + // const managementServerId = 'abc123' + /** + * Required. A management server + * resource google.cloud.backupdr.v1.ManagementServer + */ + // const managementServer = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callCreateManagementServer() { + // Construct request + const request = { + parent, + managementServerId, + managementServer, + }; + + // Run request + const [operation] = await backupdrClient.createManagementServer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callCreateManagementServer(); + // [END backupdr_v1_generated_BackupDR_CreateManagementServer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js new file mode 100644 index 00000000000..dc9bee40a34 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 backupdr_v1_generated_BackupDR_DeleteBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackup(); + // [END backupdr_v1_generated_BackupDR_DeleteBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js new file mode 100644 index 00000000000..70a490a5b4b --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 `BackupPlan` to delete. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlan(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js new file mode 100644 index 00000000000..70e1ca0efc2 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js @@ -0,0 +1,77 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupPlanAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js new file mode 100644 index 00000000000..6a3e236ab2c --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.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(name) { + // [START backupdr_v1_generated_BackupDR_DeleteBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + */ + // const force = true + /** + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + */ + // const etag = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + /** + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + */ + // const allowMissing = true + /** + * Optional. If set to true, backupvault deletion will proceed even if there + * are backup plans referencing the backupvault. The default is 'false'. + */ + // const ignoreBackupPlanReferences = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteBackupVault() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteBackupVault(); + // [END backupdr_v1_generated_BackupDR_DeleteBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js new file mode 100644 index 00000000000..c7a17945e6b --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js @@ -0,0 +1,76 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 backupdr_v1_generated_BackupDR_DeleteManagementServer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the resource + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callDeleteManagementServer() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.deleteManagementServer(request); + const [response] = await operation.promise(); + console.log(response); + } + + callDeleteManagementServer(); + // [END backupdr_v1_generated_BackupDR_DeleteManagementServer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js new file mode 100644 index 00000000000..eb9ebd76fe4 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js @@ -0,0 +1,105 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, resourceType) { + // [START backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + */ + // const resourceType = 'abc123' + /** + * Optional. The maximum number of BackupPlanAssociations to return. The + * service may return fewer than this value. If unspecified, at most 50 + * BackupPlanAssociations will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous call of + * `FetchBackupPlanAssociationsForResourceType`. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `FetchBackupPlanAssociationsForResourceType` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * resource + * * backup_plan + * * state + * * data_source + * * cloud_sql_instance_backup_plan_association_properties.instance_create_time + */ + // const filter = 'abc123' + /** + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * Supported fields: + * * name + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchBackupPlanAssociationsForResourceType() { + // Construct request + const request = { + parent, + resourceType, + }; + + // Run request + const iterable = backupdrClient.fetchBackupPlanAssociationsForResourceTypeAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchBackupPlanAssociationsForResourceType(); + // [END backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js new file mode 100644 index 00000000000..83d92447b52 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js @@ -0,0 +1,104 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, resourceType) { + // [START backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Datasources are the parent resource for the backups. + * Format: + * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} + */ + // const parent = 'abc123' + /** + * Required. The type of the GCP resource. + * Ex: sqladmin.googleapis.com/Instance + */ + // const resourceType = 'abc123' + /** + * Optional. The maximum number of Backups to return. The service may + * return fewer than this value. If unspecified, at most 50 + * Backups will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous call of + * `FetchBackupsForResourceType`. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `FetchBackupsForResourceType` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + */ + // const filter = 'abc123' + /** + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + */ + // const orderBy = 'abc123' + /** + * Optional. This parameter is used to specify the view of the backup. + * If not specified, the default view is BASIC. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchBackupsForResourceType() { + // Construct request + const request = { + parent, + resourceType, + }; + + // Run request + const iterable = backupdrClient.fetchBackupsForResourceTypeAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchBackupsForResourceType(); + // [END backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js new file mode 100644 index 00000000000..ba8227643a3 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js @@ -0,0 +1,109 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, resourceType) { + // [START backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + */ + // const resourceType = 'abc123' + /** + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous call of + * `FetchDataSourceReferencesForResourceType`. + * Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `FetchDataSourceReferencesForResourceType` must match + * the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_backup_config_state + * * data_source_backup_count + * * data_source_backup_config_info.last_backup_state + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_gcp_resource_info.type + * * data_source_gcp_resource_info.location + * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + */ + // const filter = 'abc123' + /** + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * Supported fields: + * * name + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchDataSourceReferencesForResourceType() { + // Construct request + const request = { + parent, + resourceType, + }; + + // Run request + const iterable = backupdrClient.fetchDataSourceReferencesForResourceTypeAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchDataSourceReferencesForResourceType(); + // [END backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js new file mode 100644 index 00000000000..5bfda0bb76d --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.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(parent) { + // [START backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callFetchUsableBackupVaults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.fetchUsableBackupVaultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callFetchUsableBackupVaults(); + // [END backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js new file mode 100644 index 00000000000..1db664e9c80 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + */ + // const name = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackup(request); + console.log(response); + } + + callGetBackup(); + // [END backupdr_v1_generated_BackupDR_GetBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js new file mode 100644 index 00000000000..cd367d4a1ce --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.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(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 `BackupPlan` to retrieve. + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlan() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlan(request); + console.log(response); + } + + callGetBackupPlan(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js new file mode 100644 index 00000000000..d79ba972be0 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.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(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlanAssociation() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlanAssociation(request); + console.log(response); + } + + callGetBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js new file mode 100644 index 00000000000..7b00b5c17df --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js @@ -0,0 +1,63 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 `BackupPlanRevision` to retrieve. + * Format: + * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupPlanRevision() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupPlanRevision(request); + console.log(response); + } + + callGetBackupPlanRevision(); + // [END backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js new file mode 100644 index 00000000000..14fdb5572ad --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js @@ -0,0 +1,67 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(name) { + // [START backupdr_v1_generated_BackupDR_GetBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + */ + // const name = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetBackupVault() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getBackupVault(request); + console.log(response); + } + + callGetBackupVault(); + // [END backupdr_v1_generated_BackupDR_GetBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js new file mode 100644 index 00000000000..b6be2c0fe07 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.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(name) { + // [START backupdr_v1_generated_BackupDR_GetDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetDataSource() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getDataSource(request); + console.log(response); + } + + callGetDataSource(); + // [END backupdr_v1_generated_BackupDR_GetDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js new file mode 100644 index 00000000000..8bcb3f16254 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.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 backupdr_v1_generated_BackupDR_GetDataSourceReference_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 DataSourceReference to retrieve. + * Format: + * projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetDataSourceReference() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getDataSourceReference(request); + console.log(response); + } + + callGetDataSourceReference(); + // [END backupdr_v1_generated_BackupDR_GetDataSourceReference_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js new file mode 100644 index 00000000000..03e80ac1640 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.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(name) { + // [START backupdr_v1_generated_BackupDR_GetManagementServer_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' + */ + // const name = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callGetManagementServer() { + // Construct request + const request = { + name, + }; + + // Run request + const response = await backupdrClient.getManagementServer(request); + console.log(response); + } + + callGetManagementServer(); + // [END backupdr_v1_generated_BackupDR_GetManagementServer_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js new file mode 100644 index 00000000000..55c53e70194 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, resourceType) { + // [START backupdr_v1_generated_BackupDR_InitializeService_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 serviceConfig used to initialize the + * service. Format: + * `projects/{project_id}/locations/{location}/serviceConfig`. + */ + // const name = 'abc123' + /** + * Required. The resource type to which the default service config will be + * applied. Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + */ + // const resourceType = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. The configuration for initializing a Cloud SQL instance. + */ + // const cloudSqlInstanceInitializationConfig = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callInitializeService() { + // Construct request + const request = { + name, + resourceType, + }; + + // Run request + const [operation] = await backupdrClient.initializeService(request); + const [response] = await operation.promise(); + console.log(response); + } + + callInitializeService(); + // [END backupdr_v1_generated_BackupDR_InitializeService_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js new file mode 100644 index 00000000000..3b8a476c2b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js @@ -0,0 +1,81 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results + */ + // const filter = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlanAssociations() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlanAssociationsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlanAssociations(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js new file mode 100644 index 00000000000..2fcc7d36b5b --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.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) { + // [START backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve + * `BackupPlanRevisions` information. Format: + * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The value of + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlanRevisions() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlanRevisionsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlanRevisions(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js new file mode 100644 index 00000000000..3be463bf2e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.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 backupdr_v1_generated_BackupDR_ListBackupPlans_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * to determine if there are more instances left to be queried. + */ + // const pageSize = 1234 + /** + * Optional. The value of + * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + */ + // const pageToken = 'abc123' + /** + * Optional. Field match expression used to filter the results. + */ + // const filter = 'abc123' + /** + * Optional. Field by which to sort the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupPlans() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupPlansAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupPlans(); + // [END backupdr_v1_generated_BackupDR_ListBackupPlans_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js new file mode 100644 index 00000000000..e1bb4508c4e --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.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(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackupVaults_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackupVaults() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupVaultsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackupVaults(); + // [END backupdr_v1_generated_BackupDR_ListBackupVaults_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js new file mode 100644 index 00000000000..b2736b060b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.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(parent) { + // [START backupdr_v1_generated_BackupDR_ListBackups_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + /** + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + */ + // const view = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListBackups() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listBackupsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListBackups(); + // [END backupdr_v1_generated_BackupDR_ListBackups_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js new file mode 100644 index 00000000000..c84c7594aa3 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js @@ -0,0 +1,96 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 backupdr_v1_generated_BackupDR_ListDataSourceReferences_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + */ + // const parent = 'abc123' + /** + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + */ + // const pageSize = 1234 + /** + * Optional. A page token, received from a previous `ListDataSourceReferences` + * call. Provide this to retrieve the subsequent page. + * When paginating, all other parameters provided to + * `ListDataSourceReferences` must match the call that provided the page + * token. + */ + // const pageToken = 'abc123' + /** + * Optional. A filter expression that filters the results listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. + * The following field and operator combinations are supported: + * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + * * data_source_gcp_resource_info.type with `=`, `!=` + */ + // const filter = 'abc123' + /** + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * Supported fields: + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListDataSourceReferences() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listDataSourceReferencesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataSourceReferences(); + // [END backupdr_v1_generated_BackupDR_ListDataSourceReferences_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js new file mode 100644 index 00000000000..e27878ed103 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.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(parent) { + // [START backupdr_v1_generated_BackupDR_ListDataSources_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListDataSources() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listDataSourcesAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListDataSources(); + // [END backupdr_v1_generated_BackupDR_ListDataSources_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js new file mode 100644 index 00000000000..90c999155be --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.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(parent) { + // [START backupdr_v1_generated_BackupDR_ListManagementServers_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callListManagementServers() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listManagementServersAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListManagementServers(); + // [END backupdr_v1_generated_BackupDR_ListManagementServers_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js new file mode 100644 index 00000000000..26250028fd3 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js @@ -0,0 +1,109 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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 backupdr_v1_generated_BackupDR_RestoreBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 Backup instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. + */ + // const name = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Compute Engine target environment to be used during restore. + */ + // const computeInstanceTargetEnvironment = {} + /** + * Disk target environment to be used during restore. + */ + // const diskTargetEnvironment = {} + /** + * Region disk target environment to be used during restore. + */ + // const regionDiskTargetEnvironment = {} + /** + * Compute Engine instance properties to be overridden during restore. + */ + // const computeInstanceRestoreProperties = {} + /** + * Disk properties to be overridden during restore. + */ + // const diskRestoreProperties = {} + /** + * Optional. A field mask used to clear server-side default values + * for fields within the `instance_properties` oneof. + * When a field in this mask is cleared, the server will not apply its + * default logic (like inheriting a value from the source) for that field. + * The most common current use case is clearing default encryption keys. + * Examples of field mask paths: + * - Compute Instance Disks: + * `compute_instance_restore_properties.disks.*.disk_encryption_key` + * - Single Disk: `disk_restore_properties.disk_encryption_key` + */ + // const clearOverridesFieldMask = {} + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callRestoreBackup() { + // Construct request + const request = { + name, + }; + + // Run request + const [operation] = await backupdrClient.restoreBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callRestoreBackup(); + // [END backupdr_v1_generated_BackupDR_RestoreBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js new file mode 100644 index 00000000000..b8c0ade8a11 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js @@ -0,0 +1,82 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically 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, ruleId) { + // [START backupdr_v1_generated_BackupDR_TriggerBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + */ + // const name = 'abc123' + /** + * Required. backup rule_id for which a backup needs to be triggered. + */ + // const ruleId = 'abc123' + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callTriggerBackup() { + // Construct request + const request = { + name, + ruleId, + }; + + // Run request + const [operation] = await backupdrClient.triggerBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callTriggerBackup(); + // [END backupdr_v1_generated_BackupDR_TriggerBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js new file mode 100644 index 00000000000..80cb7a400e7 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.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(updateMask, backup) { + // [START backupdr_v1_generated_BackupDR_UpdateBackup_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backup = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackup() { + // Construct request + const request = { + updateMask, + backup, + }; + + // Run request + const [operation] = await backupdrClient.updateBackup(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackup(); + // [END backupdr_v1_generated_BackupDR_UpdateBackup_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js new file mode 100644 index 00000000000..45ee6f6baae --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.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(backupPlan, updateMask) { + // [START backupdr_v1_generated_BackupDR_UpdateBackupPlan_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 being updated + */ + // const backupPlan = {} + /** + * Required. The list of fields to update. + * Field mask is used to specify the fields to be overwritten in the + * BackupPlan resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * Currently, these fields are supported in update: description, schedules, + * retention period, adding and removing Backup Rules. + */ + // const updateMask = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackupPlan() { + // Construct request + const request = { + backupPlan, + updateMask, + }; + + // Run request + const [operation] = await backupdrClient.updateBackupPlan(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackupPlan(); + // [END backupdr_v1_generated_BackupDR_UpdateBackupPlan_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js new file mode 100644 index 00000000000..cb6d94b74b1 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.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(backupPlanAssociation, updateMask) { + // [START backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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 being updated + */ + // const backupPlanAssociation = {} + /** + * Required. The list of fields to update. + * Field mask is used to specify the fields to be overwritten in the + * BackupPlanAssociation resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * Currently backup_plan_association.backup_plan is the only supported field. + */ + // const updateMask = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackupPlanAssociation() { + // Construct request + const request = { + backupPlanAssociation, + updateMask, + }; + + // Run request + const [operation] = await backupdrClient.updateBackupPlanAssociation(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackupPlanAssociation(); + // [END backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js new file mode 100644 index 00000000000..cf8aba9e2b3 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js @@ -0,0 +1,100 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, backupVault) { + // [START backupdr_v1_generated_BackupDR_UpdateBackupVault_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const backupVault = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + */ + // const validateOnly = true + /** + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + */ + // const force = true + /** + * Optional. If set to true, we will force update access restriction even if + * some non compliant data sources are present. The default is 'false'. + */ + // const forceUpdateAccessRestriction = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateBackupVault() { + // Construct request + const request = { + updateMask, + backupVault, + }; + + // Run request + const [operation] = await backupdrClient.updateBackupVault(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateBackupVault(); + // [END backupdr_v1_generated_BackupDR_UpdateBackupVault_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js new file mode 100644 index 00000000000..23861e49849 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js @@ -0,0 +1,89 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + + + +'use strict'; + +function main(updateMask, dataSource) { + // [START backupdr_v1_generated_BackupDR_UpdateDataSource_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It 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. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + */ + // const updateMask = {} + /** + * Required. The resource being updated + */ + // const dataSource = {} + /** + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + */ + // const requestId = 'abc123' + /** + * Optional. Enable upsert. + */ + // const allowMissing = true + + // Imports the Backupdr library + const {BackupDRClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDRClient(); + + async function callUpdateDataSource() { + // Construct request + const request = { + updateMask, + dataSource, + }; + + // Run request + const [operation] = await backupdrClient.updateDataSource(request); + const [response] = await operation.promise(); + console.log(response); + } + + callUpdateDataSource(); + // [END backupdr_v1_generated_BackupDR_UpdateDataSource_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js new file mode 100644 index 00000000000..60a264503ce --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.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) { + // [START backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_async] + /** + * This snippet has been automatically generated and should be regarded as a code template only. + * It will require modifications to work. + * It may require correct/in-range values for request initialization. + * TODO(developer): Uncomment these variables before running the sample. + */ + /** + * Required. The project and location for which to retrieve resource backup + * configs. Format: 'projects/{project_id}/locations/{location}'. In Google + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + */ + // const parent = 'abc123' + /** + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will use 100 as default. Maximum value is + * 500 and values above 500 will be coerced to 500. + */ + // const pageSize = 1234 + /** + * Optional. A token identifying a page of results the server should return. + */ + // const pageToken = 'abc123' + /** + * Optional. Filtering results. + */ + // const filter = 'abc123' + /** + * Optional. Hint for how to order the results. + */ + // const orderBy = 'abc123' + + // Imports the Backupdr library + const {BackupDrProtectionSummaryClient} = require('@google-cloud/backupdr').v1; + + // Instantiates a client + const backupdrClient = new BackupDrProtectionSummaryClient(); + + async function callListResourceBackupConfigs() { + // Construct request + const request = { + parent, + }; + + // Run request + const iterable = backupdrClient.listResourceBackupConfigsAsync(request); + for await (const response of iterable) { + console.log(response); + } + } + + callListResourceBackupConfigs(); + // [END backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_async] +} + +process.on('unhandledRejection', err => { + console.error(err.message); + process.exitCode = 1; +}); +main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json new file mode 100644 index 00000000000..e5916e1c98e --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json @@ -0,0 +1,1959 @@ +{ + "clientLibrary": { + "name": "nodejs-backupdr", + "version": "0.1.0", + "language": "TYPESCRIPT", + "apis": [ + { + "id": "google.cloud.backupdr.v1", + "version": "v1" + } + ] + }, + "snippets": [ + { + "regionTag": "backupdr_v1_generated_BackupDR_ListManagementServers_async", + "title": "BackupDR listManagementServers Sample", + "origin": "API_DEFINITION", + "description": " Lists ManagementServers in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_management_servers.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListManagementServers", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListManagementServers", + "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.backupdr.v1.ListManagementServersResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListManagementServers", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListManagementServers", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetManagementServer_async", + "title": "BackupDR getManagementServer Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single ManagementServer.", + "canonical": true, + "file": "backup_d_r.get_management_server.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetManagementServer", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetManagementServer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ManagementServer", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetManagementServer", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetManagementServer", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateManagementServer_async", + "title": "BackupDR createManagementServer Sample", + "origin": "API_DEFINITION", + "description": " Creates a new ManagementServer in a given project and location.", + "canonical": true, + "file": "backup_d_r.create_management_server.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateManagementServer", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateManagementServer", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "management_server_id", + "type": "TYPE_STRING" + }, + { + "name": "management_server", + "type": ".google.cloud.backupdr.v1.ManagementServer" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateManagementServer", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateManagementServer", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteManagementServer_async", + "title": "BackupDR deleteManagementServer Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single ManagementServer.", + "canonical": true, + "file": "backup_d_r.delete_management_server.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteManagementServer", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteManagementServer", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteManagementServer", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteManagementServer", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupVault_async", + "title": "BackupDR createBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Creates a new BackupVault in a given project and location.", + "canonical": true, + "file": "backup_d_r.create_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_vault_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_vault", + "type": ".google.cloud.backupdr.v1.BackupVault" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupVaults_async", + "title": "BackupDR listBackupVaults Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupVaults in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_vaults.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", + "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" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupVaultView" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupVaultsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async", + "title": "BackupDR fetchUsableBackupVaults Sample", + "origin": "API_DEFINITION", + "description": " FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.", + "canonical": true, + "file": "backup_d_r.fetch_usable_backup_vaults.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchUsableBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", + "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.backupdr.v1.FetchUsableBackupVaultsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "FetchUsableBackupVaults", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupVault_async", + "title": "BackupDR getBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a BackupVault.", + "canonical": true, + "file": "backup_d_r.get_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupVaultView" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupVault", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupVault_async", + "title": "BackupDR updateBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a BackupVault.", + "canonical": true, + "file": "backup_d_r.update_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 92, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup_vault", + "type": ".google.cloud.backupdr.v1.BackupVault" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "force_update_access_restriction", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupVault_async", + "title": "BackupDR deleteBackupVault Sample", + "origin": "API_DEFINITION", + "description": " Deletes a BackupVault.", + "canonical": true, + "file": "backup_d_r.delete_backup_vault.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 94, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "force", + "type": "TYPE_BOOL" + }, + { + "name": "etag", + "type": "TYPE_STRING" + }, + { + "name": "validate_only", + "type": "TYPE_BOOL" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + }, + { + "name": "ignore_backup_plan_references", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupVault", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListDataSources_async", + "title": "BackupDR listDataSources Sample", + "origin": "API_DEFINITION", + "description": " Lists DataSources in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_data_sources.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataSources", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", + "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.backupdr.v1.ListDataSourcesResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListDataSources", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetDataSource_async", + "title": "BackupDR getDataSource Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a DataSource.", + "canonical": true, + "file": "backup_d_r.get_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.DataSource", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateDataSource_async", + "title": "BackupDR updateDataSource Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a DataSource.", + "canonical": true, + "file": "backup_d_r.update_data_source.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "data_source", + "type": ".google.cloud.backupdr.v1.DataSource" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "allow_missing", + "type": "TYPE_BOOL" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateDataSource", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackups_async", + "title": "BackupDR listBackups Sample", + "origin": "API_DEFINITION", + "description": " Lists Backups in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backups.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 82, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackups", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", + "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" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackups", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async", + "title": "BackupDR fetchBackupsForResourceType Sample", + "origin": "API_DEFINITION", + "description": " Fetch Backups for a given resource type.", + "canonical": true, + "file": "backup_d_r.fetch_backups_for_resource_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 96, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchBackupsForResourceType", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceType", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "resource_type", + "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" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "FetchBackupsForResourceType", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceType", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackup_async", + "title": "BackupDR getBackup Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a Backup.", + "canonical": true, + "file": "backup_d_r.get_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 59, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "view", + "type": ".google.cloud.backupdr.v1.BackupView" + } + ], + "resultType": ".google.cloud.backupdr.v1.Backup", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackup_async", + "title": "BackupDR updateBackup Sample", + "origin": "API_DEFINITION", + "description": " Updates the settings of a Backup.", + "canonical": true, + "file": "backup_d_r.update_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 77, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", + "async": true, + "parameters": [ + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "backup", + "type": ".google.cloud.backupdr.v1.Backup" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackup_async", + "title": "BackupDR deleteBackup Sample", + "origin": "API_DEFINITION", + "description": " Deletes a Backup.", + "canonical": true, + "file": "backup_d_r.delete_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 68, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_RestoreBackup_async", + "title": "BackupDR restoreBackup Sample", + "origin": "API_DEFINITION", + "description": " Restore from a Backup", + "canonical": true, + "file": "backup_d_r.restore_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 101, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "RestoreBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "compute_instance_target_environment", + "type": ".google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment" + }, + { + "name": "disk_target_environment", + "type": ".google.cloud.backupdr.v1.DiskTargetEnvironment" + }, + { + "name": "region_disk_target_environment", + "type": ".google.cloud.backupdr.v1.RegionDiskTargetEnvironment" + }, + { + "name": "compute_instance_restore_properties", + "type": ".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties" + }, + { + "name": "disk_restore_properties", + "type": ".google.cloud.backupdr.v1.DiskRestoreProperties" + }, + { + "name": "clear_overrides_field_mask", + "type": ".google.protobuf.FieldMask" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "RestoreBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlan_async", + "title": "BackupDR createBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Create a BackupPlan", + "canonical": true, + "file": "backup_d_r.create_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 83, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan", + "type": ".google.cloud.backupdr.v1.BackupPlan" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupPlan_async", + "title": "BackupDR updateBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Update a BackupPlan.", + "canonical": true, + "file": "backup_d_r.update_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 80, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlan", + "async": true, + "parameters": [ + { + "name": "backup_plan", + "type": ".google.cloud.backupdr.v1.BackupPlan" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlan_async", + "title": "BackupDR getBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlan.", + "canonical": true, + "file": "backup_d_r.get_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlan", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlans_async", + "title": "BackupDR listBackupPlans Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlans in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plans.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 85, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", + "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.backupdr.v1.ListBackupPlansResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlans", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlan_async", + "title": "BackupDR deleteBackupPlan Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackupPlan.", + "canonical": true, + "file": "backup_d_r.delete_backup_plan.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupPlan", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async", + "title": "BackupDR getBackupPlanRevision Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlanRevision.", + "canonical": true, + "file": "backup_d_r.get_backup_plan_revision.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlanRevision", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevision", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlanRevision", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlanRevision", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevision", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async", + "title": "BackupDR listBackupPlanRevisions Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlanRevisions in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plan_revisions.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlanRevisions", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisions", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "page_size", + "type": "TYPE_INT32" + }, + { + "name": "page_token", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlanRevisions", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisions", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async", + "title": "BackupDR createBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Create a BackupPlanAssociation", + "canonical": true, + "file": "backup_d_r.create_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "CreateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_association_id", + "type": "TYPE_STRING" + }, + { + "name": "backup_plan_association", + "type": ".google.cloud.backupdr.v1.BackupPlanAssociation" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "CreateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async", + "title": "BackupDR updateBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Update a BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.update_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 79, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "UpdateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "backup_plan_association", + "type": ".google.cloud.backupdr.v1.BackupPlanAssociation" + }, + { + "name": "update_mask", + "type": ".google.protobuf.FieldMask" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "UpdateBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async", + "title": "BackupDR getBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.get_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 54, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.BackupPlanAssociation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async", + "title": "BackupDR listBackupPlanAssociations Sample", + "origin": "API_DEFINITION", + "description": " Lists BackupPlanAssociations in a given project and location.", + "canonical": true, + "file": "backup_d_r.list_backup_plan_associations.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 73, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListBackupPlanAssociations", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", + "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.backupdr.v1.ListBackupPlanAssociationsResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListBackupPlanAssociations", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async", + "title": "BackupDR fetchBackupPlanAssociationsForResourceType Sample", + "origin": "API_DEFINITION", + "description": " List BackupPlanAssociations for a given resource type.", + "canonical": true, + "file": "backup_d_r.fetch_backup_plan_associations_for_resource_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 97, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchBackupPlanAssociationsForResourceType", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceType", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "resource_type", + "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.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "FetchBackupPlanAssociationsForResourceType", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceType", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async", + "title": "BackupDR deleteBackupPlanAssociation Sample", + "origin": "API_DEFINITION", + "description": " Deletes a single BackupPlanAssociation.", + "canonical": true, + "file": "backup_d_r.delete_backup_plan_association.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 69, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "DeleteBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "DeleteBackupPlanAssociation", + "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_TriggerBackup_async", + "title": "BackupDR triggerBackup Sample", + "origin": "API_DEFINITION", + "description": " Triggers a new Backup.", + "canonical": true, + "file": "backup_d_r.trigger_backup.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 74, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "TriggerBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "rule_id", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "TriggerBackup", + "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_GetDataSourceReference_async", + "title": "BackupDR getDataSourceReference Sample", + "origin": "API_DEFINITION", + "description": " Gets details of a single DataSourceReference.", + "canonical": true, + "file": "backup_d_r.get_data_source_reference.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 55, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "GetDataSourceReference", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSourceReference", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + } + ], + "resultType": ".google.cloud.backupdr.v1.DataSourceReference", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "GetDataSourceReference", + "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSourceReference", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_ListDataSourceReferences_async", + "title": "BackupDR listDataSourceReferences Sample", + "origin": "API_DEFINITION", + "description": " Lists DataSourceReferences for a given project and location.", + "canonical": true, + "file": "backup_d_r.list_data_source_references.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 88, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListDataSourceReferences", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSourceReferences", + "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.backupdr.v1.ListDataSourceReferencesResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "ListDataSourceReferences", + "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSourceReferences", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async", + "title": "BackupDR fetchDataSourceReferencesForResourceType Sample", + "origin": "API_DEFINITION", + "description": " Fetch DataSourceReferences for a given project, location and resource type.", + "canonical": true, + "file": "backup_d_r.fetch_data_source_references_for_resource_type.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 101, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "FetchDataSourceReferencesForResourceType", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceType", + "async": true, + "parameters": [ + { + "name": "parent", + "type": "TYPE_STRING" + }, + { + "name": "resource_type", + "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.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "FetchDataSourceReferencesForResourceType", + "fullName": "google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceType", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDR_InitializeService_async", + "title": "BackupDR initializeService Sample", + "origin": "API_DEFINITION", + "description": " Initializes the service related config for a project.", + "canonical": true, + "file": "backup_d_r.initialize_service.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 81, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "InitializeService", + "fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService", + "async": true, + "parameters": [ + { + "name": "name", + "type": "TYPE_STRING" + }, + { + "name": "resource_type", + "type": "TYPE_STRING" + }, + { + "name": "request_id", + "type": "TYPE_STRING" + }, + { + "name": "cloud_sql_instance_initialization_config", + "type": ".google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig" + } + ], + "resultType": ".google.longrunning.Operation", + "client": { + "shortName": "BackupDRClient", + "fullName": "google.cloud.backupdr.v1.BackupDRClient" + }, + "method": { + "shortName": "InitializeService", + "fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService", + "service": { + "shortName": "BackupDR", + "fullName": "google.cloud.backupdr.v1.BackupDR" + } + } + } + }, + { + "regionTag": "backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_async", + "title": "BackupDR listResourceBackupConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists ResourceBackupConfigs.", + "canonical": true, + "file": "backup_dr_protection_summary.list_resource_backup_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListResourceBackupConfigs", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigs", + "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.backupdr.v1.ListResourceBackupConfigsResponse", + "client": { + "shortName": "BackupDrProtectionSummaryClient", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummaryClient" + }, + "method": { + "shortName": "ListResourceBackupConfigs", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigs", + "service": { + "shortName": "BackupDrProtectionSummary", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary" + } + } + } + } + ] +} diff --git a/owl-bot-staging/google-cloud-backupdr/src/index.ts b/owl-bot-staging/google-cloud-backupdr/src/index.ts new file mode 100644 index 00000000000..5bc8aa0b7be --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/index.ts @@ -0,0 +1,29 @@ +// 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 BackupDRClient = v1.BackupDRClient; +type BackupDRClient = v1.BackupDRClient; +const BackupDrProtectionSummaryClient = v1.BackupDrProtectionSummaryClient; +type BackupDrProtectionSummaryClient = v1.BackupDrProtectionSummaryClient; + +export {v1, BackupDRClient, BackupDrProtectionSummaryClient}; +export default {v1, BackupDRClient, BackupDrProtectionSummaryClient}; +import * as protos from '../protos/protos'; +export {protos}; diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts new file mode 100644 index 00000000000..2dda6fe7907 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts @@ -0,0 +1,7449 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/backup_d_r_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './backup_d_r_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The BackupDR Service + * @class + * @memberof v1 + */ +export class BackupDRClient { + 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('backupdr'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + operationsClient: gax.OperationsClient; + backupDRStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BackupDRClient. + * + * @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 BackupDRClient({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 BackupDRClient; + 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 = 'backupdr.' + 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); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}' + ), + backupPlanPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}' + ), + backupPlanAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}' + ), + backupPlanRevisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}' + ), + backupVaultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}' + ), + dataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}' + ), + dataSourceReferencePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + managementServerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/managementServers/{managementserver}' + ), + projectPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}' + ), + resourceBackupConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}' + ), + }; + + // 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 = { + listManagementServers: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'managementServers'), + listBackupVaults: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupVaults'), + fetchUsableBackupVaults: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupVaults'), + listDataSources: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataSources'), + listBackups: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), + fetchBackupsForResourceType: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), + listBackupPlans: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlans'), + listBackupPlanRevisions: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlanRevisions'), + listBackupPlanAssociations: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlanAssociations'), + fetchBackupPlanAssociationsForResourceType: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlanAssociations'), + listDataSourceReferences: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataSourceReferences'), + fetchDataSourceReferencesForResourceType: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataSourceReferences') + }; + + 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.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/managementServers/*}:getIamPolicy',},{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/managementServers/*}:setIamPolicy',body: '*',},{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/managementServers/*}:testIamPermissions',body: '*',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; + } + this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); + const createManagementServerResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.ManagementServer') as gax.protobuf.Type; + const createManagementServerMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const deleteManagementServerResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteManagementServerMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const createBackupVaultResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupVault') as gax.protobuf.Type; + const createBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const updateBackupVaultResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupVault') as gax.protobuf.Type; + const updateBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const deleteBackupVaultResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackupVaultMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const updateDataSourceResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.DataSource') as gax.protobuf.Type; + const updateDataSourceMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const updateBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.Backup') as gax.protobuf.Type; + const updateBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const deleteBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.Backup') as gax.protobuf.Type; + const deleteBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const restoreBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.RestoreBackupResponse') as gax.protobuf.Type; + const restoreBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const createBackupPlanResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlan') as gax.protobuf.Type; + const createBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const updateBackupPlanResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlan') as gax.protobuf.Type; + const updateBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const deleteBackupPlanResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackupPlanMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const createBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation') as gax.protobuf.Type; + const createBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const updateBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation') as gax.protobuf.Type; + const updateBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const deleteBackupPlanAssociationResponse = protoFilesRoot.lookup( + '.google.protobuf.Empty') as gax.protobuf.Type; + const deleteBackupPlanAssociationMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const triggerBackupResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.BackupPlanAssociation') as gax.protobuf.Type; + const triggerBackupMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + const initializeServiceResponse = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.InitializeServiceResponse') as gax.protobuf.Type; + const initializeServiceMetadata = protoFilesRoot.lookup( + '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; + + this.descriptors.longrunning = { + createManagementServer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createManagementServerResponse.decode.bind(createManagementServerResponse), + createManagementServerMetadata.decode.bind(createManagementServerMetadata)), + deleteManagementServer: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteManagementServerResponse.decode.bind(deleteManagementServerResponse), + deleteManagementServerMetadata.decode.bind(deleteManagementServerMetadata)), + createBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupVaultResponse.decode.bind(createBackupVaultResponse), + createBackupVaultMetadata.decode.bind(createBackupVaultMetadata)), + updateBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupVaultResponse.decode.bind(updateBackupVaultResponse), + updateBackupVaultMetadata.decode.bind(updateBackupVaultMetadata)), + deleteBackupVault: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupVaultResponse.decode.bind(deleteBackupVaultResponse), + deleteBackupVaultMetadata.decode.bind(deleteBackupVaultMetadata)), + updateDataSource: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateDataSourceResponse.decode.bind(updateDataSourceResponse), + updateDataSourceMetadata.decode.bind(updateDataSourceMetadata)), + updateBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupResponse.decode.bind(updateBackupResponse), + updateBackupMetadata.decode.bind(updateBackupMetadata)), + deleteBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupResponse.decode.bind(deleteBackupResponse), + deleteBackupMetadata.decode.bind(deleteBackupMetadata)), + restoreBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + restoreBackupResponse.decode.bind(restoreBackupResponse), + restoreBackupMetadata.decode.bind(restoreBackupMetadata)), + createBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupPlanResponse.decode.bind(createBackupPlanResponse), + createBackupPlanMetadata.decode.bind(createBackupPlanMetadata)), + updateBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupPlanResponse.decode.bind(updateBackupPlanResponse), + updateBackupPlanMetadata.decode.bind(updateBackupPlanMetadata)), + deleteBackupPlan: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupPlanResponse.decode.bind(deleteBackupPlanResponse), + deleteBackupPlanMetadata.decode.bind(deleteBackupPlanMetadata)), + createBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + createBackupPlanAssociationResponse.decode.bind(createBackupPlanAssociationResponse), + createBackupPlanAssociationMetadata.decode.bind(createBackupPlanAssociationMetadata)), + updateBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + updateBackupPlanAssociationResponse.decode.bind(updateBackupPlanAssociationResponse), + updateBackupPlanAssociationMetadata.decode.bind(updateBackupPlanAssociationMetadata)), + deleteBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + deleteBackupPlanAssociationResponse.decode.bind(deleteBackupPlanAssociationResponse), + deleteBackupPlanAssociationMetadata.decode.bind(deleteBackupPlanAssociationMetadata)), + triggerBackup: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + triggerBackupResponse.decode.bind(triggerBackupResponse), + triggerBackupMetadata.decode.bind(triggerBackupMetadata)), + initializeService: new this._gaxModule.LongrunningDescriptor( + this.operationsClient, + initializeServiceResponse.decode.bind(initializeServiceResponse), + initializeServiceMetadata.decode.bind(initializeServiceMetadata)) + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.backupdr.v1.BackupDR', 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.backupDRStub) { + return this.backupDRStub; + } + + // Put together the "service stub" for + // google.cloud.backupdr.v1.BackupDR. + this.backupDRStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.backupdr.v1.BackupDR') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.backupdr.v1.BackupDR, + 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 backupDRStubMethods = + ['listManagementServers', 'getManagementServer', 'createManagementServer', 'deleteManagementServer', 'createBackupVault', 'listBackupVaults', 'fetchUsableBackupVaults', 'getBackupVault', 'updateBackupVault', 'deleteBackupVault', 'listDataSources', 'getDataSource', 'updateDataSource', 'listBackups', 'fetchBackupsForResourceType', 'getBackup', 'updateBackup', 'deleteBackup', 'restoreBackup', 'createBackupPlan', 'updateBackupPlan', 'getBackupPlan', 'listBackupPlans', 'deleteBackupPlan', 'getBackupPlanRevision', 'listBackupPlanRevisions', 'createBackupPlanAssociation', 'updateBackupPlanAssociation', 'getBackupPlanAssociation', 'listBackupPlanAssociations', 'fetchBackupPlanAssociationsForResourceType', 'deleteBackupPlanAssociation', 'triggerBackup', 'getDataSourceReference', 'listDataSourceReferences', 'fetchDataSourceReferencesForResourceType', 'initializeService']; + for (const methodName of backupDRStubMethods) { + const callPromise = this.backupDRStub.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.backupDRStub; + } + + /** + * 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 'backupdr.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 'backupdr.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 details of a single ManagementServer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the management server resource name, in the format + * 'projects/{project_id}/locations/{location}/managementServers/{resource_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.backupdr.v1.ManagementServer|ManagementServer}. + * 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/backup_d_r.get_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_GetManagementServer_async + */ + getManagementServer( + request?: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|undefined, {}|undefined + ]>; + getManagementServer( + request: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, + {}|null|undefined>): void; + getManagementServer( + request: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, + {}|null|undefined>): void; + getManagementServer( + request?: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|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('getManagementServer request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getManagementServer response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getManagementServer(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IManagementServer, + protos.google.cloud.backupdr.v1.IGetManagementServerRequest|undefined, + {}|undefined + ]) => { + this._log.info('getManagementServer 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 details of a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backupvault store resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupVault|BackupVault}. + * 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/backup_d_r.get_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupVault_async + */ + getBackupVault( + request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|undefined, {}|undefined + ]>; + getBackupVault( + request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, + {}|null|undefined>): void; + getBackupVault( + request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, + {}|null|undefined>): void; + getBackupVault( + request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|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('getBackupVault request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupVault response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackupVault(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupVault, + protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackupVault 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 details of a DataSource. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_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.backupdr.v1.DataSource|DataSource}. + * 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/backup_d_r.get_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_GetDataSource_async + */ + getDataSource( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|undefined, {}|undefined + ]>; + getDataSource( + request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, + {}|null|undefined>): void; + getDataSource( + request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, + {}|null|undefined>): void; + getDataSource( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|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('getDataSource request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSource response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDataSource(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IDataSource, + protos.google.cloud.backupdr.v1.IGetDataSourceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDataSource 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 details of a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the data source resource name, in the format + * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.Backup|Backup}. + * 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/backup_d_r.get_backup.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackup_async + */ + getBackup( + request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|undefined, {}|undefined + ]>; + getBackup( + request: protos.google.cloud.backupdr.v1.IGetBackupRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request: protos.google.cloud.backupdr.v1.IGetBackupRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): void; + getBackup( + request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|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('getBackup request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackup response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackup(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackup, + protos.google.cloud.backupdr.v1.IGetBackupRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackup 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 details of a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlan` to retrieve. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupPlan|BackupPlan}. + * 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/backup_d_r.get_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlan_async + */ + getBackupPlan( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|undefined, {}|undefined + ]>; + getBackupPlan( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, + {}|null|undefined>): void; + getBackupPlan( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, + {}|null|undefined>): void; + getBackupPlan( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|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('getBackupPlan request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupPlan response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackupPlan(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupPlan, + protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackupPlan 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 details of a single BackupPlanRevision. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlanRevision` to retrieve. + * + * Format: + * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.BackupPlanRevision|BackupPlanRevision}. + * 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/backup_d_r.get_backup_plan_revision.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async + */ + getBackupPlanRevision( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|undefined, {}|undefined + ]>; + getBackupPlanRevision( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, + {}|null|undefined>): void; + getBackupPlanRevision( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, + {}|null|undefined>): void; + getBackupPlanRevision( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|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('getBackupPlanRevision request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupPlanRevision response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackupPlanRevision(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupPlanRevision, + protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackupPlanRevision 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 details of a single BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. + * 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/backup_d_r.get_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async + */ + getBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|undefined, {}|undefined + ]>; + getBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, + {}|null|undefined>): void; + getBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, + {}|null|undefined>): void; + getBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|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('getBackupPlanAssociation request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getBackupPlanAssociation response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getBackupPlanAssociation(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation, + protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|undefined, + {}|undefined + ]) => { + this._log.info('getBackupPlanAssociation 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 details of a single DataSourceReference. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The name of the DataSourceReference to retrieve. + * Format: + * projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.DataSourceReference|DataSourceReference}. + * 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/backup_d_r.get_data_source_reference.js + * region_tag:backupdr_v1_generated_BackupDR_GetDataSourceReference_async + */ + getDataSourceReference( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|undefined, {}|undefined + ]>; + getDataSourceReference( + request: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, + options: CallOptions, + callback: Callback< + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, + {}|null|undefined>): void; + getDataSourceReference( + request: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, + callback: Callback< + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, + {}|null|undefined>): void; + getDataSourceReference( + request?: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, + optionsOrCallback?: CallOptions|Callback< + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, + {}|null|undefined>, + callback?: Callback< + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, + {}|null|undefined>): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|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('getDataSourceReference request %j', request); + const wrappedCallback: Callback< + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, + {}|null|undefined>|undefined = callback + ? (error, response, options, rawResponse) => { + this._log.info('getDataSourceReference response %j', response); + callback!(error, response, options, rawResponse); // We verified callback above. + } + : undefined; + return this.innerApiCalls.getDataSourceReference(request, options, wrappedCallback) + ?.then(([response, options, rawResponse]: [ + protos.google.cloud.backupdr.v1.IDataSourceReference, + protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|undefined, + {}|undefined + ]) => { + this._log.info('getDataSourceReference response %j', response); + return [response, options, rawResponse]; + }).catch((error: any) => { + if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { + const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; + error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); + } + throw error; + }); + } + +/** + * Creates a new ManagementServer in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The management server project and location in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR + * locations map to Google Cloud regions, for example **us-central1**. + * @param {string} request.managementServerId + * Required. The name of the management server to create. The name must be + * unique for the specified project and location. + * @param {google.cloud.backupdr.v1.ManagementServer} request.managementServer + * Required. A [management server + * resource][google.cloud.backupdr.v1.ManagementServer] + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/backup_d_r.create_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + */ + createManagementServer( + request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createManagementServer( + request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createManagementServer( + request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createManagementServer( + request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, + 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('createManagementServer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createManagementServer request %j', request); + return this.innerApiCalls.createManagementServer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createManagementServer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createManagementServer()`. + * @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/backup_d_r.create_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async + */ + async checkCreateManagementServerProgress(name: string): Promise>{ + this._log.info('createManagementServer 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.createManagementServer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single ManagementServer. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + */ + deleteManagementServer( + request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteManagementServer( + request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteManagementServer( + request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteManagementServer( + request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, + 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('deleteManagementServer response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteManagementServer request %j', request); + return this.innerApiCalls.deleteManagementServer(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteManagementServer response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteManagementServer()`. + * @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/backup_d_r.delete_management_server.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async + */ + async checkDeleteManagementServerProgress(name: string): Promise>{ + this._log.info('deleteManagementServer 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.deleteManagementServer, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Creates a new BackupVault in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Value for parent. + * @param {string} request.backupVaultId + * Required. ID of the requesting object + * If auto-generating ID server-side, remove this field and + * backup_vault_id from the method_signature of Create RPC + * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.create_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async + */ + createBackupVault( + request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackupVault( + request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackupVault( + request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackupVault( + request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, + 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('createBackupVault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackupVault request %j', request); + return this.innerApiCalls.createBackupVault(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackupVault response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackupVault()`. + * @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/backup_d_r.create_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async + */ + async checkCreateBackupVaultProgress(name: string): Promise>{ + this._log.info('createBackupVault 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.createBackupVault, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the settings of a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * BackupVault resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {boolean} [request.force] + * Optional. If set to true, will not check plan duration against backup vault + * enforcement duration. + * @param {boolean} [request.forceUpdateAccessRestriction] + * Optional. If set to true, we will force update access restriction even if + * some non compliant data sources are present. The default is 'false'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.update_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async + */ + updateBackupVault( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackupVault( + request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackupVault( + request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackupVault( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, + 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({ + 'backup_vault.name': request.backupVault!.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('updateBackupVault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackupVault request %j', request); + return this.innerApiCalls.updateBackupVault(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackupVault response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackupVault()`. + * @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/backup_d_r.update_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async + */ + async checkUpdateBackupVaultProgress(name: string): Promise>{ + this._log.info('updateBackupVault 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.updateBackupVault, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a BackupVault. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.force] + * Optional. If set to true, any data source from this backup vault will also + * be deleted. + * @param {string} request.etag + * The current etag of the backup vault. + * If an etag is provided and does not match the current etag of the + * connection, deletion will be blocked. + * @param {boolean} [request.validateOnly] + * Optional. Only validate the request, but do not perform mutations. + * The default is 'false'. + * @param {boolean} [request.allowMissing] + * Optional. If true and the BackupVault is not found, the request will + * succeed but no action will be taken. + * @param {boolean} [request.ignoreBackupPlanReferences] + * Optional. If set to true, backupvault deletion will proceed even if there + * are backup plans referencing the backupvault. The default is 'false'. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.delete_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async + */ + deleteBackupVault( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackupVault( + request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackupVault( + request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackupVault( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, + 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('deleteBackupVault response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackupVault request %j', request); + return this.innerApiCalls.deleteBackupVault(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackupVault response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackupVault()`. + * @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/backup_d_r.delete_backup_vault.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async + */ + async checkDeleteBackupVaultProgress(name: string): Promise>{ + this._log.info('deleteBackupVault 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.deleteBackupVault, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the settings of a DataSource. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * DataSource resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.DataSource} request.dataSource + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {boolean} [request.allowMissing] + * Optional. Enable upsert. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.update_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async + */ + updateDataSource( + request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateDataSource( + request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDataSource( + request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateDataSource( + request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, + 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({ + 'data_source.name': request.dataSource!.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('updateDataSource response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateDataSource request %j', request); + return this.innerApiCalls.updateDataSource(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateDataSource response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateDataSource()`. + * @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/backup_d_r.update_data_source.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async + */ + async checkUpdateDataSourceProgress(name: string): Promise>{ + this._log.info('updateDataSource 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.updateDataSource, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Updates the settings of a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.protobuf.FieldMask} request.updateMask + * Required. Field mask is used to specify the fields to be overwritten in the + * Backup resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * @param {google.cloud.backupdr.v1.Backup} request.backup + * Required. The resource being updated + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * 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/backup_d_r.update_backup.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async + */ + updateBackup( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackup( + request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackup( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, + 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({ + 'backup.name': request.backup!.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('updateBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackup request %j', request); + return this.innerApiCalls.updateBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackup()`. + * @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/backup_d_r.update_backup.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async + */ + async checkUpdateBackupProgress(name: string): Promise>{ + this._log.info('updateBackup 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.updateBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the resource. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async + */ + deleteBackup( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackup( + request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackup( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, + 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('deleteBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackup request %j', request); + return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackup()`. + * @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/backup_d_r.delete_backup.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async + */ + async checkDeleteBackupProgress(name: string): Promise>{ + this._log.info('deleteBackup 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.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Restore from a Backup + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the Backup instance, in the format + * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} request.computeInstanceTargetEnvironment + * Compute Engine target environment to be used during restore. + * @param {google.cloud.backupdr.v1.DiskTargetEnvironment} request.diskTargetEnvironment + * Disk target environment to be used during restore. + * @param {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} request.regionDiskTargetEnvironment + * Region disk target environment to be used during restore. + * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} request.computeInstanceRestoreProperties + * Compute Engine instance properties to be overridden during restore. + * @param {google.cloud.backupdr.v1.DiskRestoreProperties} request.diskRestoreProperties + * Disk properties to be overridden during restore. + * @param {google.protobuf.FieldMask} [request.clearOverridesFieldMask] + * Optional. A field mask used to clear server-side default values + * for fields within the `instance_properties` oneof. + * + * When a field in this mask is cleared, the server will not apply its + * default logic (like inheriting a value from the source) for that field. + * + * The most common current use case is clearing default encryption keys. + * + * Examples of field mask paths: + * - Compute Instance Disks: + * `compute_instance_restore_properties.disks.*.disk_encryption_key` + * - Single Disk: `disk_restore_properties.disk_encryption_key` + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.restore_backup.js + * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async + */ + restoreBackup( + request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + restoreBackup( + request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreBackup( + request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + restoreBackup( + request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, + 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('restoreBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('restoreBackup request %j', request); + return this.innerApiCalls.restoreBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('restoreBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `restoreBackup()`. + * @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/backup_d_r.restore_backup.js + * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async + */ + async checkRestoreBackupProgress(name: string): Promise>{ + this._log.info('restoreBackup 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.restoreBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Create a BackupPlan + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The `BackupPlan` project and location in the format + * `projects/{project}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @param {string} request.backupPlanId + * Required. The name of the `BackupPlan` to create. The name must be unique + * for the specified project and location.The name must start with a lowercase + * letter followed by up to 62 lowercase letters, numbers, or hyphens. + * Pattern, /{@link protos.a-z0-9-|a-z}{,62}/. + * @param {google.cloud.backupdr.v1.BackupPlan} request.backupPlan + * Required. The `BackupPlan` resource object to create. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async + */ + createBackupPlan( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackupPlan( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackupPlan( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackupPlan( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, + 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('createBackupPlan response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackupPlan request %j', request); + return this.innerApiCalls.createBackupPlan(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackupPlan response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackupPlan()`. + * @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/backup_d_r.create_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async + */ + async checkCreateBackupPlanProgress(name: string): Promise>{ + this._log.info('createBackupPlan 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.createBackupPlan, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update a BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.backupdr.v1.BackupPlan} request.backupPlan + * Required. The resource being updated + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * Field mask is used to specify the fields to be overwritten in the + * BackupPlan resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * Currently, these fields are supported in update: description, schedules, + * retention period, adding and removing Backup Rules. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlan_async + */ + updateBackupPlan( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackupPlan( + request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackupPlan( + request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackupPlan( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, + 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({ + 'backup_plan.name': request.backupPlan!.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('updateBackupPlan response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackupPlan request %j', request); + return this.innerApiCalls.updateBackupPlan(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackupPlan response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackupPlan()`. + * @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/backup_d_r.update_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlan_async + */ + async checkUpdateBackupPlanProgress(name: string): Promise>{ + this._log.info('updateBackupPlan 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.updateBackupPlan, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single BackupPlan. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the `BackupPlan` to delete. + * + * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async + */ + deleteBackupPlan( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackupPlan( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackupPlan( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackupPlan( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, + 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('deleteBackupPlan response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackupPlan request %j', request); + return this.innerApiCalls.deleteBackupPlan(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackupPlan response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackupPlan()`. + * @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/backup_d_r.delete_backup_plan.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async + */ + async checkDeleteBackupPlanProgress(name: string): Promise>{ + this._log.info('deleteBackupPlan 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.deleteBackupPlan, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Create a BackupPlanAssociation + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The backup plan association project and location in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations + * map to GCP regions, for example **us-central1**. + * @param {string} request.backupPlanAssociationId + * Required. The name of the backup plan association to create. The name must + * be unique for the specified project and location. + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} request.backupPlanAssociation + * Required. The resource being created + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.create_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async + */ + createBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + createBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + createBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, + 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('createBackupPlanAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('createBackupPlanAssociation request %j', request); + return this.innerApiCalls.createBackupPlanAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('createBackupPlanAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `createBackupPlanAssociation()`. + * @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/backup_d_r.create_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async + */ + async checkCreateBackupPlanAssociationProgress(name: string): Promise>{ + this._log.info('createBackupPlanAssociation 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.createBackupPlanAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Update a BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {google.cloud.backupdr.v1.BackupPlanAssociation} request.backupPlanAssociation + * Required. The resource being updated + * @param {google.protobuf.FieldMask} request.updateMask + * Required. The list of fields to update. + * Field mask is used to specify the fields to be overwritten in the + * BackupPlanAssociation resource by the update. + * The fields specified in the update_mask are relative to the resource, not + * the full request. A field will be overwritten if it is in the mask. If the + * user does not provide a mask then the request will fail. + * Currently backup_plan_association.backup_plan is the only supported field. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.update_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async + */ + updateBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + updateBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + updateBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, + 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({ + 'backup_plan_association.name': request.backupPlanAssociation!.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('updateBackupPlanAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('updateBackupPlanAssociation request %j', request); + return this.innerApiCalls.updateBackupPlanAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('updateBackupPlanAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `updateBackupPlanAssociation()`. + * @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/backup_d_r.update_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async + */ + async checkUpdateBackupPlanAssociationProgress(name: string): Promise>{ + this._log.info('updateBackupPlanAssociation 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.updateBackupPlanAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Deletes a single BackupPlanAssociation. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.delete_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async + */ + deleteBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + deleteBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackupPlanAssociation( + request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + deleteBackupPlanAssociation( + request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, + 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('deleteBackupPlanAssociation response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('deleteBackupPlanAssociation request %j', request); + return this.innerApiCalls.deleteBackupPlanAssociation(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('deleteBackupPlanAssociation response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `deleteBackupPlanAssociation()`. + * @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/backup_d_r.delete_backup_plan_association.js + * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async + */ + async checkDeleteBackupPlanAssociationProgress(name: string): Promise>{ + this._log.info('deleteBackupPlanAssociation 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.deleteBackupPlanAssociation, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Triggers a new Backup. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. Name of the backup plan association resource, in the format + * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` + * @param {string} request.ruleId + * Required. backup rule_id for which a backup needs to be triggered. + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes after the first request. + * + * For example, consider a situation where you make an initial request and + * the request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * a long running operation. Its `promise()` method returns a promise + * you can `await` for. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } + * for more details and examples. + * @example include:samples/generated/v1/backup_d_r.trigger_backup.js + * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async + */ + triggerBackup( + request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + triggerBackup( + request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + triggerBackup( + request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + triggerBackup( + request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, + 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('triggerBackup response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('triggerBackup request %j', request); + return this.innerApiCalls.triggerBackup(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('triggerBackup response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `triggerBackup()`. + * @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/backup_d_r.trigger_backup.js + * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async + */ + async checkTriggerBackupProgress(name: string): Promise>{ + this._log.info('triggerBackup 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.triggerBackup, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } +/** + * Initializes the service related config for a project. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Required. The resource name of the serviceConfig used to initialize the + * service. Format: + * `projects/{project_id}/locations/{location}/serviceConfig`. + * @param {string} request.resourceType + * Required. The resource type to which the default service config will be + * applied. Examples include, "compute.googleapis.com/Instance" and + * "storage.googleapis.com/Bucket". + * @param {string} [request.requestId] + * Optional. An optional request ID to identify requests. Specify a unique + * request ID so that if you must retry your request, the server will know to + * ignore the request if it has already been completed. The server will + * guarantee that for at least 60 minutes since the first request. + * + * For example, consider a situation where you make an initial request and t + * he request times out. If you make the request again with the same request + * ID, the server can check if original operation with the same request ID + * was received, and if so, will ignore the second request. This prevents + * clients from accidentally creating duplicate commitments. + * + * The request ID must be a valid UUID with the exception that zero UUID is + * not supported (00000000-0000-0000-0000-000000000000). + * @param {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} [request.cloudSqlInstanceInitializationConfig] + * Optional. The configuration for initializing a Cloud SQL instance. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.initialize_service.js + * region_tag:backupdr_v1_generated_BackupDR_InitializeService_async + */ + initializeService( + request?: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + options?: CallOptions): + Promise<[ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]>; + initializeService( + request: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + options: CallOptions, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + initializeService( + request: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + callback: Callback< + LROperation, + protos.google.longrunning.IOperation|null|undefined, + {}|null|undefined>): void; + initializeService( + request?: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, + 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('initializeService response %j', rawResponse); + callback!(error, response, rawResponse, _); // We verified callback above. + } + : undefined; + this._log.info('initializeService request %j', request); + return this.innerApiCalls.initializeService(request, options, wrappedCallback) + ?.then(([response, rawResponse, _]: [ + LROperation, + protos.google.longrunning.IOperation|undefined, {}|undefined + ]) => { + this._log.info('initializeService response %j', rawResponse); + return [response, rawResponse, _]; + }); + } +/** + * Check the status of the long running operation returned by `initializeService()`. + * @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/backup_d_r.initialize_service.js + * region_tag:backupdr_v1_generated_BackupDR_InitializeService_async + */ + async checkInitializeServiceProgress(name: string): Promise>{ + this._log.info('initializeService 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.initializeService, this._gaxModule.createDefaultBackoffSettings()); + return decodeOperation as LROperation; + } + /** + * Lists ManagementServers in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.ManagementServer|ManagementServer}. + * 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 `listManagementServersAsync()` + * 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. + */ + listManagementServers( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest|null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse + ]>; + listManagementServers( + request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, + protos.google.cloud.backupdr.v1.IManagementServer>): void; + listManagementServers( + request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, + protos.google.cloud.backupdr.v1.IManagementServer>): void; + listManagementServers( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, + protos.google.cloud.backupdr.v1.IManagementServer>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListManagementServersRequest, + protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, + protos.google.cloud.backupdr.v1.IManagementServer>): + Promise<[ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest|null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListManagementServersRequest, + protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, + protos.google.cloud.backupdr.v1.IManagementServer>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listManagementServers values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listManagementServers request %j', request); + return this.innerApiCalls + .listManagementServers(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IManagementServer[], + protos.google.cloud.backupdr.v1.IListManagementServersRequest|null, + protos.google.cloud.backupdr.v1.IListManagementServersResponse + ]) => { + this._log.info('listManagementServers values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listManagementServers`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.ManagementServer|ManagementServer} 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 `listManagementServersAsync()` + * 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. + */ + listManagementServersStream( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + 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['listManagementServers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listManagementServers stream %j', request); + return this.descriptors.page.listManagementServers.createStream( + this.innerApiCalls.listManagementServers as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listManagementServers`, 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 project and location for which to retrieve management servers + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud BackupDR, locations map to Google Cloud regions, for example + * **us-central1**. To retrieve management servers for all locations, use "-" + * for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.ManagementServer|ManagementServer}. 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/backup_d_r.list_management_servers.js + * region_tag:backupdr_v1_generated_BackupDR_ListManagementServers_async + */ + listManagementServersAsync( + request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, + 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['listManagementServers']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listManagementServers iterate %j', request); + return this.descriptors.page.listManagementServers.asyncIterate( + this.innerApiCalls['listManagementServers'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupVaults in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.BackupVault|BackupVault}. + * 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 `listBackupVaultsAsync()` + * 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. + */ + listBackupVaults( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + ]>; + listBackupVaults( + request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>): void; + listBackupVaults( + request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>): void; + listBackupVaults( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupVaults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupVaults request %j', request); + return this.innerApiCalls + .listBackupVaults(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IListBackupVaultsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupVaultsResponse + ]) => { + this._log.info('listBackupVaults values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackupVaults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @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.backupdr.v1.BackupVault|BackupVault} 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 `listBackupVaultsAsync()` + * 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. + */ + listBackupVaultsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + 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['listBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupVaults stream %j', request); + return this.descriptors.page.listBackupVaults.createStream( + this.innerApiCalls.listBackupVaults as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackupVaults`, 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 project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * Vault. + * @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.backupdr.v1.BackupVault|BackupVault}. 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/backup_d_r.list_backup_vaults.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupVaults_async + */ + listBackupVaultsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, + 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['listBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupVaults iterate %j', request); + return this.descriptors.page.listBackupVaults.asyncIterate( + this.innerApiCalls['listBackupVaults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * FetchUsableBackupVaults lists usable BackupVaults in a given project and + * location. Usable BackupVault are the ones that user has + * backupdr.backupVaults.get permission. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.BackupVault|BackupVault}. + * 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 `fetchUsableBackupVaultsAsync()` + * 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. + */ + fetchUsableBackupVaults( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest|null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + ]>; + fetchUsableBackupVaults( + request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>): void; + fetchUsableBackupVaults( + request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>): void; + fetchUsableBackupVaults( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest|null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IFetchUsableBackupVaultsRequest, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupVault>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchUsableBackupVaults values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchUsableBackupVaults request %j', request); + return this.innerApiCalls + .fetchUsableBackupVaults(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupVault[], + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest|null, + protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse + ]) => { + this._log.info('fetchUsableBackupVaults values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `fetchUsableBackupVaults`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.BackupVault|BackupVault} 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 `fetchUsableBackupVaultsAsync()` + * 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. + */ + fetchUsableBackupVaultsStream( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + 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['fetchUsableBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchUsableBackupVaults stream %j', request); + return this.descriptors.page.fetchUsableBackupVaults.createStream( + this.innerApiCalls.fetchUsableBackupVaults as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `fetchUsableBackupVaults`, 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 project and location for which to retrieve backupvault stores + * information, in the format 'projects/{project_id}/locations/{location}'. In + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * To retrieve backupvault stores for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.BackupVault|BackupVault}. 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/backup_d_r.fetch_usable_backup_vaults.js + * region_tag:backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async + */ + fetchUsableBackupVaultsAsync( + request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, + 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['fetchUsableBackupVaults']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchUsableBackupVaults iterate %j', request); + return this.descriptors.page.fetchUsableBackupVaults.asyncIterate( + this.innerApiCalls['fetchUsableBackupVaults'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataSources in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.DataSource|DataSource}. + * 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 `listDataSourcesAsync()` + * 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. + */ + listDataSources( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest|null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse + ]>; + listDataSources( + request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSource>): void; + listDataSources( + request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSource>): void; + listDataSources( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSource>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSource>): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest|null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListDataSourcesRequest, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSource>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataSources values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataSources request %j', request); + return this.innerApiCalls + .listDataSources(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IDataSource[], + protos.google.cloud.backupdr.v1.IListDataSourcesRequest|null, + protos.google.cloud.backupdr.v1.IListDataSourcesResponse + ]) => { + this._log.info('listDataSources values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDataSources`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.DataSource|DataSource} 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 `listDataSourcesAsync()` + * 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. + */ + listDataSourcesStream( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + 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['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDataSources stream %j', request); + return this.descriptors.page.listDataSources.createStream( + this.innerApiCalls.listDataSources as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataSources`, 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 project and location for which to retrieve data + * sources information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.DataSource|DataSource}. 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/backup_d_r.list_data_sources.js + * region_tag:backupdr_v1_generated_BackupDR_ListDataSources_async + */ + listDataSourcesAsync( + request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, + 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['listDataSources']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDataSources iterate %j', request); + return this.descriptors.page.listDataSources.asyncIterate( + this.innerApiCalls['listDataSources'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists Backups in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.Backup|Backup}. + * 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 `listBackupsAsync()` + * 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. + */ + listBackups( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupsResponse + ]>; + listBackups( + request: protos.google.cloud.backupdr.v1.IListBackupsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>): void; + listBackups( + request: protos.google.cloud.backupdr.v1.IListBackupsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>): void; + listBackups( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListBackupsRequest, + protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackups values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackups request %j', request); + return this.innerApiCalls + .listBackups(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IListBackupsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupsResponse + ]) => { + this._log.info('listBackups values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackups`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @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.backupdr.v1.Backup|Backup} 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 `listBackupsAsync()` + * 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. + */ + listBackupsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + 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['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups stream %j', request); + return this.descriptors.page.listBackups.createStream( + this.innerApiCalls.listBackups as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackups`, 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 project and location for which to retrieve backup + * information, in the format + * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, + * locations map to Google Cloud regions, for example **us-central1**. + * To retrieve data sources for all locations, use "-" for the + * '{location}' value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the results. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. Reserved for future use to provide a BASIC & FULL view of Backup + * resource. + * @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.backupdr.v1.Backup|Backup}. 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/backup_d_r.list_backups.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackups_async + */ + listBackupsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, + 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['listBackups']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackups iterate %j', request); + return this.descriptors.page.listBackups.asyncIterate( + this.innerApiCalls['listBackups'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Fetch Backups for a given resource type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Datasources are the parent resource for the backups. + * Format: + * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sqladmin.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of Backups to return. The service may + * return fewer than this value. If unspecified, at most 50 + * Backups will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchBackupsForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchBackupsForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. This parameter is used to specify the view of the backup. + * If not specified, the default view is BASIC. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.Backup|Backup}. + * 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 `fetchBackupsForResourceTypeAsync()` + * 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. + */ + fetchBackupsForResourceType( + request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse + ]>; + fetchBackupsForResourceType( + request: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>): void; + fetchBackupsForResourceType( + request: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>): void; + fetchBackupsForResourceType( + request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IFetchBackupsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackup>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchBackupsForResourceType values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchBackupsForResourceType request %j', request); + return this.innerApiCalls + .fetchBackupsForResourceType(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackup[], + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse + ]) => { + this._log.info('fetchBackupsForResourceType values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `fetchBackupsForResourceType`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. Datasources are the parent resource for the backups. + * Format: + * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sqladmin.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of Backups to return. The service may + * return fewer than this value. If unspecified, at most 50 + * Backups will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchBackupsForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchBackupsForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. This parameter is used to specify the view of the backup. + * If not specified, the default view is BASIC. + * @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.backupdr.v1.Backup|Backup} 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 `fetchBackupsForResourceTypeAsync()` + * 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. + */ + fetchBackupsForResourceTypeStream( + request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + 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['fetchBackupsForResourceType']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchBackupsForResourceType stream %j', request); + return this.descriptors.page.fetchBackupsForResourceType.createStream( + this.innerApiCalls.fetchBackupsForResourceType as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `fetchBackupsForResourceType`, 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. Datasources are the parent resource for the backups. + * Format: + * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sqladmin.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of Backups to return. The service may + * return fewer than this value. If unspecified, at most 50 + * Backups will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchBackupsForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchBackupsForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * @param {google.cloud.backupdr.v1.BackupView} [request.view] + * Optional. This parameter is used to specify the view of the backup. + * If not specified, the default view is BASIC. + * @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.backupdr.v1.Backup|Backup}. 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/backup_d_r.fetch_backups_for_resource_type.js + * region_tag:backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async + */ + fetchBackupsForResourceTypeAsync( + request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, + 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['fetchBackupsForResourceType']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchBackupsForResourceType iterate %j', request); + return this.descriptors.page.fetchBackupsForResourceType.asyncIterate( + this.innerApiCalls['fetchBackupsForResourceType'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupPlans in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the 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.backupdr.v1.BackupPlan|BackupPlan}. + * 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 `listBackupPlansAsync()` + * 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. + */ + listBackupPlans( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse + ]>; + listBackupPlans( + request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlan>): void; + listBackupPlans( + request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlan>): void; + listBackupPlans( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlan>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlan>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListBackupPlansRequest, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlan>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupPlans values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupPlans request %j', request); + return this.innerApiCalls + .listBackupPlans(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupPlan[], + protos.google.cloud.backupdr.v1.IListBackupPlansRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlansResponse + ]) => { + this._log.info('listBackupPlans values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackupPlans`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the 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.backupdr.v1.BackupPlan|BackupPlan} 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 `listBackupPlansAsync()` + * 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. + */ + listBackupPlansStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + 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['listBackupPlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupPlans stream %j', request); + return this.descriptors.page.listBackupPlans.createStream( + this.innerApiCalls.listBackupPlans as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackupPlans`, 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 project and location for which to retrieve `BackupPlans` + * information. Format: `projects/{project}/locations/{location}`. In Cloud + * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To + * retrieve backup plans for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the page token. + * @param {string} [request.filter] + * Optional. Field match expression used to filter the results. + * @param {string} [request.orderBy] + * Optional. Field by which to sort the 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.backupdr.v1.BackupPlan|BackupPlan}. 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/backup_d_r.list_backup_plans.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlans_async + */ + listBackupPlansAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, + 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['listBackupPlans']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupPlans iterate %j', request); + return this.descriptors.page.listBackupPlans.asyncIterate( + this.innerApiCalls['listBackupPlans'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupPlanRevisions in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve + * `BackupPlanRevisions` information. Format: + * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the 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.backupdr.v1.BackupPlanRevision|BackupPlanRevision}. + * 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 `listBackupPlanRevisionsAsync()` + * 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. + */ + listBackupPlanRevisions( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanRevision[], + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse + ]>; + listBackupPlanRevisions( + request: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanRevision>): void; + listBackupPlanRevisions( + request: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanRevision>): void; + listBackupPlanRevisions( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanRevision>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanRevision>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanRevision[], + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListBackupPlanRevisionsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanRevision>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupPlanRevisions values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupPlanRevisions request %j', request); + return this.innerApiCalls + .listBackupPlanRevisions(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupPlanRevision[], + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse + ]) => { + this._log.info('listBackupPlanRevisions values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackupPlanRevisions`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve + * `BackupPlanRevisions` information. Format: + * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the 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.backupdr.v1.BackupPlanRevision|BackupPlanRevision} 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 `listBackupPlanRevisionsAsync()` + * 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. + */ + listBackupPlanRevisionsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + 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['listBackupPlanRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupPlanRevisions stream %j', request); + return this.descriptors.page.listBackupPlanRevisions.createStream( + this.innerApiCalls.listBackupPlanRevisions as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackupPlanRevisions`, 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 project and location for which to retrieve + * `BackupPlanRevisions` information. Format: + * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In + * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. + * @param {number} [request.pageSize] + * Optional. The maximum number of `BackupPlans` to return in a single + * response. If not specified, a default value will be chosen by the service. + * Note that the response may include a partial list and a caller should + * only rely on the response's + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * to determine if there are more instances left to be queried. + * @param {string} [request.pageToken] + * Optional. The value of + * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} + * received from a previous `ListBackupPlans` call. + * Provide this to retrieve the subsequent page in a multi-page list of + * results. When paginating, all other parameters provided to + * `ListBackupPlans` must match the call that provided the 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.backupdr.v1.BackupPlanRevision|BackupPlanRevision}. 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/backup_d_r.list_backup_plan_revisions.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async + */ + listBackupPlanRevisionsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, + 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['listBackupPlanRevisions']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupPlanRevisions iterate %j', request); + return this.descriptors.page.listBackupPlanRevisions.asyncIterate( + this.innerApiCalls['listBackupPlanRevisions'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists BackupPlanAssociations in a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering 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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. + * 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 `listBackupPlanAssociationsAsync()` + * 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. + */ + listBackupPlanAssociations( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse + ]>; + listBackupPlanAssociations( + request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; + listBackupPlanAssociations( + request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; + listBackupPlanAssociations( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListBackupPlanAssociationsRequest, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listBackupPlanAssociations values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listBackupPlanAssociations request %j', request); + return this.innerApiCalls + .listBackupPlanAssociations(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest|null, + protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse + ]) => { + this._log.info('listBackupPlanAssociations values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listBackupPlanAssociations`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering 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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation} 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 `listBackupPlanAssociationsAsync()` + * 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. + */ + listBackupPlanAssociationsStream( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + 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['listBackupPlanAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupPlanAssociations stream %j', request); + return this.descriptors.page.listBackupPlanAssociations.createStream( + this.innerApiCalls.listBackupPlanAssociations as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listBackupPlanAssociations`, 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 project and location for which to retrieve backup Plan + * Associations information, in the format + * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations + * map to GCP regions, for example **us-central1**. To retrieve backup plan + * associations for all locations, use "-" for the + * `{location}` value. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will pick an appropriate default. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering 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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. 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/backup_d_r.list_backup_plan_associations.js + * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async + */ + listBackupPlanAssociationsAsync( + request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, + 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['listBackupPlanAssociations']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listBackupPlanAssociations iterate %j', request); + return this.descriptors.page.listBackupPlanAssociations.asyncIterate( + this.innerApiCalls['listBackupPlanAssociations'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * List BackupPlanAssociations for a given resource type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of BackupPlanAssociations to return. The + * service may return fewer than this value. If unspecified, at most 50 + * BackupPlanAssociations will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchBackupPlanAssociationsForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchBackupPlanAssociationsForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * resource + * * backup_plan + * * state + * * data_source + * * cloud_sql_instance_backup_plan_association_properties.instance_create_time + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * * 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 Array of {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. + * 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 `fetchBackupPlanAssociationsForResourceTypeAsync()` + * 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. + */ + fetchBackupPlanAssociationsForResourceType( + request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse + ]>; + fetchBackupPlanAssociationsForResourceType( + request: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; + fetchBackupPlanAssociationsForResourceType( + request: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; + fetchBackupPlanAssociationsForResourceType( + request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): + Promise<[ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IBackupPlanAssociation>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchBackupPlanAssociationsForResourceType values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchBackupPlanAssociationsForResourceType request %j', request); + return this.innerApiCalls + .fetchBackupPlanAssociationsForResourceType(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse + ]) => { + this._log.info('fetchBackupPlanAssociationsForResourceType values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `fetchBackupPlanAssociationsForResourceType`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of BackupPlanAssociations to return. The + * service may return fewer than this value. If unspecified, at most 50 + * BackupPlanAssociations will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchBackupPlanAssociationsForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchBackupPlanAssociationsForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * resource + * * backup_plan + * * state + * * data_source + * * cloud_sql_instance_backup_plan_association_properties.instance_create_time + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * * name + * @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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation} 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 `fetchBackupPlanAssociationsForResourceTypeAsync()` + * 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. + */ + fetchBackupPlanAssociationsForResourceTypeStream( + request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + 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['fetchBackupPlanAssociationsForResourceType']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchBackupPlanAssociationsForResourceType stream %j', request); + return this.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream( + this.innerApiCalls.fetchBackupPlanAssociationsForResourceType as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `fetchBackupPlanAssociationsForResourceType`, 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 resource name. + * Format: projects/{project}/locations/{location} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of BackupPlanAssociations to return. The + * service may return fewer than this value. If unspecified, at most 50 + * BackupPlanAssociations will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchBackupPlanAssociationsForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchBackupPlanAssociationsForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * resource + * * backup_plan + * * state + * * data_source + * * cloud_sql_instance_backup_plan_association_properties.instance_create_time + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * * name + * @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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. 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/backup_d_r.fetch_backup_plan_associations_for_resource_type.js + * region_tag:backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async + */ + fetchBackupPlanAssociationsForResourceTypeAsync( + request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, + 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['fetchBackupPlanAssociationsForResourceType']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchBackupPlanAssociationsForResourceType iterate %j', request); + return this.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate( + this.innerApiCalls['fetchBackupPlanAssociationsForResourceType'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Lists DataSourceReferences for a given project and location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + * @param {number} [request.pageSize] + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDataSourceReferences` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDataSourceReferences` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. + * + * The following field and operator combinations are supported: + * + * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + * * data_source_gcp_resource_info.type with `=`, `!=` + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.DataSourceReference|DataSourceReference}. + * 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 `listDataSourceReferencesAsync()` + * 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. + */ + listDataSourceReferences( + request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSourceReference[], + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest|null, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse + ]>; + listDataSourceReferences( + request: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>): void; + listDataSourceReferences( + request: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>): void; + listDataSourceReferences( + request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSourceReference[], + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest|null, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListDataSourceReferencesRequest, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listDataSourceReferences values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listDataSourceReferences request %j', request); + return this.innerApiCalls + .listDataSourceReferences(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IDataSourceReference[], + protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest|null, + protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse + ]) => { + this._log.info('listDataSourceReferences values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listDataSourceReferences`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + * @param {number} [request.pageSize] + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDataSourceReferences` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDataSourceReferences` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. + * + * The following field and operator combinations are supported: + * + * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + * * data_source_gcp_resource_info.type with `=`, `!=` + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * @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.backupdr.v1.DataSourceReference|DataSourceReference} 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 `listDataSourceReferencesAsync()` + * 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. + */ + listDataSourceReferencesStream( + request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + 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['listDataSourceReferences']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDataSourceReferences stream %j', request); + return this.descriptors.page.listDataSourceReferences.createStream( + this.innerApiCalls.listDataSourceReferences as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listDataSourceReferences`, 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 resource name. + * Format: projects/{project}/locations/{location} + * @param {number} [request.pageSize] + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous `ListDataSourceReferences` + * call. Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `ListDataSourceReferences` must match the call that provided the page + * token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results listed in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. + * + * The following field and operator combinations are supported: + * + * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` + * * data_source_gcp_resource_info.type with `=`, `!=` + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * @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.backupdr.v1.DataSourceReference|DataSourceReference}. 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/backup_d_r.list_data_source_references.js + * region_tag:backupdr_v1_generated_BackupDR_ListDataSourceReferences_async + */ + listDataSourceReferencesAsync( + request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, + 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['listDataSourceReferences']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listDataSourceReferences iterate %j', request); + return this.descriptors.page.listDataSourceReferences.asyncIterate( + this.innerApiCalls['listDataSourceReferences'] as GaxCall, + request as {}, + callSettings + ) as AsyncIterable; + } + /** + * Fetch DataSourceReferences for a given project, location and resource type. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchDataSourceReferencesForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchDataSourceReferencesForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_backup_config_state + * * data_source_backup_count + * * data_source_backup_config_info.last_backup_state + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_gcp_resource_info.type + * * data_source_gcp_resource_info.location + * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * * 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 Array of {@link protos.google.cloud.backupdr.v1.DataSourceReference|DataSourceReference}. + * 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 `fetchDataSourceReferencesForResourceTypeAsync()` + * 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. + */ + fetchDataSourceReferencesForResourceType( + request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSourceReference[], + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse + ]>; + fetchDataSourceReferencesForResourceType( + request: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>): void; + fetchDataSourceReferencesForResourceType( + request: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>): void; + fetchDataSourceReferencesForResourceType( + request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>): + Promise<[ + protos.google.cloud.backupdr.v1.IDataSourceReference[], + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, + protos.google.cloud.backupdr.v1.IDataSourceReference>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('fetchDataSourceReferencesForResourceType values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('fetchDataSourceReferencesForResourceType request %j', request); + return this.innerApiCalls + .fetchDataSourceReferencesForResourceType(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IDataSourceReference[], + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest|null, + protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse + ]) => { + this._log.info('fetchDataSourceReferencesForResourceType values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `fetchDataSourceReferencesForResourceType`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The parent resource name. + * Format: projects/{project}/locations/{location} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchDataSourceReferencesForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchDataSourceReferencesForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_backup_config_state + * * data_source_backup_count + * * data_source_backup_config_info.last_backup_state + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_gcp_resource_info.type + * * data_source_gcp_resource_info.location + * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * * name + * @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.backupdr.v1.DataSourceReference|DataSourceReference} 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 `fetchDataSourceReferencesForResourceTypeAsync()` + * 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. + */ + fetchDataSourceReferencesForResourceTypeStream( + request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + 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['fetchDataSourceReferencesForResourceType']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchDataSourceReferencesForResourceType stream %j', request); + return this.descriptors.page.fetchDataSourceReferencesForResourceType.createStream( + this.innerApiCalls.fetchDataSourceReferencesForResourceType as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `fetchDataSourceReferencesForResourceType`, 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 resource name. + * Format: projects/{project}/locations/{location} + * @param {string} request.resourceType + * Required. The type of the GCP resource. + * Ex: sql.googleapis.com/Instance + * @param {number} [request.pageSize] + * Optional. The maximum number of DataSourceReferences to return. The service + * may return fewer than this value. If unspecified, at most 50 + * DataSourceReferences will be returned. The maximum value is 100; values + * above 100 will be coerced to 100. + * @param {string} [request.pageToken] + * Optional. A page token, received from a previous call of + * `FetchDataSourceReferencesForResourceType`. + * Provide this to retrieve the subsequent page. + * + * When paginating, all other parameters provided to + * `FetchDataSourceReferencesForResourceType` must match + * the call that provided the page token. + * @param {string} [request.filter] + * Optional. A filter expression that filters the results fetched in the + * response. The expression must specify the field name, a comparison + * operator, and the value that you want to use for filtering. Supported + * fields: + * * data_source + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_backup_config_state + * * data_source_backup_count + * * data_source_backup_config_info.last_backup_state + * * data_source_gcp_resource_info.gcp_resourcename + * * data_source_gcp_resource_info.type + * * data_source_gcp_resource_info.location + * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time + * @param {string} [request.orderBy] + * Optional. A comma-separated list of fields to order by, sorted in ascending + * order. Use "desc" after a field name for descending. + * + * Supported fields: + * * name + * @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.backupdr.v1.DataSourceReference|DataSourceReference}. 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/backup_d_r.fetch_data_source_references_for_resource_type.js + * region_tag:backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async + */ + fetchDataSourceReferencesForResourceTypeAsync( + request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, + 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['fetchDataSourceReferencesForResourceType']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('fetchDataSourceReferencesForResourceType iterate %j', request); + return this.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate( + this.innerApiCalls['fetchDataSourceReferencesForResourceType'] 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 information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + +/** + * Gets the latest state of a long-running operation. Clients can use this + * method to poll the operation result at intervals as recommended by the API + * service. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error, ?Object)=} callback + * The function which will be called with the result of the API call. + * + * The second parameter to the callback is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * @return {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing + * {@link google.longrunning.Operation | google.longrunning.Operation}. + * The promise has a method named "cancel" which cancels the ongoing API call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * const name = ''; + * const [response] = await client.getOperation({name}); + * // doThingsWith(response) + * ``` + */ + getOperation( + request: protos.google.longrunning.GetOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.longrunning.Operation, + protos.google.longrunning.GetOperationRequest, + {} | null | undefined + > + ): Promise<[protos.google.longrunning.Operation]> { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.getOperation(request, options, callback); + } + /** + * Lists operations that match the specified filter in the request. If the + * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. + * + * For-await-of syntax is used with the iterable to recursively get response element on-demand. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation collection. + * @param {string} request.filter - The standard list filter. + * @param {number=} request.pageSize - + * The maximum number of resources contained in the underlying API + * response. If page streaming is performed per-resource, this + * parameter does not affect the return value. If page streaming is + * performed per-page, this determines the maximum number of + * resources in a page. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @returns {Object} + * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * for await (const response of client.listOperationsAsync(request)); + * // doThingsWith(response) + * ``` + */ + listOperationsAsync( + request: protos.google.longrunning.ListOperationsRequest, + options?: gax.CallOptions + ): AsyncIterable { + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.listOperationsAsync(request, options); + } + /** + * Starts asynchronous cancellation on a long-running operation. The server + * makes a best effort to cancel the operation, but success is not + * guaranteed. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. Clients can use + * {@link Operations.GetOperation} or + * other methods to check whether the cancellation succeeded or whether the + * operation completed despite cancellation. On successful cancellation, + * the operation is not deleted; instead, it becomes an operation with + * an {@link Operation.error} value with a {@link google.rpc.Status.code} of + * 1, corresponding to `Code.CANCELLED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be cancelled. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the + * details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.cancelOperation({name: ''}); + * ``` + */ + cancelOperation( + request: protos.google.longrunning.CancelOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + >, + callback?: Callback< + protos.google.longrunning.CancelOperationRequest, + protos.google.protobuf.Empty, + {} | undefined | null + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.cancelOperation(request, options, callback); + } + + /** + * Deletes a long-running operation. This method indicates that the client is + * no longer interested in the operation result. It does not cancel the + * operation. If the server doesn't support this method, it returns + * `google.rpc.Code.UNIMPLEMENTED`. + * + * @param {Object} request - The request object that will be sent. + * @param {string} request.name - The name of the operation resource to be deleted. + * @param {Object=} options + * Optional parameters. You can override the default settings for this call, + * e.g, timeout, retries, paginations, etc. See {@link + * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} + * for the details. + * @param {function(?Error)=} callback + * The function which will be called with the result of the API call. + * @return {Promise} - The promise which resolves when API call finishes. + * The promise has a method named "cancel" which cancels the ongoing API + * call. + * + * @example + * ``` + * const client = longrunning.operationsClient(); + * await client.deleteOperation({name: ''}); + * ``` + */ + deleteOperation( + request: protos.google.longrunning.DeleteOperationRequest, + optionsOrCallback?: + | gax.CallOptions + | Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + >, + callback?: Callback< + protos.google.protobuf.Empty, + protos.google.longrunning.DeleteOperationRequest, + {} | null | undefined + > + ): Promise { + let options: gax.CallOptions; + if (typeof optionsOrCallback === 'function' && callback === undefined) { + callback = optionsOrCallback; + options = {}; + } else { + options = optionsOrCallback as gax.CallOptions; + } + options = options || {}; + options.otherArgs = options.otherArgs || {}; + options.otherArgs.headers = options.otherArgs.headers || {}; + options.otherArgs.headers['x-goog-request-params'] = + this._gaxModule.routingHeader.fromParams({ + name: request.name ?? '', + }); + return this.operationsClient.deleteOperation(request, options, callback); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backupvault:string,datasource:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backupvault from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backupvault; + } + + /** + * Parse the datasource from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).datasource; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified backupPlan resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @returns {string} Resource name string. + */ + backupPlanPath(project:string,location:string,backupPlan:string) { + return this.pathTemplates.backupPlanPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + }); + } + + /** + * Parse the project from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).project; + } + + /** + * Parse the location from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).location; + } + + /** + * Parse the backup_plan from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).backup_plan; + } + + /** + * Return a fully-qualified backupPlanAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan_association + * @returns {string} Resource name string. + */ + backupPlanAssociationPath(project:string,location:string,backupPlanAssociation:string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.render({ + project: project, + location: location, + backup_plan_association: backupPlanAssociation, + }); + } + + /** + * Parse the project from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).project; + } + + /** + * Parse the location from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).location; + } + + /** + * Parse the backup_plan_association from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the backup_plan_association. + */ + matchBackupPlanAssociationFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).backup_plan_association; + } + + /** + * Return a fully-qualified backupPlanRevision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @param {string} revision + * @returns {string} Resource name string. + */ + backupPlanRevisionPath(project:string,location:string,backupPlan:string,revision:string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + revision: revision, + }); + } + + /** + * Parse the project from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).project; + } + + /** + * Parse the location from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).location; + } + + /** + * Parse the backup_plan from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).backup_plan; + } + + /** + * Parse the revision from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).revision; + } + + /** + * Return a fully-qualified backupVault resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @returns {string} Resource name string. + */ + backupVaultPath(project:string,location:string,backupvault:string) { + return this.pathTemplates.backupVaultPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + }); + } + + /** + * Parse the project from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).project; + } + + /** + * Parse the location from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).location; + } + + /** + * Parse the backupvault from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).backupvault; + } + + /** + * Return a fully-qualified dataSource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @returns {string} Resource name string. + */ + dataSourcePath(project:string,location:string,backupvault:string,datasource:string) { + return this.pathTemplates.dataSourcePathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + }); + } + + /** + * Parse the project from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).project; + } + + /** + * Parse the location from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).location; + } + + /** + * Parse the backupvault from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).backupvault; + } + + /** + * Parse the datasource from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).datasource; + } + + /** + * Return a fully-qualified dataSourceReference resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_source_reference + * @returns {string} Resource name string. + */ + dataSourceReferencePath(project:string,location:string,dataSourceReference:string) { + return this.pathTemplates.dataSourceReferencePathTemplate.render({ + project: project, + location: location, + data_source_reference: dataSourceReference, + }); + } + + /** + * Parse the project from DataSourceReference resource. + * + * @param {string} dataSourceReferenceName + * A fully-qualified path representing DataSourceReference resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataSourceReferenceName(dataSourceReferenceName: string) { + return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).project; + } + + /** + * Parse the location from DataSourceReference resource. + * + * @param {string} dataSourceReferenceName + * A fully-qualified path representing DataSourceReference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSourceReferenceName(dataSourceReferenceName: string) { + return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).location; + } + + /** + * Parse the data_source_reference from DataSourceReference resource. + * + * @param {string} dataSourceReferenceName + * A fully-qualified path representing DataSourceReference resource. + * @returns {string} A string representing the data_source_reference. + */ + matchDataSourceReferenceFromDataSourceReferenceName(dataSourceReferenceName: string) { + return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).data_source_reference; + } + + /** + * 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 managementServer resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} managementserver + * @returns {string} Resource name string. + */ + managementServerPath(project:string,location:string,managementserver:string) { + return this.pathTemplates.managementServerPathTemplate.render({ + project: project, + location: location, + managementserver: managementserver, + }); + } + + /** + * Parse the project from ManagementServer resource. + * + * @param {string} managementServerName + * A fully-qualified path representing ManagementServer resource. + * @returns {string} A string representing the project. + */ + matchProjectFromManagementServerName(managementServerName: string) { + return this.pathTemplates.managementServerPathTemplate.match(managementServerName).project; + } + + /** + * Parse the location from ManagementServer resource. + * + * @param {string} managementServerName + * A fully-qualified path representing ManagementServer resource. + * @returns {string} A string representing the location. + */ + matchLocationFromManagementServerName(managementServerName: string) { + return this.pathTemplates.managementServerPathTemplate.match(managementServerName).location; + } + + /** + * Parse the managementserver from ManagementServer resource. + * + * @param {string} managementServerName + * A fully-qualified path representing ManagementServer resource. + * @returns {string} A string representing the managementserver. + */ + matchManagementserverFromManagementServerName(managementServerName: string) { + return this.pathTemplates.managementServerPathTemplate.match(managementServerName).managementserver; + } + + /** + * 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 resourceBackupConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} resource_backup_config + * @returns {string} Resource name string. + */ + resourceBackupConfigPath(project:string,location:string,resourceBackupConfig:string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.render({ + project: project, + location: location, + resource_backup_config: resourceBackupConfig, + }); + } + + /** + * Parse the project from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).project; + } + + /** + * Parse the location from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).location; + } + + /** + * Parse the resource_backup_config from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the resource_backup_config. + */ + matchResourceBackupConfigFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).resource_backup_config; + } + + /** + * 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.backupDRStub && !this._terminated) { + return this.backupDRStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + void this.operationsClient.close(); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json new file mode 100644 index 00000000000..4621626acd4 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json @@ -0,0 +1,204 @@ +{ + "interfaces": { + "google.cloud.backupdr.v1.BackupDR": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListManagementServers": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "CreateManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteManagementServer": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FetchUsableBackupVaults": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupVault": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "ListDataSources": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "GetDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateDataSource": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackups": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "FetchBackupsForResourceType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackup": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + }, + "UpdateBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "RestoreBackup": { + "timeout_millis": 60000, + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlans": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlan": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlanRevision": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlanRevisions": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "CreateBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "UpdateBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListBackupPlanAssociations": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchBackupPlanAssociationsForResourceType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "DeleteBackupPlanAssociation": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "TriggerBackup": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "GetDataSourceReference": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "ListDataSourceReferences": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "FetchDataSourceReferencesForResourceType": { + "retry_codes_name": "non_idempotent", + "retry_params_name": "default" + }, + "InitializeService": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json new file mode 100644 index 00000000000..0a7f3ffd5b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/backupdr/v1/backupdr.proto", + "../../protos/google/cloud/backupdr/v1/backupplan.proto", + "../../protos/google/cloud/backupdr/v1/backupplanassociation.proto", + "../../protos/google/cloud/backupdr/v1/backupvault.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_ba.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_disk.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_gce.proto", + "../../protos/google/cloud/backupdr/v1/datasourcereference.proto", + "../../protos/google/cloud/backupdr/v1/protection_summary.proto" +] diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts new file mode 100644 index 00000000000..cc83861c4c3 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts @@ -0,0 +1,1361 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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, LocationsClient, LocationProtos} from 'google-gax'; +import {Transform} from 'stream'; +import * as protos from '../../protos/protos'; +import jsonProtos = require('../../protos/protos.json'); +import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; + +/** + * Client JSON configuration object, loaded from + * `src/v1/backup_dr_protection_summary_client_config.json`. + * This file defines retry strategy and timeouts for all API methods in this library. + */ +import * as gapicConfig from './backup_dr_protection_summary_client_config.json'; +const version = require('../../../package.json').version; + +/** + * The Protection Summary service. + * @class + * @memberof v1 + */ +export class BackupDrProtectionSummaryClient { + 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('backupdr'); + + auth: gax.GoogleAuth; + descriptors: Descriptors = { + page: {}, + stream: {}, + longrunning: {}, + batching: {}, + }; + warn: (code: string, message: string, warnType?: string) => void; + innerApiCalls: {[name: string]: Function}; + iamClient: IamClient; + locationsClient: LocationsClient; + pathTemplates: {[name: string]: gax.PathTemplate}; + backupDrProtectionSummaryStub?: Promise<{[name: string]: Function}>; + + /** + * Construct an instance of BackupDrProtectionSummaryClient. + * + * @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 BackupDrProtectionSummaryClient({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 BackupDrProtectionSummaryClient; + 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 = 'backupdr.' + 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); + + this.locationsClient = new this._gaxModule.LocationsClient( + this._gaxGrpc, + opts + ); + + + // Determine the client header string. + const clientHeader = [ + `gax/${this._gaxModule.version}`, + `gapic/${version}`, + ]; + if (typeof process === 'object' && 'versions' in process) { + clientHeader.push(`gl-node/${process.versions.node}`); + } else { + clientHeader.push(`gl-web/${this._gaxModule.version}`); + } + if (!opts.fallback) { + clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); + } else { + clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); + } + if (opts.libName && opts.libVersion) { + clientHeader.push(`${opts.libName}/${opts.libVersion}`); + } + // Load the applicable protos. + this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); + + // This API contains "path templates"; forward-slash-separated + // identifiers to uniquely identify resources within the API. + // Create useful helper objects for these. + this.pathTemplates = { + backupPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}' + ), + backupPlanPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}' + ), + backupPlanAssociationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}' + ), + backupPlanRevisionPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}' + ), + backupVaultPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}' + ), + dataSourcePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}' + ), + dataSourceReferencePathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}' + ), + locationPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}' + ), + managementServerPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/managementServers/{managementserver}' + ), + resourceBackupConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}' + ), + }; + + // 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 = { + listResourceBackupConfigs: + new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'resourceBackupConfigs') + }; + + // Put together the default options sent with requests. + this._defaults = this._gaxGrpc.constructSettings( + 'google.cloud.backupdr.v1.BackupDrProtectionSummary', 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.backupDrProtectionSummaryStub) { + return this.backupDrProtectionSummaryStub; + } + + // Put together the "service stub" for + // google.cloud.backupdr.v1.BackupDrProtectionSummary. + this.backupDrProtectionSummaryStub = this._gaxGrpc.createStub( + this._opts.fallback ? + (this._protos as protobuf.Root).lookupService('google.cloud.backupdr.v1.BackupDrProtectionSummary') : + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (this._protos as any).google.cloud.backupdr.v1.BackupDrProtectionSummary, + 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 backupDrProtectionSummaryStubMethods = + ['listResourceBackupConfigs']; + for (const methodName of backupDrProtectionSummaryStubMethods) { + const callPromise = this.backupDrProtectionSummaryStub.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.backupDrProtectionSummaryStub; + } + + /** + * 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 'backupdr.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 'backupdr.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 -- + // ------------------- + + /** + * Lists ResourceBackupConfigs. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve resource backup + * configs. Format: 'projects/{project_id}/locations/{location}'. In Google + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will use 100 as default. Maximum value is + * 500 and values above 500 will be coerced to 500. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.ResourceBackupConfig|ResourceBackupConfig}. + * 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 `listResourceBackupConfigsAsync()` + * 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. + */ + listResourceBackupConfigs( + request?: protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + options?: CallOptions): + Promise<[ + protos.google.cloud.backupdr.v1.IResourceBackupConfig[], + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest|null, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse + ]>; + listResourceBackupConfigs( + request: protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + options: CallOptions, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IResourceBackupConfig>): void; + listResourceBackupConfigs( + request: protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + callback: PaginationCallback< + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IResourceBackupConfig>): void; + listResourceBackupConfigs( + request?: protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + optionsOrCallback?: CallOptions|PaginationCallback< + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IResourceBackupConfig>, + callback?: PaginationCallback< + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IResourceBackupConfig>): + Promise<[ + protos.google.cloud.backupdr.v1.IResourceBackupConfig[], + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest|null, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse + ]>|void { + request = request || {}; + let options: CallOptions; + if (typeof 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.backupdr.v1.IListResourceBackupConfigsRequest, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse|null|undefined, + protos.google.cloud.backupdr.v1.IResourceBackupConfig>|undefined = callback + ? (error, values, nextPageRequest, rawResponse) => { + this._log.info('listResourceBackupConfigs values %j', values); + callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. + } + : undefined; + this._log.info('listResourceBackupConfigs request %j', request); + return this.innerApiCalls + .listResourceBackupConfigs(request, options, wrappedCallback) + ?.then(([response, input, output]: [ + protos.google.cloud.backupdr.v1.IResourceBackupConfig[], + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest|null, + protos.google.cloud.backupdr.v1.IListResourceBackupConfigsResponse + ]) => { + this._log.info('listResourceBackupConfigs values %j', response); + return [response, input, output]; + }); + } + +/** + * Equivalent to `listResourceBackupConfigs`, but returns a NodeJS Stream object. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.parent + * Required. The project and location for which to retrieve resource backup + * configs. Format: 'projects/{project_id}/locations/{location}'. In Google + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will use 100 as default. Maximum value is + * 500 and values above 500 will be coerced to 500. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.ResourceBackupConfig|ResourceBackupConfig} 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 `listResourceBackupConfigsAsync()` + * 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. + */ + listResourceBackupConfigsStream( + request?: protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + 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['listResourceBackupConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listResourceBackupConfigs stream %j', request); + return this.descriptors.page.listResourceBackupConfigs.createStream( + this.innerApiCalls.listResourceBackupConfigs as GaxCall, + request, + callSettings + ); + } + +/** + * Equivalent to `listResourceBackupConfigs`, 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 project and location for which to retrieve resource backup + * configs. Format: 'projects/{project_id}/locations/{location}'. In Google + * Cloud Backup and DR, locations map to Google Cloud regions, for example + * **us-central1**. + * @param {number} [request.pageSize] + * Optional. Requested page size. Server may return fewer items than + * requested. If unspecified, server will use 100 as default. Maximum value is + * 500 and values above 500 will be coerced to 500. + * @param {string} [request.pageToken] + * Optional. A token identifying a page of results the server should return. + * @param {string} [request.filter] + * Optional. Filtering results. + * @param {string} [request.orderBy] + * Optional. Hint for how to order the 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.backupdr.v1.ResourceBackupConfig|ResourceBackupConfig}. 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/backup_dr_protection_summary.list_resource_backup_configs.js + * region_tag:backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_async + */ + listResourceBackupConfigsAsync( + request?: protos.google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, + 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['listResourceBackupConfigs']; + const callSettings = defaultCallSettings.merge(options); + this.initialize().catch(err => {throw err}); + this._log.info('listResourceBackupConfigs iterate %j', request); + return this.descriptors.page.listResourceBackupConfigs.asyncIterate( + this.innerApiCalls['listResourceBackupConfigs'] 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 information about a location. + * + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * Resource name for the location. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. + * @returns {Promise} - The promise which resolves to an array. + * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } + * for more details and examples. + * @example + * ``` + * const [response] = await client.getLocation(request); + * ``` + */ + getLocation( + request: LocationProtos.google.cloud.location.IGetLocationRequest, + options?: + | gax.CallOptions + | Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + >, + callback?: Callback< + LocationProtos.google.cloud.location.ILocation, + | LocationProtos.google.cloud.location.IGetLocationRequest + | null + | undefined, + {} | null | undefined + > + ): Promise { + return this.locationsClient.getLocation(request, options, callback); + } + +/** + * Lists information about the supported locations for this service. Returns an iterable object. + * + * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. + * @param {Object} request + * The request object that will be sent. + * @param {string} request.name + * The resource that owns the locations collection, if applicable. + * @param {string} request.filter + * The standard list filter. + * @param {number} request.pageSize + * The standard list page size. + * @param {string} request.pageToken + * The standard list page token. + * @param {object} [options] + * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. + * @returns {Object} + * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. + * When you iterate the returned iterable, each element will be an object representing + * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, + * so you can stop the iteration when you don't need more results. + * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } + * for more details and examples. + * @example + * ``` + * const iterable = client.listLocationsAsync(request); + * for await (const response of iterable) { + * // process response + * } + * ``` + */ + listLocationsAsync( + request: LocationProtos.google.cloud.location.IListLocationsRequest, + options?: CallOptions + ): AsyncIterable { + return this.locationsClient.listLocationsAsync(request, options); + } + + // -------------------- + // -- Path templates -- + // -------------------- + + /** + * Return a fully-qualified backup resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @param {string} backup + * @returns {string} Resource name string. + */ + backupPath(project:string,location:string,backupvault:string,datasource:string,backup:string) { + return this.pathTemplates.backupPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + backup: backup, + }); + } + + /** + * Parse the project from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).project; + } + + /** + * Parse the location from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).location; + } + + /** + * Parse the backupvault from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backupvault; + } + + /** + * Parse the datasource from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).datasource; + } + + /** + * Parse the backup from Backup resource. + * + * @param {string} backupName + * A fully-qualified path representing Backup resource. + * @returns {string} A string representing the backup. + */ + matchBackupFromBackupName(backupName: string) { + return this.pathTemplates.backupPathTemplate.match(backupName).backup; + } + + /** + * Return a fully-qualified backupPlan resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @returns {string} Resource name string. + */ + backupPlanPath(project:string,location:string,backupPlan:string) { + return this.pathTemplates.backupPlanPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + }); + } + + /** + * Parse the project from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).project; + } + + /** + * Parse the location from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).location; + } + + /** + * Parse the backup_plan from BackupPlan resource. + * + * @param {string} backupPlanName + * A fully-qualified path representing BackupPlan resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupPlanName(backupPlanName: string) { + return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).backup_plan; + } + + /** + * Return a fully-qualified backupPlanAssociation resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan_association + * @returns {string} Resource name string. + */ + backupPlanAssociationPath(project:string,location:string,backupPlanAssociation:string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.render({ + project: project, + location: location, + backup_plan_association: backupPlanAssociation, + }); + } + + /** + * Parse the project from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).project; + } + + /** + * Parse the location from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).location; + } + + /** + * Parse the backup_plan_association from BackupPlanAssociation resource. + * + * @param {string} backupPlanAssociationName + * A fully-qualified path representing BackupPlanAssociation resource. + * @returns {string} A string representing the backup_plan_association. + */ + matchBackupPlanAssociationFromBackupPlanAssociationName(backupPlanAssociationName: string) { + return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).backup_plan_association; + } + + /** + * Return a fully-qualified backupPlanRevision resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backup_plan + * @param {string} revision + * @returns {string} Resource name string. + */ + backupPlanRevisionPath(project:string,location:string,backupPlan:string,revision:string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.render({ + project: project, + location: location, + backup_plan: backupPlan, + revision: revision, + }); + } + + /** + * Parse the project from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).project; + } + + /** + * Parse the location from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).location; + } + + /** + * Parse the backup_plan from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the backup_plan. + */ + matchBackupPlanFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).backup_plan; + } + + /** + * Parse the revision from BackupPlanRevision resource. + * + * @param {string} backupPlanRevisionName + * A fully-qualified path representing BackupPlanRevision resource. + * @returns {string} A string representing the revision. + */ + matchRevisionFromBackupPlanRevisionName(backupPlanRevisionName: string) { + return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).revision; + } + + /** + * Return a fully-qualified backupVault resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @returns {string} Resource name string. + */ + backupVaultPath(project:string,location:string,backupvault:string) { + return this.pathTemplates.backupVaultPathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + }); + } + + /** + * Parse the project from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the project. + */ + matchProjectFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).project; + } + + /** + * Parse the location from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the location. + */ + matchLocationFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).location; + } + + /** + * Parse the backupvault from BackupVault resource. + * + * @param {string} backupVaultName + * A fully-qualified path representing BackupVault resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromBackupVaultName(backupVaultName: string) { + return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).backupvault; + } + + /** + * Return a fully-qualified dataSource resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} backupvault + * @param {string} datasource + * @returns {string} Resource name string. + */ + dataSourcePath(project:string,location:string,backupvault:string,datasource:string) { + return this.pathTemplates.dataSourcePathTemplate.render({ + project: project, + location: location, + backupvault: backupvault, + datasource: datasource, + }); + } + + /** + * Parse the project from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).project; + } + + /** + * Parse the location from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).location; + } + + /** + * Parse the backupvault from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the backupvault. + */ + matchBackupvaultFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).backupvault; + } + + /** + * Parse the datasource from DataSource resource. + * + * @param {string} dataSourceName + * A fully-qualified path representing DataSource resource. + * @returns {string} A string representing the datasource. + */ + matchDatasourceFromDataSourceName(dataSourceName: string) { + return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).datasource; + } + + /** + * Return a fully-qualified dataSourceReference resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} data_source_reference + * @returns {string} Resource name string. + */ + dataSourceReferencePath(project:string,location:string,dataSourceReference:string) { + return this.pathTemplates.dataSourceReferencePathTemplate.render({ + project: project, + location: location, + data_source_reference: dataSourceReference, + }); + } + + /** + * Parse the project from DataSourceReference resource. + * + * @param {string} dataSourceReferenceName + * A fully-qualified path representing DataSourceReference resource. + * @returns {string} A string representing the project. + */ + matchProjectFromDataSourceReferenceName(dataSourceReferenceName: string) { + return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).project; + } + + /** + * Parse the location from DataSourceReference resource. + * + * @param {string} dataSourceReferenceName + * A fully-qualified path representing DataSourceReference resource. + * @returns {string} A string representing the location. + */ + matchLocationFromDataSourceReferenceName(dataSourceReferenceName: string) { + return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).location; + } + + /** + * Parse the data_source_reference from DataSourceReference resource. + * + * @param {string} dataSourceReferenceName + * A fully-qualified path representing DataSourceReference resource. + * @returns {string} A string representing the data_source_reference. + */ + matchDataSourceReferenceFromDataSourceReferenceName(dataSourceReferenceName: string) { + return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).data_source_reference; + } + + /** + * 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 managementServer resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} managementserver + * @returns {string} Resource name string. + */ + managementServerPath(project:string,location:string,managementserver:string) { + return this.pathTemplates.managementServerPathTemplate.render({ + project: project, + location: location, + managementserver: managementserver, + }); + } + + /** + * Parse the project from ManagementServer resource. + * + * @param {string} managementServerName + * A fully-qualified path representing ManagementServer resource. + * @returns {string} A string representing the project. + */ + matchProjectFromManagementServerName(managementServerName: string) { + return this.pathTemplates.managementServerPathTemplate.match(managementServerName).project; + } + + /** + * Parse the location from ManagementServer resource. + * + * @param {string} managementServerName + * A fully-qualified path representing ManagementServer resource. + * @returns {string} A string representing the location. + */ + matchLocationFromManagementServerName(managementServerName: string) { + return this.pathTemplates.managementServerPathTemplate.match(managementServerName).location; + } + + /** + * Parse the managementserver from ManagementServer resource. + * + * @param {string} managementServerName + * A fully-qualified path representing ManagementServer resource. + * @returns {string} A string representing the managementserver. + */ + matchManagementserverFromManagementServerName(managementServerName: string) { + return this.pathTemplates.managementServerPathTemplate.match(managementServerName).managementserver; + } + + /** + * Return a fully-qualified resourceBackupConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} resource_backup_config + * @returns {string} Resource name string. + */ + resourceBackupConfigPath(project:string,location:string,resourceBackupConfig:string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.render({ + project: project, + location: location, + resource_backup_config: resourceBackupConfig, + }); + } + + /** + * Parse the project from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).project; + } + + /** + * Parse the location from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).location; + } + + /** + * Parse the resource_backup_config from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the resource_backup_config. + */ + matchResourceBackupConfigFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).resource_backup_config; + } + + /** + * 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.backupDrProtectionSummaryStub && !this._terminated) { + return this.backupDrProtectionSummaryStub.then(stub => { + this._log.info('ending gRPC channel'); + this._terminated = true; + stub.close(); + this.iamClient.close().catch(err => {throw err}); + this.locationsClient.close().catch(err => {throw err}); + }); + } + return Promise.resolve(); + } +} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json new file mode 100644 index 00000000000..209bdd1a28f --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json @@ -0,0 +1,43 @@ +{ + "interfaces": { + "google.cloud.backupdr.v1.BackupDrProtectionSummary": { + "retry_codes": { + "non_idempotent": [], + "idempotent": [ + "DEADLINE_EXCEEDED", + "UNAVAILABLE" + ], + "unavailable": [ + "UNAVAILABLE" + ] + }, + "retry_params": { + "default": { + "initial_retry_delay_millis": 100, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 60000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + }, + "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { + "initial_retry_delay_millis": 1000, + "retry_delay_multiplier": 1.3, + "max_retry_delay_millis": 10000, + "initial_rpc_timeout_millis": 60000, + "rpc_timeout_multiplier": 1, + "max_rpc_timeout_millis": 60000, + "total_timeout_millis": 600000 + } + }, + "methods": { + "ListResourceBackupConfigs": { + "timeout_millis": 60000, + "retry_codes_name": "unavailable", + "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json new file mode 100644 index 00000000000..0a7f3ffd5b0 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json @@ -0,0 +1,12 @@ +[ + "../../protos/google/cloud/backupdr/v1/backupdr.proto", + "../../protos/google/cloud/backupdr/v1/backupplan.proto", + "../../protos/google/cloud/backupdr/v1/backupplanassociation.proto", + "../../protos/google/cloud/backupdr/v1/backupvault.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_ba.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_disk.proto", + "../../protos/google/cloud/backupdr/v1/backupvault_gce.proto", + "../../protos/google/cloud/backupdr/v1/datasourcereference.proto", + "../../protos/google/cloud/backupdr/v1/protection_summary.proto" +] diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json new file mode 100644 index 00000000000..4d7fc4ea0bb --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json @@ -0,0 +1,469 @@ +{ + "schema": "1.0", + "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", + "language": "typescript", + "protoPackage": "google.cloud.backupdr.v1", + "libraryPackage": "@google-cloud/backupdr", + "services": { + "BackupDR": { + "clients": { + "grpc": { + "libraryClient": "BackupDRClient", + "rpcs": { + "GetManagementServer": { + "methods": [ + "getManagementServer" + ] + }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanRevision": { + "methods": [ + "getBackupPlanRevision" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, + "GetDataSourceReference": { + "methods": [ + "getDataSourceReference" + ] + }, + "CreateManagementServer": { + "methods": [ + "createManagementServer" + ] + }, + "DeleteManagementServer": { + "methods": [ + "deleteManagementServer" + ] + }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "UpdateBackupPlan": { + "methods": [ + "updateBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "UpdateBackupPlanAssociation": { + "methods": [ + "updateBackupPlanAssociation" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "InitializeService": { + "methods": [ + "initializeService" + ] + }, + "ListManagementServers": { + "methods": [ + "listManagementServers", + "listManagementServersStream", + "listManagementServersAsync" + ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults", + "listBackupVaultsStream", + "listBackupVaultsAsync" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults", + "fetchUsableBackupVaultsStream", + "fetchUsableBackupVaultsAsync" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "FetchBackupsForResourceType": { + "methods": [ + "fetchBackupsForResourceType", + "fetchBackupsForResourceTypeStream", + "fetchBackupsForResourceTypeAsync" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackupPlanRevisions": { + "methods": [ + "listBackupPlanRevisions", + "listBackupPlanRevisionsStream", + "listBackupPlanRevisionsAsync" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations", + "listBackupPlanAssociationsStream", + "listBackupPlanAssociationsAsync" + ] + }, + "FetchBackupPlanAssociationsForResourceType": { + "methods": [ + "fetchBackupPlanAssociationsForResourceType", + "fetchBackupPlanAssociationsForResourceTypeStream", + "fetchBackupPlanAssociationsForResourceTypeAsync" + ] + }, + "ListDataSourceReferences": { + "methods": [ + "listDataSourceReferences", + "listDataSourceReferencesStream", + "listDataSourceReferencesAsync" + ] + }, + "FetchDataSourceReferencesForResourceType": { + "methods": [ + "fetchDataSourceReferencesForResourceType", + "fetchDataSourceReferencesForResourceTypeStream", + "fetchDataSourceReferencesForResourceTypeAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BackupDRClient", + "rpcs": { + "GetManagementServer": { + "methods": [ + "getManagementServer" + ] + }, + "GetBackupVault": { + "methods": [ + "getBackupVault" + ] + }, + "GetDataSource": { + "methods": [ + "getDataSource" + ] + }, + "GetBackup": { + "methods": [ + "getBackup" + ] + }, + "GetBackupPlan": { + "methods": [ + "getBackupPlan" + ] + }, + "GetBackupPlanRevision": { + "methods": [ + "getBackupPlanRevision" + ] + }, + "GetBackupPlanAssociation": { + "methods": [ + "getBackupPlanAssociation" + ] + }, + "GetDataSourceReference": { + "methods": [ + "getDataSourceReference" + ] + }, + "CreateManagementServer": { + "methods": [ + "createManagementServer" + ] + }, + "DeleteManagementServer": { + "methods": [ + "deleteManagementServer" + ] + }, + "CreateBackupVault": { + "methods": [ + "createBackupVault" + ] + }, + "UpdateBackupVault": { + "methods": [ + "updateBackupVault" + ] + }, + "DeleteBackupVault": { + "methods": [ + "deleteBackupVault" + ] + }, + "UpdateDataSource": { + "methods": [ + "updateDataSource" + ] + }, + "UpdateBackup": { + "methods": [ + "updateBackup" + ] + }, + "DeleteBackup": { + "methods": [ + "deleteBackup" + ] + }, + "RestoreBackup": { + "methods": [ + "restoreBackup" + ] + }, + "CreateBackupPlan": { + "methods": [ + "createBackupPlan" + ] + }, + "UpdateBackupPlan": { + "methods": [ + "updateBackupPlan" + ] + }, + "DeleteBackupPlan": { + "methods": [ + "deleteBackupPlan" + ] + }, + "CreateBackupPlanAssociation": { + "methods": [ + "createBackupPlanAssociation" + ] + }, + "UpdateBackupPlanAssociation": { + "methods": [ + "updateBackupPlanAssociation" + ] + }, + "DeleteBackupPlanAssociation": { + "methods": [ + "deleteBackupPlanAssociation" + ] + }, + "TriggerBackup": { + "methods": [ + "triggerBackup" + ] + }, + "InitializeService": { + "methods": [ + "initializeService" + ] + }, + "ListManagementServers": { + "methods": [ + "listManagementServers", + "listManagementServersStream", + "listManagementServersAsync" + ] + }, + "ListBackupVaults": { + "methods": [ + "listBackupVaults", + "listBackupVaultsStream", + "listBackupVaultsAsync" + ] + }, + "FetchUsableBackupVaults": { + "methods": [ + "fetchUsableBackupVaults", + "fetchUsableBackupVaultsStream", + "fetchUsableBackupVaultsAsync" + ] + }, + "ListDataSources": { + "methods": [ + "listDataSources", + "listDataSourcesStream", + "listDataSourcesAsync" + ] + }, + "ListBackups": { + "methods": [ + "listBackups", + "listBackupsStream", + "listBackupsAsync" + ] + }, + "FetchBackupsForResourceType": { + "methods": [ + "fetchBackupsForResourceType", + "fetchBackupsForResourceTypeStream", + "fetchBackupsForResourceTypeAsync" + ] + }, + "ListBackupPlans": { + "methods": [ + "listBackupPlans", + "listBackupPlansStream", + "listBackupPlansAsync" + ] + }, + "ListBackupPlanRevisions": { + "methods": [ + "listBackupPlanRevisions", + "listBackupPlanRevisionsStream", + "listBackupPlanRevisionsAsync" + ] + }, + "ListBackupPlanAssociations": { + "methods": [ + "listBackupPlanAssociations", + "listBackupPlanAssociationsStream", + "listBackupPlanAssociationsAsync" + ] + }, + "FetchBackupPlanAssociationsForResourceType": { + "methods": [ + "fetchBackupPlanAssociationsForResourceType", + "fetchBackupPlanAssociationsForResourceTypeStream", + "fetchBackupPlanAssociationsForResourceTypeAsync" + ] + }, + "ListDataSourceReferences": { + "methods": [ + "listDataSourceReferences", + "listDataSourceReferencesStream", + "listDataSourceReferencesAsync" + ] + }, + "FetchDataSourceReferencesForResourceType": { + "methods": [ + "fetchDataSourceReferencesForResourceType", + "fetchDataSourceReferencesForResourceTypeStream", + "fetchDataSourceReferencesForResourceTypeAsync" + ] + } + } + } + } + }, + "BackupDrProtectionSummary": { + "clients": { + "grpc": { + "libraryClient": "BackupDrProtectionSummaryClient", + "rpcs": { + "ListResourceBackupConfigs": { + "methods": [ + "listResourceBackupConfigs", + "listResourceBackupConfigsStream", + "listResourceBackupConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BackupDrProtectionSummaryClient", + "rpcs": { + "ListResourceBackupConfigs": { + "methods": [ + "listResourceBackupConfigs", + "listResourceBackupConfigsStream", + "listResourceBackupConfigsAsync" + ] + } + } + } + } + } + } +} diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/index.ts b/owl-bot-staging/google-cloud-backupdr/src/v1/index.ts new file mode 100644 index 00000000000..576f9dae209 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/src/v1/index.ts @@ -0,0 +1,20 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BackupDRClient} from './backup_d_r_client'; +export {BackupDrProtectionSummaryClient} from './backup_dr_protection_summary_client'; diff --git a/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js new file mode 100644 index 00000000000..6557b418888 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js @@ -0,0 +1,28 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 backupdr = require('@google-cloud/backupdr'); + +function main() { + const backupDRClient = new backupdr.BackupDRClient(); + const backupDrProtectionSummaryClient = new backupdr.BackupDrProtectionSummaryClient(); +} + +main(); diff --git a/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts new file mode 100644 index 00000000000..b0ba9f95bdf --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts @@ -0,0 +1,38 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 {BackupDRClient, BackupDrProtectionSummaryClient} from '@google-cloud/backupdr'; + +// check that the client class type name can be used +function doStuffWithBackupDRClient(client: BackupDRClient) { + client.close(); +} +function doStuffWithBackupDrProtectionSummaryClient(client: BackupDrProtectionSummaryClient) { + client.close(); +} + +function main() { + // check that the client instance can be created + const backupDRClient = new BackupDRClient(); + doStuffWithBackupDRClient(backupDRClient); + // check that the client instance can be created + const backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient(); + doStuffWithBackupDrProtectionSummaryClient(backupDrProtectionSummaryClient); +} + +main(); diff --git a/owl-bot-staging/google-cloud-backupdr/system-test/install.ts b/owl-bot-staging/google-cloud-backupdr/system-test/install.ts new file mode 100644 index 00000000000..394f3362d20 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/system-test/install.ts @@ -0,0 +1,49 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** This file is automatically generated by gapic-generator-typescript. ** +// ** https://github.com/googleapis/gapic-generator-typescript ** +// ** All changes to this file may be overwritten. ** + +import {packNTest} from 'pack-n-play'; +import {readFileSync} from 'fs'; +import {describe, it} from 'mocha'; + +describe('📦 pack-n-play test', () => { + + it('TypeScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'TypeScript user can use the type definitions', + ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() + } + }; + await packNTest(options); + }); + + it('JavaScript code', async function() { + this.timeout(300000); + const options = { + packageDir: process.cwd(), + sample: { + description: 'JavaScript user can use the library', + ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() + } + }; + await packNTest(options); + }); + +}); diff --git a/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts b/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts new file mode 100644 index 00000000000..843d6ef43f6 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts @@ -0,0 +1,7933 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 backupdrModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); +} + +function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { + const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); + const mockOperation = { + promise: innerStub, + }; + return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.BackupDRClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new backupdrModule.v1.BackupDRClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'backupdr.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new backupdrModule.v1.BackupDRClient(); + 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 = backupdrModule.v1.BackupDRClient.servicePath; + assert.strictEqual(servicePath, 'backupdr.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = backupdrModule.v1.BackupDRClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'backupdr.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new backupdrModule.v1.BackupDRClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new backupdrModule.v1.BackupDRClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.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 backupdrModule.v1.BackupDRClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.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 backupdrModule.v1.BackupDRClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.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 backupdrModule.v1.BackupDRClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = backupdrModule.v1.BackupDRClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new backupdrModule.v1.BackupDRClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new backupdrModule.v1.BackupDRClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.backupDRStub, undefined); + await client.initialize(); + assert(client.backupDRStub); + }); + + it('has close method for the initialized client', done => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.backupDRStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.backupDRStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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('getManagementServer', () => { + it('invokes getManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ); + client.innerApiCalls.getManagementServer = stubSimpleCall(expectedResponse); + const [response] = await client.getManagementServer(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ManagementServer() + ); + client.innerApiCalls.getManagementServer = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getManagementServer( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IManagementServer|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getManagementServer with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getManagementServer = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getManagementServer(request), expectedError); + const actualRequest = (client.innerApiCalls.getManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getManagementServer with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getManagementServer(request), expectedError); + }); + }); + + describe('getBackupVault', () => { + it('invokes getBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ); + client.innerApiCalls.getBackupVault = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupVault(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupVault() + ); + client.innerApiCalls.getBackupVault = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupVault( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupVault|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupVault with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupVault = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackupVault(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupVault with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackupVault(request), expectedError); + }); + }); + + describe('getDataSource', () => { + it('invokes getDataSource without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSource() + ); + client.innerApiCalls.getDataSource = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSource(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSource() + ); + client.innerApiCalls.getDataSource = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSource( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSource|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSource = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataSource(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSource with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDataSource(request), expectedError); + }); + }); + + describe('getBackup', () => { + it('invokes getBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); + const [response] = await client.getBackup(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.Backup() + ); + client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackup( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackup|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackup with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackup(request), expectedError); + }); + }); + + describe('getBackupPlan', () => { + it('invokes getBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlan() + ); + client.innerApiCalls.getBackupPlan = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlan(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlan() + ); + client.innerApiCalls.getBackupPlan = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlan( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlan|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlan = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackupPlan(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlan with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackupPlan(request), expectedError); + }); + }); + + describe('getBackupPlanRevision', () => { + it('invokes getBackupPlanRevision without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanRevision() + ); + client.innerApiCalls.getBackupPlanRevision = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlanRevision(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupPlanRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanRevision without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanRevision() + ); + client.innerApiCalls.getBackupPlanRevision = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlanRevision( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanRevision|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupPlanRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanRevision with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlanRevision = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackupPlanRevision(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackupPlanRevision as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanRevision as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanRevision with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackupPlanRevision(request), expectedError); + }); + }); + + describe('getBackupPlanAssociation', () => { + it('invokes getBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() + ); + client.innerApiCalls.getBackupPlanAssociation = stubSimpleCall(expectedResponse); + const [response] = await client.getBackupPlanAssociation(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.BackupPlanAssociation() + ); + client.innerApiCalls.getBackupPlanAssociation = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getBackupPlanAssociation( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getBackupPlanAssociation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getBackupPlanAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getBackupPlanAssociation with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getBackupPlanAssociation(request), expectedError); + }); + }); + + describe('getDataSourceReference', () => { + it('invokes getDataSourceReference without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSourceReference() + ); + client.innerApiCalls.getDataSourceReference = stubSimpleCall(expectedResponse); + const [response] = await client.getDataSourceReference(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataSourceReference as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSourceReference as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSourceReference without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DataSourceReference() + ); + client.innerApiCalls.getDataSourceReference = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getDataSourceReference( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSourceReference|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.getDataSourceReference as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSourceReference as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSourceReference with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.getDataSourceReference = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getDataSourceReference(request), expectedError); + const actualRequest = (client.innerApiCalls.getDataSourceReference as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.getDataSourceReference as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes getDataSourceReference with closed client', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); + request.name = defaultValue1; + const expectedError = new Error('The client has already been closed.'); + client.close().catch(err => {throw err}); + await assert.rejects(client.getDataSourceReference(request), expectedError); + }); + }); + + describe('createManagementServer', () => { + it('invokes createManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createManagementServer = stubLongRunningCall(expectedResponse); + const [operation] = await client.createManagementServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createManagementServer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createManagementServer( + 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.createManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagementServer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createManagementServer(request), expectedError); + const actualRequest = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createManagementServer with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createManagementServer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createManagementServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateManagementServerProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateManagementServerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateManagementServerProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateManagementServerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteManagementServer', () => { + it('invokes deleteManagementServer without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteManagementServer(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteManagementServer = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteManagementServer( + 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.deleteManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteManagementServer(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteManagementServer with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteManagementServer = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteManagementServer(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteManagementServerProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteManagementServerProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteManagementServerProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteManagementServerProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackupVault', () => { + it('invokes createBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupVault = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupVault = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupVault( + 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.createBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupVault = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackupVault(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupVault = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupVaultProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupVaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackupVault', () => { + it('invokes updateBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupVault = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupVault = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupVault( + 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.updateBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupVault = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackupVault(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() + ); + request.backupVault ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); + request.backupVault.name = defaultValue1; + const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupVault = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupVaultProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupVaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackupVault', () => { + it('invokes deleteBackupVault without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupVault(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupVault = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupVault( + 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.deleteBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackupVault(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupVault with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupVault = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackupVault(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupVaultProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupVaultProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupVaultProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupVaultProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateDataSource', () => { + it('invokes updateDataSource without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataSource = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateDataSource(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateDataSource = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateDataSource( + 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.updateDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSource = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateDataSource(request), expectedError); + const actualRequest = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateDataSource with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() + ); + request.dataSource ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); + request.dataSource.name = defaultValue1; + const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateDataSource = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateDataSource(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateDataSourceProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateDataSourceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateDataSourceProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateDataSourceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackup', () => { + it('invokes updateBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackup( + 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.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupRequest() + ); + request.backup ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); + request.backup.name = defaultValue1; + const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackup', () => { + it('invokes deleteBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackup( + 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.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('restoreBackup', () => { + it('invokes restoreBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.restoreBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.restoreBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.restoreBackup( + 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.restoreBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.restoreBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes restoreBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.RestoreBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.restoreBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.restoreBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkRestoreBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkRestoreBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkRestoreBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkRestoreBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackupPlan', () => { + it('invokes createBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlan = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlan = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupPlan( + 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.createBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlan = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackupPlan(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlan = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackupPlan', () => { + it('invokes updateBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); + request.backupPlan.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupPlan = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); + request.backupPlan.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupPlan = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupPlan( + 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.updateBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); + request.backupPlan.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupPlan = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackupPlan(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() + ); + request.backupPlan ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); + request.backupPlan.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupPlan = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupPlanProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupPlanProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackupPlan', () => { + it('invokes deleteBackupPlan without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupPlan(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupPlan( + 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.deleteBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackupPlan(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlan with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlan = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackupPlan(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupPlanProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupPlanProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('createBackupPlanAssociation', () => { + it('invokes createBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.createBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.createBackupPlanAssociation( + 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.createBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.createBackupPlanAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes createBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.createBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkCreateBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkCreateBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkCreateBackupPlanAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('updateBackupPlanAssociation', () => { + it('invokes updateBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() + ); + request.backupPlanAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); + request.backupPlanAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.updateBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() + ); + request.backupPlanAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); + request.backupPlanAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.updateBackupPlanAssociation( + 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.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() + ); + request.backupPlanAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); + request.backupPlanAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.updateBackupPlanAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes updateBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() + ); + request.backupPlanAssociation ??= {}; + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); + request.backupPlanAssociation.name = defaultValue1; + const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.updateBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkUpdateBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupPlanAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkUpdateBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkUpdateBackupPlanAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('deleteBackupPlanAssociation', () => { + it('invokes deleteBackupPlanAssociation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall(expectedResponse); + const [operation] = await client.deleteBackupPlanAssociation(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.deleteBackupPlanAssociation( + 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.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.deleteBackupPlanAssociation(request), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes deleteBackupPlanAssociation with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.deleteBackupPlanAssociation(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkDeleteBackupPlanAssociationProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanAssociationProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkDeleteBackupPlanAssociationProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkDeleteBackupPlanAssociationProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('triggerBackup', () => { + it('invokes triggerBackup without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.triggerBackup = stubLongRunningCall(expectedResponse); + const [operation] = await client.triggerBackup(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.triggerBackup = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.triggerBackup( + 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.triggerBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.triggerBackup = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.triggerBackup(request), expectedError); + const actualRequest = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes triggerBackup with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.TriggerBackupRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.triggerBackup = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.triggerBackup(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkTriggerBackupProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkTriggerBackupProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkTriggerBackupProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkTriggerBackupProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('initializeService', () => { + it('invokes initializeService without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.initializeService = stubLongRunningCall(expectedResponse); + const [operation] = await client.initializeService(request); + const [response] = await operation.promise(); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes initializeService without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedResponse = generateSampleMessage( + new protos.google.longrunning.Operation() + ); + client.innerApiCalls.initializeService = stubLongRunningCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.initializeService( + 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.initializeService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes initializeService with call error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.initializeService = stubLongRunningCall(undefined, expectedError); + await assert.rejects(client.initializeService(request), expectedError); + const actualRequest = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes initializeService with LRO error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.InitializeServiceRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); + request.name = defaultValue1; + const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.initializeService = stubLongRunningCall(undefined, undefined, expectedError); + const [operation] = await client.initializeService(request); + await assert.rejects(operation.promise(), expectedError); + const actualRequest = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes checkInitializeServiceProgress without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkInitializeServiceProgress(expectedResponse.name); + assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); + assert(decodedOperation.metadata); + assert((client.operationsClient.getOperation as SinonStub).getCall(0)); + }); + + it('invokes checkInitializeServiceProgress with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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.checkInitializeServiceProgress(''), expectedError); + assert((client.operationsClient.getOperation as SinonStub) + .getCall(0)); + }); + }); + + describe('listManagementServers', () => { + it('invokes listManagementServers without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + ]; + client.innerApiCalls.listManagementServers = stubSimpleCall(expectedResponse); + const [response] = await client.listManagementServers(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listManagementServers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listManagementServers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServers without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + ]; + client.innerApiCalls.listManagementServers = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listManagementServers( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IManagementServer[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listManagementServers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listManagementServers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServers with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listManagementServers = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listManagementServers(request), expectedError); + const actualRequest = (client.innerApiCalls.listManagementServers as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listManagementServers as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listManagementServersStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + ]; + client.descriptors.page.listManagementServers.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listManagementServersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + 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.listManagementServers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listManagementServers, request)); + assert( + (client.descriptors.page.listManagementServers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listManagementServersStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listManagementServers.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listManagementServersStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.ManagementServer) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listManagementServers.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listManagementServers, request)); + assert( + (client.descriptors.page.listManagementServers.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagementServers without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), + ]; + client.descriptors.page.listManagementServers.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; + const iterable = client.listManagementServersAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listManagementServers with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListManagementServersRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listManagementServers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listManagementServersAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupVaults', () => { + it('invokes listBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.innerApiCalls.listBackupVaults = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupVaults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupVaults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupVaults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaults without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.innerApiCalls.listBackupVaults = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupVaults( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupVault[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupVaults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupVaults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupVaults = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackupVaults(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackupVaults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupVaults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupVaultsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.descriptors.page.listBackupVaults.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { + 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.listBackupVaults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupVaults, request)); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupVaultsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupVaults.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupVaults, request)); + assert( + (client.descriptors.page.listBackupVaults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.descriptors.page.listBackupVaults.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + const iterable = client.listBackupVaultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupVaults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupVaultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('fetchUsableBackupVaults', () => { + it('invokes fetchUsableBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCall(expectedResponse); + const [response] = await client.fetchUsableBackupVaults(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaults without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchUsableBackupVaults( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupVault[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchUsableBackupVaults(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchUsableBackupVaultsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.descriptors.page.fetchUsableBackupVaults.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.fetchUsableBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { + 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.fetchUsableBackupVaults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchUsableBackupVaults, request)); + assert( + (client.descriptors.page.fetchUsableBackupVaults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchUsableBackupVaultsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchUsableBackupVaults.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchUsableBackupVaultsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.fetchUsableBackupVaults.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchUsableBackupVaults, request)); + assert( + (client.descriptors.page.fetchUsableBackupVaults.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchUsableBackupVaults without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), + ]; + client.descriptors.page.fetchUsableBackupVaults.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + const iterable = client.fetchUsableBackupVaultsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchUsableBackupVaults with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchUsableBackupVaults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchUsableBackupVaultsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDataSources', () => { + it('invokes listDataSources without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.innerApiCalls.listDataSources = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSources(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDataSources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataSources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.innerApiCalls.listDataSources = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSources( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSource[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDataSources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataSources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSources with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSources = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataSources(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataSources as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataSources as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourcesStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.descriptors.page.listDataSources.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSource) => { + 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.listDataSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataSources, request)); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataSourcesStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSourcesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSource) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataSources, request)); + assert( + (client.descriptors.page.listDataSources.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSources without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), + ]; + client.descriptors.page.listDataSources.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; + const iterable = client.listDataSourcesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSources with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSourcesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDataSources.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackups', () => { + it('invokes listBackups without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); + const [response] = await client.listBackups(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackups( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackups with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackups(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { + 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.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); + assert( + (client.descriptors.page.listBackups.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + const iterable = client.listBackupsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackups with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackups.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('fetchBackupsForResourceType', () => { + it('invokes fetchBackupsForResourceType without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.fetchBackupsForResourceType = stubSimpleCall(expectedResponse); + const [response] = await client.fetchBackupsForResourceType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchBackupsForResourceType without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.innerApiCalls.fetchBackupsForResourceType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchBackupsForResourceType( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackup[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchBackupsForResourceType with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchBackupsForResourceType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchBackupsForResourceType(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchBackupsForResourceTypeStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.fetchBackupsForResourceType.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.fetchBackupsForResourceTypeStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { + 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.fetchBackupsForResourceType.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchBackupsForResourceType, request)); + assert( + (client.descriptors.page.fetchBackupsForResourceType.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchBackupsForResourceTypeStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchBackupsForResourceType.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchBackupsForResourceTypeStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.Backup[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.fetchBackupsForResourceType.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchBackupsForResourceType, request)); + assert( + (client.descriptors.page.fetchBackupsForResourceType.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchBackupsForResourceType without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), + ]; + client.descriptors.page.fetchBackupsForResourceType.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + const iterable = client.fetchBackupsForResourceTypeAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchBackupsForResourceType with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchBackupsForResourceType.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchBackupsForResourceTypeAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupPlans', () => { + it('invokes listBackupPlans without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.innerApiCalls.listBackupPlans = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupPlans(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupPlans as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlans as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlans without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.innerApiCalls.listBackupPlans = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupPlans( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlan[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupPlans as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlans as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlans with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupPlans = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackupPlans(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackupPlans as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlans as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlansStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.descriptors.page.listBackupPlans.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupPlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlan) => { + 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.listBackupPlans.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupPlans, request)); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupPlansStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlans.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupPlansStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlan) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupPlans, request)); + assert( + (client.descriptors.page.listBackupPlans.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupPlans without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), + ]; + client.descriptors.page.listBackupPlans.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; + const iterable = client.listBackupPlansAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupPlans with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlans.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupPlansAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupPlanRevisions', () => { + it('invokes listBackupPlanRevisions without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + ]; + client.innerApiCalls.listBackupPlanRevisions = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupPlanRevisions(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlanRevisions without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + ]; + client.innerApiCalls.listBackupPlanRevisions = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupPlanRevisions( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanRevision[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlanRevisions with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupPlanRevisions = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackupPlanRevisions(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlanRevisionsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + ]; + client.descriptors.page.listBackupPlanRevisions.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupPlanRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlanRevision[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanRevision) => { + 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.listBackupPlanRevisions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupPlanRevisions, request)); + assert( + (client.descriptors.page.listBackupPlanRevisions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupPlanRevisionsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlanRevisions.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupPlanRevisionsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlanRevision[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanRevision) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackupPlanRevisions.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupPlanRevisions, request)); + assert( + (client.descriptors.page.listBackupPlanRevisions.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupPlanRevisions without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), + ]; + client.descriptors.page.listBackupPlanRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupPlanRevision[] = []; + const iterable = client.listBackupPlanRevisionsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupPlanRevisions with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlanRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupPlanRevisionsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupPlanRevision[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listBackupPlanAssociations', () => { + it('invokes listBackupPlanAssociations without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall(expectedResponse); + const [response] = await client.listBackupPlanAssociations(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlanAssociations without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listBackupPlanAssociations( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlanAssociations with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listBackupPlanAssociations(request), expectedError); + const actualRequest = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listBackupPlanAssociationsStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listBackupPlanAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { + 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.listBackupPlanAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupPlanAssociations, request)); + assert( + (client.descriptors.page.listBackupPlanAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listBackupPlanAssociationsStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listBackupPlanAssociationsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listBackupPlanAssociations.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listBackupPlanAssociations, request)); + assert( + (client.descriptors.page.listBackupPlanAssociations.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupPlanAssociations without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; + const iterable = client.listBackupPlanAssociationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listBackupPlanAssociations with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listBackupPlanAssociationsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('fetchBackupPlanAssociationsForResourceType', () => { + it('invokes fetchBackupPlanAssociationsForResourceType without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.innerApiCalls.fetchBackupPlanAssociationsForResourceType = stubSimpleCall(expectedResponse); + const [response] = await client.fetchBackupPlanAssociationsForResourceType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchBackupPlanAssociationsForResourceType without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.innerApiCalls.fetchBackupPlanAssociationsForResourceType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchBackupPlanAssociationsForResourceType( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchBackupPlanAssociationsForResourceType with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchBackupPlanAssociationsForResourceType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchBackupPlanAssociationsForResourceType(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchBackupPlanAssociationsForResourceTypeStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.fetchBackupPlanAssociationsForResourceTypeStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { + 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.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchBackupPlanAssociationsForResourceType, request)); + assert( + (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchBackupPlanAssociationsForResourceTypeStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchBackupPlanAssociationsForResourceTypeStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchBackupPlanAssociationsForResourceType, request)); + assert( + (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchBackupPlanAssociationsForResourceType without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), + ]; + client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; + const iterable = client.fetchBackupPlanAssociationsForResourceTypeAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchBackupPlanAssociationsForResourceType with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchBackupPlanAssociationsForResourceTypeAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('listDataSourceReferences', () => { + it('invokes listDataSourceReferences without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.innerApiCalls.listDataSourceReferences = stubSimpleCall(expectedResponse); + const [response] = await client.listDataSourceReferences(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDataSourceReferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataSourceReferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourceReferences without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.innerApiCalls.listDataSourceReferences = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listDataSourceReferences( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSourceReference[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listDataSourceReferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataSourceReferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourceReferences with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listDataSourceReferences = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listDataSourceReferences(request), expectedError); + const actualRequest = (client.innerApiCalls.listDataSourceReferences as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listDataSourceReferences as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listDataSourceReferencesStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.descriptors.page.listDataSourceReferences.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listDataSourceReferencesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { + 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.listDataSourceReferences.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataSourceReferences, request)); + assert( + (client.descriptors.page.listDataSourceReferences.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listDataSourceReferencesStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSourceReferences.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listDataSourceReferencesStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listDataSourceReferences.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listDataSourceReferences, request)); + assert( + (client.descriptors.page.listDataSourceReferences.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSourceReferences without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.descriptors.page.listDataSourceReferences.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; + const iterable = client.listDataSourceReferencesAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listDataSourceReferences with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listDataSourceReferences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listDataSourceReferencesAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('fetchDataSourceReferencesForResourceType', () => { + it('invokes fetchDataSourceReferencesForResourceType without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.innerApiCalls.fetchDataSourceReferencesForResourceType = stubSimpleCall(expectedResponse); + const [response] = await client.fetchDataSourceReferencesForResourceType(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDataSourceReferencesForResourceType without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.innerApiCalls.fetchDataSourceReferencesForResourceType = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.fetchDataSourceReferencesForResourceType( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSourceReference[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDataSourceReferencesForResourceType with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.fetchDataSourceReferencesForResourceType = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.fetchDataSourceReferencesForResourceType(request), expectedError); + const actualRequest = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes fetchDataSourceReferencesForResourceTypeStream without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.fetchDataSourceReferencesForResourceTypeStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { + 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.fetchDataSourceReferencesForResourceType.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchDataSourceReferencesForResourceType, request)); + assert( + (client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes fetchDataSourceReferencesForResourceTypeStream with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.fetchDataSourceReferencesForResourceTypeStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.fetchDataSourceReferencesForResourceType, request)); + assert( + (client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchDataSourceReferencesForResourceType without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), + ]; + client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; + const iterable = client.fetchDataSourceReferencesForResourceTypeAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with fetchDataSourceReferencesForResourceType with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.fetchDataSourceReferencesForResourceTypeAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.fetchDataSourceReferencesForResourceType.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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + describe('getOperation', () => { + it('invokes getOperation without error', async () => { + const client = new backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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 backupdrModule.v1.BackupDRClient({ + 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('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backupvault: "backupvaultValue", + datasource: "datasourceValue", + backup: "backupValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupvaultValue", "datasourceValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupvaultFromBackupName', () => { + const result = client.matchBackupvaultFromBackupName(fakePath); + assert.strictEqual(result, "backupvaultValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasourceFromBackupName', () => { + const result = client.matchDatasourceFromBackupName(fakePath); + assert.strictEqual(result, "datasourceValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupPlan', async () => { + const fakePath = "/rendered/path/backupPlan"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup_plan: "backupPlanValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPlanPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPlanPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPlanPath', () => { + const result = client.backupPlanPath("projectValue", "locationValue", "backupPlanValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPlanPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupPlanName', () => { + const result = client.matchProjectFromBackupPlanName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupPlanName', () => { + const result = client.matchLocationFromBackupPlanName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupPlanFromBackupPlanName', () => { + const result = client.matchBackupPlanFromBackupPlanName(fakePath); + assert.strictEqual(result, "backupPlanValue"); + assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupPlanAssociation', async () => { + const fakePath = "/rendered/path/backupPlanAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup_plan_association: "backupPlanAssociationValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPlanAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPlanAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPlanAssociationPath', () => { + const result = client.backupPlanAssociationPath("projectValue", "locationValue", "backupPlanAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupPlanAssociationName', () => { + const result = client.matchProjectFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupPlanAssociationName', () => { + const result = client.matchLocationFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupPlanAssociationFromBackupPlanAssociationName', () => { + const result = client.matchBackupPlanAssociationFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, "backupPlanAssociationValue"); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupPlanRevision', async () => { + const fakePath = "/rendered/path/backupPlanRevision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup_plan: "backupPlanValue", + revision: "revisionValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPlanRevisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPlanRevisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPlanRevisionPath', () => { + const result = client.backupPlanRevisionPath("projectValue", "locationValue", "backupPlanValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupPlanRevisionName', () => { + const result = client.matchProjectFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupPlanRevisionName', () => { + const result = client.matchLocationFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupPlanFromBackupPlanRevisionName', () => { + const result = client.matchBackupPlanFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "backupPlanValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromBackupPlanRevisionName', () => { + const result = client.matchRevisionFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupVault', async () => { + const fakePath = "/rendered/path/backupVault"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backupvault: "backupvaultValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupVaultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupVaultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupVaultPath', () => { + const result = client.backupVaultPath("projectValue", "locationValue", "backupvaultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupVaultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupVaultName', () => { + const result = client.matchProjectFromBackupVaultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupVaultName', () => { + const result = client.matchLocationFromBackupVaultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupvaultFromBackupVaultName', () => { + const result = client.matchBackupvaultFromBackupVaultName(fakePath); + assert.strictEqual(result, "backupvaultValue"); + assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataSource', async () => { + const fakePath = "/rendered/path/dataSource"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backupvault: "backupvaultValue", + datasource: "datasourceValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSourcePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataSourcePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataSourcePath', () => { + const result = client.dataSourcePath("projectValue", "locationValue", "backupvaultValue", "datasourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataSourcePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataSourceName', () => { + const result = client.matchProjectFromDataSourceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataSourceName', () => { + const result = client.matchLocationFromDataSourceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupvaultFromDataSourceName', () => { + const result = client.matchBackupvaultFromDataSourceName(fakePath); + assert.strictEqual(result, "backupvaultValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasourceFromDataSourceName', () => { + const result = client.matchDatasourceFromDataSourceName(fakePath); + assert.strictEqual(result, "datasourceValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataSourceReference', async () => { + const fakePath = "/rendered/path/dataSourceReference"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_source_reference: "dataSourceReferenceValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSourceReferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataSourceReferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataSourceReferencePath', () => { + const result = client.dataSourceReferencePath("projectValue", "locationValue", "dataSourceReferenceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataSourceReferencePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataSourceReferenceName', () => { + const result = client.matchProjectFromDataSourceReferenceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataSourceReferenceName', () => { + const result = client.matchLocationFromDataSourceReferenceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataSourceReferenceFromDataSourceReferenceName', () => { + const result = client.matchDataSourceReferenceFromDataSourceReferenceName(fakePath); + assert.strictEqual(result, "dataSourceReferenceValue"); + assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + 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('managementServer', async () => { + const fakePath = "/rendered/path/managementServer"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + managementserver: "managementserverValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.managementServerPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.managementServerPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('managementServerPath', () => { + const result = client.managementServerPath("projectValue", "locationValue", "managementserverValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.managementServerPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromManagementServerName', () => { + const result = client.matchProjectFromManagementServerName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromManagementServerName', () => { + const result = client.matchLocationFromManagementServerName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchManagementserverFromManagementServerName', () => { + const result = client.matchManagementserverFromManagementServerName(fakePath); + assert.strictEqual(result, "managementserverValue"); + assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('project', async () => { + const fakePath = "/rendered/path/project"; + const expectedParameters = { + project: "projectValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + 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('resourceBackupConfig', async () => { + const fakePath = "/rendered/path/resourceBackupConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + resource_backup_config: "resourceBackupConfigValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.resourceBackupConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.resourceBackupConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('resourceBackupConfigPath', () => { + const result = client.resourceBackupConfigPath("projectValue", "locationValue", "resourceBackupConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromResourceBackupConfigName', () => { + const result = client.matchProjectFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromResourceBackupConfigName', () => { + const result = client.matchLocationFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceBackupConfigFromResourceBackupConfigName', () => { + const result = client.matchResourceBackupConfigFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "resourceBackupConfigValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts b/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts new file mode 100644 index 00000000000..503cbcd82b6 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts @@ -0,0 +1,1435 @@ +// Copyright 2026 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// https://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +// ** 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 backupdrprotectionsummaryModule from '../src'; + +import {PassThrough} from 'stream'; + +import {protobuf, IamProtos, LocationProtos} from 'google-gax'; + +// Dynamically loaded proto JSON is needed to get the type information +// to fill in default values for request objects +const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); + +// eslint-disable-next-line @typescript-eslint/no-unused-vars +function getTypeDefaultValue(typeName: string, fields: string[]) { + let type = root.lookupType(typeName) as protobuf.Type; + for (const field of fields.slice(0, -1)) { + type = type.fields[field]?.resolvedType as protobuf.Type; + } + return type.fields[fields[fields.length - 1]]?.defaultValue; +} + +function generateSampleMessage(instance: T) { + const filledObject = (instance.constructor as typeof protobuf.Message) + .toObject(instance as protobuf.Message, {defaults: true}); + return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; +} + +function stubSimpleCall(response?: ResponseType, error?: Error) { + return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); +} + +function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { + return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); +} + +function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { + const pagingStub = sinon.stub(); + if (responses) { + for (let i = 0; i < responses.length; ++i) { + pagingStub.onCall(i).callsArgWith(2, null, responses[i]); + } + } + const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; + const mockStream = new PassThrough({ + objectMode: true, + transform: transformStub, + }); + // trigger as many responses as needed + if (responses) { + for (let i = 0; i < responses.length; ++i) { + setImmediate(() => { mockStream.write({}); }); + } + setImmediate(() => { mockStream.end(); }); + } else { + setImmediate(() => { mockStream.write({}); }); + setImmediate(() => { mockStream.end(); }); + } + return sinon.stub().returns(mockStream); +} + +function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { + let counter = 0; + const asyncIterable = { + [Symbol.asyncIterator]() { + return { + async next() { + if (error) { + return Promise.reject(error); + } + if (counter >= responses!.length) { + return Promise.resolve({done: true, value: undefined}); + } + return Promise.resolve({done: false, value: responses![counter++]}); + } + }; + } + }; + return sinon.stub().returns(asyncIterable); +} + +describe('v1.BackupDrProtectionSummaryClient', () => { + describe('Common methods', () => { + it('has apiEndpoint', () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient(); + const apiEndpoint = client.apiEndpoint; + assert.strictEqual(apiEndpoint, 'backupdr.googleapis.com'); + }); + + it('has universeDomain', () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient(); + 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 = backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient.servicePath; + assert.strictEqual(servicePath, 'backupdr.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + + it('throws DeprecationWarning if static apiEndpoint is used', () => { + const stub = sinon.stub(process, 'emitWarning'); + const apiEndpoint = backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient.apiEndpoint; + assert.strictEqual(apiEndpoint, 'backupdr.googleapis.com'); + assert(stub.called); + stub.restore(); + }); + } + it('sets apiEndpoint according to universe domain camelCase', () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({universeDomain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.example.com'); + }); + + it('sets apiEndpoint according to universe domain snakeCase', () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({universe_domain: 'example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient(); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({universeDomain: 'configured.example.com'}); + const servicePath = client.apiEndpoint; + assert.strictEqual(servicePath, 'backupdr.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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); + }); + + it('has port', () => { + const port = backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient.port; + assert(port); + assert(typeof port === 'number'); + }); + + it('should create a client with no option', () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient(); + assert(client); + }); + + it('should create a client with gRPC fallback', () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + fallback: true, + }); + assert(client); + }); + + it('has initialize method and supports deferred initialization', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.backupDrProtectionSummaryStub, undefined); + await client.initialize(); + assert(client.backupDrProtectionSummaryStub); + }); + + it('has close method for the initialized client', done => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + client.initialize().catch(err => {throw err}); + assert(client.backupDrProtectionSummaryStub); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has close method for the non-initialized client', done => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + assert.strictEqual(client.backupDrProtectionSummaryStub, undefined); + client.close().then(() => { + done(); + }).catch(err => {throw err}); + }); + + it('has getProjectId method', async () => { + const fakeProjectId = 'fake-project-id'; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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('listResourceBackupConfigs', () => { + it('invokes listResourceBackupConfigs without error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + ]; + client.innerApiCalls.listResourceBackupConfigs = stubSimpleCall(expectedResponse); + const [response] = await client.listResourceBackupConfigs(request); + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceBackupConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceBackupConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceBackupConfigs without error using callback', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + ]; + client.innerApiCalls.listResourceBackupConfigs = stubSimpleCallWithCallback(expectedResponse); + const promise = new Promise((resolve, reject) => { + client.listResourceBackupConfigs( + request, + (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IResourceBackupConfig[]|null) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + const actualRequest = (client.innerApiCalls.listResourceBackupConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceBackupConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceBackupConfigs with error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.innerApiCalls.listResourceBackupConfigs = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.listResourceBackupConfigs(request), expectedError); + const actualRequest = (client.innerApiCalls.listResourceBackupConfigs as SinonStub) + .getCall(0).args[0]; + assert.deepStrictEqual(actualRequest, request); + const actualHeaderRequestParams = (client.innerApiCalls.listResourceBackupConfigs as SinonStub) + .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; + assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); + }); + + it('invokes listResourceBackupConfigsStream without error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + ]; + client.descriptors.page.listResourceBackupConfigs.createStream = stubPageStreamingCall(expectedResponse); + const stream = client.listResourceBackupConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ResourceBackupConfig[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.ResourceBackupConfig) => { + 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.listResourceBackupConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceBackupConfigs, request)); + assert( + (client.descriptors.page.listResourceBackupConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('invokes listResourceBackupConfigsStream with error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceBackupConfigs.createStream = stubPageStreamingCall(undefined, expectedError); + const stream = client.listResourceBackupConfigsStream(request); + const promise = new Promise((resolve, reject) => { + const responses: protos.google.cloud.backupdr.v1.ResourceBackupConfig[] = []; + stream.on('data', (response: protos.google.cloud.backupdr.v1.ResourceBackupConfig) => { + responses.push(response); + }); + stream.on('end', () => { + resolve(responses); + }); + stream.on('error', (err: Error) => { + reject(err); + }); + }); + await assert.rejects(promise, expectedError); + assert((client.descriptors.page.listResourceBackupConfigs.createStream as SinonStub) + .getCall(0).calledWith(client.innerApiCalls.listResourceBackupConfigs, request)); + assert( + (client.descriptors.page.listResourceBackupConfigs.createStream as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceBackupConfigs without error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedResponse = [ + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + generateSampleMessage(new protos.google.cloud.backupdr.v1.ResourceBackupConfig()), + ]; + client.descriptors.page.listResourceBackupConfigs.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: protos.google.cloud.backupdr.v1.IResourceBackupConfig[] = []; + const iterable = client.listResourceBackupConfigsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.descriptors.page.listResourceBackupConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceBackupConfigs.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + + it('uses async iteration with listResourceBackupConfigs with error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new protos.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest() + ); + const defaultValue1 = + getTypeDefaultValue('.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest', ['parent']); + request.parent = defaultValue1; + const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; + const expectedError = new Error('expected'); + client.descriptors.page.listResourceBackupConfigs.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listResourceBackupConfigsAsync(request); + await assert.rejects(async () => { + const responses: protos.google.cloud.backupdr.v1.IResourceBackupConfig[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.descriptors.page.listResourceBackupConfigs.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.descriptors.page.listResourceBackupConfigs.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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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 backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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('getLocation', () => { + it('invokes getLocation without error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = stubSimpleCall(expectedResponse); + const response = await client.getLocation(request, expectedOptions); + assert.deepStrictEqual(response, [expectedResponse]); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + it('invokes getLocation without error using callback', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedResponse = generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ); + client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); + const promise = new Promise((resolve, reject) => { + client.getLocation( + request, + expectedOptions, + ( + err?: Error | null, + result?: LocationProtos.google.cloud.location.ILocation | null + ) => { + if (err) { + reject(err); + } else { + resolve(result); + } + }); + }); + const response = await promise; + assert.deepStrictEqual(response, expectedResponse); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0)); + }); + it('invokes getLocation with error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.GetLocationRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedOptions = { + otherArgs: { + headers: { + 'x-goog-request-params': expectedHeaderRequestParams, + }, + }, + }; + const expectedError = new Error('expected'); + client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); + await assert.rejects(client.getLocation(request, expectedOptions), expectedError); + assert((client.locationsClient.getLocation as SinonStub) + .getCall(0).calledWith(request, expectedOptions, undefined)); + }); + }); + describe('listLocationsAsync', () => { + it('uses async iteration with listLocations without error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedResponse = [ + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + generateSampleMessage( + new LocationProtos.google.cloud.location.Location() + ), + ]; + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + const iterable = client.listLocationsAsync(request); + for await (const resource of iterable) { + responses.push(resource!); + } + assert.deepStrictEqual(responses, expectedResponse); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + it('uses async iteration with listLocations with error', async () => { + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + const request = generateSampleMessage( + new LocationProtos.google.cloud.location.ListLocationsRequest() + ); + request.name = ''; + const expectedHeaderRequestParams = 'name='; + const expectedError = new Error('expected'); + client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); + const iterable = client.listLocationsAsync(request); + await assert.rejects(async () => { + const responses: LocationProtos.google.cloud.location.ILocation[] = []; + for await (const resource of iterable) { + responses.push(resource!); + } + }); + assert.deepStrictEqual( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[1], request); + assert( + (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) + .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( + expectedHeaderRequestParams + ) + ); + }); + }); + + describe('Path templates', () => { + + describe('backup', async () => { + const fakePath = "/rendered/path/backup"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backupvault: "backupvaultValue", + datasource: "datasourceValue", + backup: "backupValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPath', () => { + const result = client.backupPath("projectValue", "locationValue", "backupvaultValue", "datasourceValue", "backupValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupName', () => { + const result = client.matchProjectFromBackupName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupName', () => { + const result = client.matchLocationFromBackupName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupvaultFromBackupName', () => { + const result = client.matchBackupvaultFromBackupName(fakePath); + assert.strictEqual(result, "backupvaultValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasourceFromBackupName', () => { + const result = client.matchDatasourceFromBackupName(fakePath); + assert.strictEqual(result, "datasourceValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupFromBackupName', () => { + const result = client.matchBackupFromBackupName(fakePath); + assert.strictEqual(result, "backupValue"); + assert((client.pathTemplates.backupPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupPlan', async () => { + const fakePath = "/rendered/path/backupPlan"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup_plan: "backupPlanValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPlanPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPlanPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPlanPath', () => { + const result = client.backupPlanPath("projectValue", "locationValue", "backupPlanValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPlanPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupPlanName', () => { + const result = client.matchProjectFromBackupPlanName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupPlanName', () => { + const result = client.matchLocationFromBackupPlanName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupPlanFromBackupPlanName', () => { + const result = client.matchBackupPlanFromBackupPlanName(fakePath); + assert.strictEqual(result, "backupPlanValue"); + assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupPlanAssociation', async () => { + const fakePath = "/rendered/path/backupPlanAssociation"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup_plan_association: "backupPlanAssociationValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPlanAssociationPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPlanAssociationPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPlanAssociationPath', () => { + const result = client.backupPlanAssociationPath("projectValue", "locationValue", "backupPlanAssociationValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupPlanAssociationName', () => { + const result = client.matchProjectFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupPlanAssociationName', () => { + const result = client.matchLocationFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupPlanAssociationFromBackupPlanAssociationName', () => { + const result = client.matchBackupPlanAssociationFromBackupPlanAssociationName(fakePath); + assert.strictEqual(result, "backupPlanAssociationValue"); + assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupPlanRevision', async () => { + const fakePath = "/rendered/path/backupPlanRevision"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backup_plan: "backupPlanValue", + revision: "revisionValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupPlanRevisionPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupPlanRevisionPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupPlanRevisionPath', () => { + const result = client.backupPlanRevisionPath("projectValue", "locationValue", "backupPlanValue", "revisionValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupPlanRevisionName', () => { + const result = client.matchProjectFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupPlanRevisionName', () => { + const result = client.matchLocationFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupPlanFromBackupPlanRevisionName', () => { + const result = client.matchBackupPlanFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "backupPlanValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchRevisionFromBackupPlanRevisionName', () => { + const result = client.matchRevisionFromBackupPlanRevisionName(fakePath); + assert.strictEqual(result, "revisionValue"); + assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('backupVault', async () => { + const fakePath = "/rendered/path/backupVault"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backupvault: "backupvaultValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.backupVaultPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.backupVaultPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('backupVaultPath', () => { + const result = client.backupVaultPath("projectValue", "locationValue", "backupvaultValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.backupVaultPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromBackupVaultName', () => { + const result = client.matchProjectFromBackupVaultName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromBackupVaultName', () => { + const result = client.matchLocationFromBackupVaultName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupvaultFromBackupVaultName', () => { + const result = client.matchBackupvaultFromBackupVaultName(fakePath); + assert.strictEqual(result, "backupvaultValue"); + assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataSource', async () => { + const fakePath = "/rendered/path/dataSource"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + backupvault: "backupvaultValue", + datasource: "datasourceValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSourcePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataSourcePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataSourcePath', () => { + const result = client.dataSourcePath("projectValue", "locationValue", "backupvaultValue", "datasourceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataSourcePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataSourceName', () => { + const result = client.matchProjectFromDataSourceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataSourceName', () => { + const result = client.matchLocationFromDataSourceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchBackupvaultFromDataSourceName', () => { + const result = client.matchBackupvaultFromDataSourceName(fakePath); + assert.strictEqual(result, "backupvaultValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDatasourceFromDataSourceName', () => { + const result = client.matchDatasourceFromDataSourceName(fakePath); + assert.strictEqual(result, "datasourceValue"); + assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('dataSourceReference', async () => { + const fakePath = "/rendered/path/dataSourceReference"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + data_source_reference: "dataSourceReferenceValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.dataSourceReferencePathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.dataSourceReferencePathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('dataSourceReferencePath', () => { + const result = client.dataSourceReferencePath("projectValue", "locationValue", "dataSourceReferenceValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.dataSourceReferencePathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromDataSourceReferenceName', () => { + const result = client.matchProjectFromDataSourceReferenceName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromDataSourceReferenceName', () => { + const result = client.matchLocationFromDataSourceReferenceName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchDataSourceReferenceFromDataSourceReferenceName', () => { + const result = client.matchDataSourceReferenceFromDataSourceReferenceName(fakePath); + assert.strictEqual(result, "dataSourceReferenceValue"); + assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('location', async () => { + const fakePath = "/rendered/path/location"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + 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('managementServer', async () => { + const fakePath = "/rendered/path/managementServer"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + managementserver: "managementserverValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.managementServerPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.managementServerPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('managementServerPath', () => { + const result = client.managementServerPath("projectValue", "locationValue", "managementserverValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.managementServerPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromManagementServerName', () => { + const result = client.matchProjectFromManagementServerName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromManagementServerName', () => { + const result = client.matchLocationFromManagementServerName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchManagementserverFromManagementServerName', () => { + const result = client.matchManagementserverFromManagementServerName(fakePath); + assert.strictEqual(result, "managementserverValue"); + assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + + describe('resourceBackupConfig', async () => { + const fakePath = "/rendered/path/resourceBackupConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + resource_backup_config: "resourceBackupConfigValue", + }; + const client = new backupdrprotectionsummaryModule.v1.BackupDrProtectionSummaryClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.resourceBackupConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.resourceBackupConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('resourceBackupConfigPath', () => { + const result = client.resourceBackupConfigPath("projectValue", "locationValue", "resourceBackupConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromResourceBackupConfigName', () => { + const result = client.matchProjectFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromResourceBackupConfigName', () => { + const result = client.matchLocationFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceBackupConfigFromResourceBackupConfigName', () => { + const result = client.matchResourceBackupConfigFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "resourceBackupConfigValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); + }); +}); diff --git a/owl-bot-staging/google-cloud-backupdr/tsconfig.json b/owl-bot-staging/google-cloud-backupdr/tsconfig.json new file mode 100644 index 00000000000..ca73e7bfc82 --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/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-backupdr/webpack.config.js b/owl-bot-staging/google-cloud-backupdr/webpack.config.js new file mode 100644 index 00000000000..72a35713b8c --- /dev/null +++ b/owl-bot-staging/google-cloud-backupdr/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: 'BackupDR', + filename: './backup-d-r.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 dfa81b04fb6cbd65ffb580e6e668c86fad8e353d Mon Sep 17 00:00:00 2001 From: Owl Bot Date: Sat, 10 Jan 2026 02:07:53 +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-backupdr/.eslintignore | 7 - .../google-cloud-backupdr/.eslintrc.json | 3 - .../google-cloud-backupdr/.gitattributes | 4 - .../google-cloud-backupdr/.gitignore | 14 - .../google-cloud-backupdr/.jsdoc.js | 55 - .../google-cloud-backupdr/.mocharc.js | 33 - owl-bot-staging/google-cloud-backupdr/.nycrc | 24 - .../google-cloud-backupdr/.prettierignore | 6 - .../google-cloud-backupdr/.prettierrc.js | 22 - .../google-cloud-backupdr/CODE_OF_CONDUCT.md | 94 - .../google-cloud-backupdr/CONTRIBUTING.md | 76 - owl-bot-staging/google-cloud-backupdr/LICENSE | 202 - .../google-cloud-backupdr/README.md | 152 - .../google/cloud/backupdr/v1/backupdr.proto | 844 - .../google/cloud/backupdr/v1/backupplan.proto | 622 - .../backupdr/v1/backupplanassociation.proto | 436 - .../cloud/backupdr/v1/backupvault.proto | 1390 - .../cloud/backupdr/v1/backupvault_ba.proto | 49 - .../backupdr/v1/backupvault_cloudsql.proto | 146 - .../cloud/backupdr/v1/backupvault_disk.proto | 227 - .../cloud/backupdr/v1/backupvault_gce.proto | 957 - .../backupdr/v1/datasourcereference.proto | 249 - .../google-cloud-backupdr/protos/protos.d.ts | 25533 ------ .../google-cloud-backupdr/protos/protos.js | 69448 ---------------- .../google-cloud-backupdr/protos/protos.json | 9151 -- .../v1/backup_d_r.create_backup_plan.js | 91 - ...ckup_d_r.create_backup_plan_association.js | 89 - .../v1/backup_d_r.create_backup_vault.js | 93 - .../v1/backup_d_r.create_management_server.js | 90 - .../generated/v1/backup_d_r.delete_backup.js | 76 - .../v1/backup_d_r.delete_backup_plan.js | 77 - ...ckup_d_r.delete_backup_plan_association.js | 77 - .../v1/backup_d_r.delete_backup_vault.js | 102 - .../v1/backup_d_r.delete_management_server.js | 76 - ...kup_plan_associations_for_resource_type.js | 105 - ...kup_d_r.fetch_backups_for_resource_type.js | 104 - ...ata_source_references_for_resource_type.js | 109 - .../backup_d_r.fetch_usable_backup_vaults.js | 85 - .../generated/v1/backup_d_r.get_backup.js | 67 - .../v1/backup_d_r.get_backup_plan.js | 62 - .../backup_d_r.get_backup_plan_association.js | 62 - .../v1/backup_d_r.get_backup_plan_revision.js | 63 - .../v1/backup_d_r.get_backup_vault.js | 67 - .../v1/backup_d_r.get_data_source.js | 62 - .../backup_d_r.get_data_source_reference.js | 63 - .../v1/backup_d_r.get_management_server.js | 62 - .../v1/backup_d_r.initialize_service.js | 89 - ...ackup_d_r.list_backup_plan_associations.js | 81 - .../backup_d_r.list_backup_plan_revisions.js | 84 - .../v1/backup_d_r.list_backup_plans.js | 93 - .../v1/backup_d_r.list_backup_vaults.js | 90 - .../generated/v1/backup_d_r.list_backups.js | 90 - .../backup_d_r.list_data_source_references.js | 96 - .../v1/backup_d_r.list_data_sources.js | 85 - .../v1/backup_d_r.list_management_servers.js | 85 - .../generated/v1/backup_d_r.restore_backup.js | 109 - .../generated/v1/backup_d_r.trigger_backup.js | 82 - .../generated/v1/backup_d_r.update_backup.js | 85 - .../v1/backup_d_r.update_backup_plan.js | 88 - ...ckup_d_r.update_backup_plan_association.js | 87 - .../v1/backup_d_r.update_backup_vault.js | 100 - .../v1/backup_d_r.update_data_source.js | 89 - ...pet_metadata_google.cloud.backupdr.v1.json | 1959 - .../google-cloud-backupdr/src/index.ts | 29 - .../src/v1/backup_d_r_client.ts | 7449 -- .../src/v1/backup_d_r_client_config.json | 204 - .../src/v1/backup_d_r_proto_list.json | 12 - .../src/v1/gapic_metadata.json | 469 - .../google-cloud-backupdr/src/v1/index.ts | 20 - .../system-test/fixtures/sample/src/index.js | 28 - .../system-test/fixtures/sample/src/index.ts | 38 - .../system-test/install.ts | 49 - .../test/gapic_backup_d_r_v1.ts | 7933 -- .../google-cloud-backupdr/tsconfig.json | 22 - .../google-cloud-backupdr/webpack.config.js | 64 - packages/google-cloud-backupdr/.jsdoc.js | 4 +- packages/google-cloud-backupdr/.mocharc.js | 2 +- packages/google-cloud-backupdr/.prettierrc.js | 2 +- packages/google-cloud-backupdr/README.md | 1 + .../backupdr/v1/protection_summary.proto | 0 .../google-cloud-backupdr/protos/protos.d.ts | 1122 +- .../google-cloud-backupdr/protos/protos.js | 2896 +- .../google-cloud-backupdr/protos/protos.json | 346 +- .../v1/backup_d_r.create_backup_plan.js | 2 +- ...ckup_d_r.create_backup_plan_association.js | 2 +- .../v1/backup_d_r.create_backup_vault.js | 2 +- .../v1/backup_d_r.create_management_server.js | 2 +- .../generated/v1/backup_d_r.delete_backup.js | 2 +- .../v1/backup_d_r.delete_backup_plan.js | 2 +- ...ckup_d_r.delete_backup_plan_association.js | 2 +- .../v1/backup_d_r.delete_backup_vault.js | 2 +- .../v1/backup_d_r.delete_management_server.js | 2 +- ...kup_plan_associations_for_resource_type.js | 2 +- ...kup_d_r.fetch_backups_for_resource_type.js | 2 +- ...ata_source_references_for_resource_type.js | 2 +- .../backup_d_r.fetch_usable_backup_vaults.js | 2 +- .../generated/v1/backup_d_r.get_backup.js | 2 +- .../v1/backup_d_r.get_backup_plan.js | 2 +- .../backup_d_r.get_backup_plan_association.js | 2 +- .../v1/backup_d_r.get_backup_plan_revision.js | 2 +- .../v1/backup_d_r.get_backup_vault.js | 2 +- .../v1/backup_d_r.get_data_source.js | 2 +- .../backup_d_r.get_data_source_reference.js | 2 +- .../v1/backup_d_r.get_management_server.js | 2 +- .../v1/backup_d_r.initialize_service.js | 2 +- ...ackup_d_r.list_backup_plan_associations.js | 2 +- .../backup_d_r.list_backup_plan_revisions.js | 2 +- .../v1/backup_d_r.list_backup_plans.js | 2 +- .../v1/backup_d_r.list_backup_vaults.js | 2 +- .../generated/v1/backup_d_r.list_backups.js | 2 +- .../backup_d_r.list_data_source_references.js | 2 +- .../v1/backup_d_r.list_data_sources.js | 2 +- .../v1/backup_d_r.list_management_servers.js | 2 +- .../generated/v1/backup_d_r.restore_backup.js | 2 +- .../generated/v1/backup_d_r.trigger_backup.js | 2 +- .../generated/v1/backup_d_r.update_backup.js | 2 +- .../v1/backup_d_r.update_backup_plan.js | 2 +- ...ckup_d_r.update_backup_plan_association.js | 2 +- .../v1/backup_d_r.update_backup_vault.js | 2 +- .../v1/backup_d_r.update_data_source.js | 2 +- ...on_summary.list_resource_backup_configs.js | 0 ...pet_metadata_google.cloud.backupdr.v1.json | 56 + packages/google-cloud-backupdr/src/index.ts | 6 +- .../src/v1/backup_d_r_client.ts | 54 +- .../src/v1/backup_d_r_proto_list.json | 3 +- .../v1/backup_dr_protection_summary_client.ts | 0 ...p_dr_protection_summary_client_config.json | 0 ...ckup_dr_protection_summary_proto_list.json | 0 .../src/v1/gapic_metadata.json | 28 + .../google-cloud-backupdr/src/v1/index.ts | 3 +- .../system-test/fixtures/sample/src/index.js | 3 +- .../system-test/fixtures/sample/src/index.ts | 10 +- .../system-test/install.ts | 2 +- .../test/gapic_backup_d_r_v1.ts | 48 +- .../gapic_backup_dr_protection_summary_v1.ts | 0 135 files changed, 4606 insertions(+), 131189 deletions(-) delete mode 100644 owl-bot-staging/google-cloud-backupdr/.eslintignore delete mode 100644 owl-bot-staging/google-cloud-backupdr/.eslintrc.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/.gitattributes delete mode 100644 owl-bot-staging/google-cloud-backupdr/.gitignore delete mode 100644 owl-bot-staging/google-cloud-backupdr/.jsdoc.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/.mocharc.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/.nycrc delete mode 100644 owl-bot-staging/google-cloud-backupdr/.prettierignore delete mode 100644 owl-bot-staging/google-cloud-backupdr/.prettierrc.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/CODE_OF_CONDUCT.md delete mode 100644 owl-bot-staging/google-cloud-backupdr/CONTRIBUTING.md delete mode 100644 owl-bot-staging/google-cloud-backupdr/LICENSE delete mode 100644 owl-bot-staging/google-cloud-backupdr/README.md delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/protos.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/protos/protos.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/src/v1/index.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js delete mode 100644 owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/system-test/install.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts delete mode 100644 owl-bot-staging/google-cloud-backupdr/tsconfig.json delete mode 100644 owl-bot-staging/google-cloud-backupdr/webpack.config.js rename {owl-bot-staging => packages}/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto (100%) rename {owl-bot-staging => packages}/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js (100%) rename {owl-bot-staging => packages}/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts (100%) rename {owl-bot-staging => packages}/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json (100%) rename {owl-bot-staging => packages}/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json (100%) rename {owl-bot-staging => packages}/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts (100%) diff --git a/owl-bot-staging/google-cloud-backupdr/.eslintignore b/owl-bot-staging/google-cloud-backupdr/.eslintignore deleted file mode 100644 index cfc348ec4d1..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.eslintrc.json b/owl-bot-staging/google-cloud-backupdr/.eslintrc.json deleted file mode 100644 index 78215349546..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "./node_modules/gts" -} diff --git a/owl-bot-staging/google-cloud-backupdr/.gitattributes b/owl-bot-staging/google-cloud-backupdr/.gitattributes deleted file mode 100644 index 33739cb74e4..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.gitattributes +++ /dev/null @@ -1,4 +0,0 @@ -*.ts text eol=lf -*.js text eol=lf -protos/* linguist-generated -**/api-extractor.json linguist-language=JSON-with-Comments diff --git a/owl-bot-staging/google-cloud-backupdr/.gitignore b/owl-bot-staging/google-cloud-backupdr/.gitignore deleted file mode 100644 index d4f03a0df2e..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.jsdoc.js b/owl-bot-staging/google-cloud-backupdr/.jsdoc.js deleted file mode 100644 index c694adb20c8..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.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/backupdr', - theme: 'lumen', - default: { - outputSourceFiles: false - } - }, - markdown: { - idInHeadings: true - } -}; diff --git a/owl-bot-staging/google-cloud-backupdr/.mocharc.js b/owl-bot-staging/google-cloud-backupdr/.mocharc.js deleted file mode 100644 index 5eb34e86c87..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.nycrc b/owl-bot-staging/google-cloud-backupdr/.nycrc deleted file mode 100644 index 81a95fc94b0..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.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-backupdr/.prettierignore b/owl-bot-staging/google-cloud-backupdr/.prettierignore deleted file mode 100644 index 9340ad9b86d..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.prettierignore +++ /dev/null @@ -1,6 +0,0 @@ -**/node_modules -**/coverage -test/fixtures -build/ -docs/ -protos/ diff --git a/owl-bot-staging/google-cloud-backupdr/.prettierrc.js b/owl-bot-staging/google-cloud-backupdr/.prettierrc.js deleted file mode 100644 index 7649ee3c254..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/.prettierrc.js +++ /dev/null @@ -1,22 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - -module.exports = { - ...require('gts/.prettierrc.json') -} diff --git a/owl-bot-staging/google-cloud-backupdr/CODE_OF_CONDUCT.md b/owl-bot-staging/google-cloud-backupdr/CODE_OF_CONDUCT.md deleted file mode 100644 index 2add2547a81..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,94 +0,0 @@ - -# Code of Conduct - -## Our Pledge - -In the interest of fostering an open and welcoming environment, we as -contributors and maintainers pledge to making participation in our project and -our community a harassment-free experience for everyone, regardless of age, body -size, disability, ethnicity, gender identity and expression, level of -experience, education, socio-economic status, nationality, personal appearance, -race, religion, or sexual identity and orientation. - -## Our Standards - -Examples of behavior that contributes to creating a positive environment -include: - -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members - -Examples of unacceptable behavior by participants include: - -* The use of sexualized language or imagery and unwelcome sexual attention or - advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic - address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a - professional setting - -## Our Responsibilities - -Project maintainers are responsible for clarifying the standards of acceptable -behavior and are expected to take appropriate and fair corrective action in -response to any instances of unacceptable behavior. - -Project maintainers have the right and responsibility to remove, edit, or reject -comments, commits, code, wiki edits, issues, and other contributions that are -not aligned to this Code of Conduct, or to ban temporarily or permanently any -contributor for other behaviors that they deem inappropriate, threatening, -offensive, or harmful. - -## Scope - -This Code of Conduct applies both within project spaces and in public spaces -when an individual is representing the project or its community. Examples of -representing a project or community include using an official project e-mail -address, posting via an official social media account, or acting as an appointed -representative at an online or offline event. Representation of a project may be -further defined and clarified by project maintainers. - -This Code of Conduct also applies outside the project spaces when the Project -Steward has a reasonable belief that an individual's behavior may have a -negative impact on the project or its community. - -## Conflict Resolution - -We do not believe that all conflict is bad; healthy debate and disagreement -often yield positive results. However, it is never okay to be disrespectful or -to engage in behavior that violates the project’s code of conduct. - -If you see someone violating the code of conduct, you are encouraged to address -the behavior directly with those involved. Many issues can be resolved quickly -and easily, and this gives people more control over the outcome of their -dispute. If you are unable to resolve the matter for any reason, or if the -behavior is threatening or harassing, report it. We are dedicated to providing -an environment where participants feel welcome and safe. - -Reports should be directed to *googleapis-stewards@google.com*, the -Project Steward(s) for *Google Cloud Client Libraries*. It is the Project Steward’s duty to -receive and address reported violations of the code of conduct. They will then -work with a committee consisting of representatives from the Open Source -Programs Office and the Google Open Source Strategy team. If for any reason you -are uncomfortable reaching out to the Project Steward, please email -opensource@google.com. - -We will investigate every complaint, but you may not receive a direct response. -We will use our discretion in determining when and how to follow up on reported -incidents, which may range from not taking action to permanent expulsion from -the project and project-sponsored spaces. We will notify the accused of the -report and provide them an opportunity to discuss it before any action is taken. -The identity of the reporter will be omitted from the details of the report -supplied to the accused. In potentially harmful situations, such as ongoing -harassment or threats to anyone's safety, we may take action without notice. - -## Attribution - -This Code of Conduct is adapted from the Contributor Covenant, version 1.4, -available at -https://www.contributor-covenant.org/version/1/4/code-of-conduct.html \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-backupdr/CONTRIBUTING.md b/owl-bot-staging/google-cloud-backupdr/CONTRIBUTING.md deleted file mode 100644 index c0fc2a0dfe7..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/CONTRIBUTING.md +++ /dev/null @@ -1,76 +0,0 @@ -# How to become a contributor and submit your own code - -**Table of contents** - -* [Contributor License Agreements](#contributor-license-agreements) -* [Contributing a patch](#contributing-a-patch) -* [Running the tests](#running-the-tests) -* [Releasing the library](#releasing-the-library) - -## Contributor License Agreements - -We'd love to accept your sample apps and patches! Before we can take them, we -have to jump a couple of legal hurdles. - -Please fill out either the individual or corporate Contributor License Agreement -(CLA). - - * If you are an individual writing original source code and you're sure you - own the intellectual property, then you'll need to sign an [individual CLA](https://developers.google.com/open-source/cla/individual). - * If you work for a company that wants to allow you to contribute your work, - then you'll need to sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate). - -Follow either of the two links above to access the appropriate CLA and -instructions for how to sign and return it. Once we receive it, we'll be able to -accept your pull requests. - -## Contributing A Patch - -1. Submit an issue describing your proposed change to the repo in question. -1. The repo owner will respond to your issue promptly. -1. If your proposed change is accepted, and you haven't already done so, sign a - Contributor License Agreement (see details above). -1. Fork the desired repo, develop and test your code changes. -1. Ensure that your code adheres to the existing style in the code to which - you are contributing. -1. Ensure that your code has an appropriate set of tests which all pass. -1. Title your pull request following [Conventional Commits](https://www.conventionalcommits.org/) styling. -1. Submit a pull request. - -### Before you begin - -1. [Select or create a Cloud Platform project][projects]. -1. [Enable billing for your project][billing]. -1. [Enable the Backupdr 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=backupdr.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-backupdr/LICENSE b/owl-bot-staging/google-cloud-backupdr/LICENSE deleted file mode 100644 index d6456956733..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - Licensed under the Apache License, Version 2.0 (the "License"); - you may not use this file except in compliance with the License. - You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. diff --git a/owl-bot-staging/google-cloud-backupdr/README.md b/owl-bot-staging/google-cloud-backupdr/README.md deleted file mode 100644 index e6ee413b3b5..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/README.md +++ /dev/null @@ -1,152 +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 - -# [Backup and DR Service 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/backupdr.svg)](https://www.npmjs.org/package/@google-cloud/backupdr) - -Backup and DR Service API client for Node.js - -[//]: # "partials.introduction" - -A comprehensive list of changes in each version may be found in -[the CHANGELOG][homepage_changelog]. - -* [Backup and DR Service API Nodejs Client API Reference](https://cloud.google.com/nodejs/docs/reference/backupdr/latest) -* [Backup and DR Service API Documentation](https://cloud.google.com/backup-disaster-recovery/docs/reference/rpc) - -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 Backup and DR Service 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/backupdr -``` - -[//]: # "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 backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js) | -| create backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js) | -| create backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js) | -| create management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js) | -| delete backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js) | -| delete backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js) | -| delete backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js) | -| delete backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js) | -| delete management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js) | -| fetch backup plan associations for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js) | -| fetch backups for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js) | -| fetch data source references for resource type | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js) | -| fetch usable backup vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js) | -| get backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js) | -| get backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js) | -| get backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js) | -| get backup plan revision | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js) | -| get backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js) | -| get data source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js) | -| get data source reference | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js) | -| get management server | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js) | -| initialize service | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js) | -| list backup plan associations | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js) | -| list backup plan revisions | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js) | -| list backup plans | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js) | -| list backup vaults | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js) | -| list backups | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js) | -| list data source references | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js) | -| list data sources | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js) | -| list management servers | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js) | -| restore backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js) | -| trigger backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js) | -| update backup | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js) | -| update backup plan | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js) | -| update backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js) | -| update backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js) | -| update data source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js) | -| list resource backup configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js) | -| cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json) | - - -## 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/backupdr@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-backupdr/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-backupdr/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=backupdr.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-backupdr/samples -[homepage_changelog]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/CHANGELOG.md -[homepage]: https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto deleted file mode 100644 index 3624e8b2ddd..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupdr.proto +++ /dev/null @@ -1,844 +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.backupdr.v1; - -import "google/api/annotations.proto"; -import "google/api/client.proto"; -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/backupdr/v1/backupplan.proto"; -import "google/cloud/backupdr/v1/backupplanassociation.proto"; -import "google/cloud/backupdr/v1/backupvault.proto"; -import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; -import "google/cloud/backupdr/v1/datasourcereference.proto"; -import "google/longrunning/operations.proto"; -import "google/protobuf/empty.proto"; -import "google/protobuf/timestamp.proto"; -import "google/protobuf/wrappers.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupDRProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; - -// The BackupDR Service -service BackupDR { - option (google.api.default_host) = "backupdr.googleapis.com"; - option (google.api.oauth_scopes) = - "https://www.googleapis.com/auth/cloud-platform"; - - // Lists ManagementServers in a given project and location. - rpc ListManagementServers(ListManagementServersRequest) - returns (ListManagementServersResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/managementServers" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a single ManagementServer. - rpc GetManagementServer(GetManagementServerRequest) - returns (ManagementServer) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/managementServers/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Creates a new ManagementServer in a given project and location. - rpc CreateManagementServer(CreateManagementServerRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/managementServers" - body: "management_server" - }; - option (google.api.method_signature) = - "parent,management_server,management_server_id"; - option (google.longrunning.operation_info) = { - response_type: "ManagementServer" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a single ManagementServer. - rpc DeleteManagementServer(DeleteManagementServerRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/managementServers/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Creates a new BackupVault in a given project and location. - rpc CreateBackupVault(CreateBackupVaultRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/backupVaults" - body: "backup_vault" - }; - option (google.api.method_signature) = - "parent,backup_vault,backup_vault_id"; - option (google.longrunning.operation_info) = { - response_type: "BackupVault" - metadata_type: "OperationMetadata" - }; - } - - // Lists BackupVaults in a given project and location. - rpc ListBackupVaults(ListBackupVaultsRequest) - returns (ListBackupVaultsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/backupVaults" - }; - option (google.api.method_signature) = "parent"; - } - - // FetchUsableBackupVaults lists usable BackupVaults in a given project and - // location. Usable BackupVault are the ones that user has - // backupdr.backupVaults.get permission. - rpc FetchUsableBackupVaults(FetchUsableBackupVaultsRequest) - returns (FetchUsableBackupVaultsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a BackupVault. - rpc GetBackupVault(GetBackupVaultRequest) returns (BackupVault) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backupVaults/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the settings of a BackupVault. - rpc UpdateBackupVault(UpdateBackupVaultRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}" - body: "backup_vault" - }; - option (google.api.method_signature) = "backup_vault,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "BackupVault" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a BackupVault. - rpc DeleteBackupVault(DeleteBackupVaultRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/backupVaults/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Lists DataSources in a given project and location. - rpc ListDataSources(ListDataSourcesRequest) - returns (ListDataSourcesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" - }; - option (google.api.method_signature) = "parent"; - } - - // Gets details of a DataSource. - rpc GetDataSource(GetDataSourceRequest) returns (DataSource) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the settings of a DataSource. - rpc UpdateDataSource(UpdateDataSourceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}" - body: "data_source" - }; - option (google.api.method_signature) = "data_source,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "DataSource" - metadata_type: "OperationMetadata" - }; - } - - // Lists Backups in a given project and location. - rpc ListBackups(ListBackupsRequest) returns (ListBackupsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetch Backups for a given resource type. - rpc FetchBackupsForResourceType(FetchBackupsForResourceTypeRequest) - returns (FetchBackupsForResourceTypeResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType" - }; - option (google.api.method_signature) = "parent,resource_type"; - } - - // Gets details of a Backup. - rpc GetBackup(GetBackupRequest) returns (Backup) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Updates the settings of a Backup. - rpc UpdateBackup(UpdateBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" - body: "backup" - }; - option (google.api.method_signature) = "backup,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Deletes a Backup. - rpc DeleteBackup(DeleteBackupRequest) returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "Backup" - metadata_type: "OperationMetadata" - }; - } - - // Restore from a Backup - rpc RestoreBackup(RestoreBackupRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore" - body: "*" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "RestoreBackupResponse" - metadata_type: "OperationMetadata" - }; - } - - // Create a BackupPlan - rpc CreateBackupPlan(CreateBackupPlanRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/backupPlans" - body: "backup_plan" - }; - option (google.api.method_signature) = "parent,backup_plan,backup_plan_id"; - option (google.longrunning.operation_info) = { - response_type: "BackupPlan" - metadata_type: "OperationMetadata" - }; - } - - // Update a BackupPlan. - rpc UpdateBackupPlan(UpdateBackupPlanRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}" - body: "backup_plan" - }; - option (google.api.method_signature) = "backup_plan,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "BackupPlan" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single BackupPlan. - rpc GetBackupPlan(GetBackupPlanRequest) returns (BackupPlan) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backupPlans/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists BackupPlans in a given project and location. - rpc ListBackupPlans(ListBackupPlansRequest) - returns (ListBackupPlansResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/backupPlans" - }; - option (google.api.method_signature) = "parent"; - } - - // Deletes a single BackupPlan. - rpc DeleteBackupPlan(DeleteBackupPlanRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/backupPlans/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single BackupPlanRevision. - rpc GetBackupPlanRevision(GetBackupPlanRevisionRequest) - returns (BackupPlanRevision) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backupPlans/*/revisions/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists BackupPlanRevisions in a given project and location. - rpc ListBackupPlanRevisions(ListBackupPlanRevisionsRequest) - returns (ListBackupPlanRevisionsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*/backupPlans/*}/revisions" - }; - option (google.api.method_signature) = "parent"; - } - - // Create a BackupPlanAssociation - rpc CreateBackupPlanAssociation(CreateBackupPlanAssociationRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" - body: "backup_plan_association" - }; - option (google.api.method_signature) = - "parent,backup_plan_association,backup_plan_association_id"; - option (google.longrunning.operation_info) = { - response_type: "BackupPlanAssociation" - metadata_type: "OperationMetadata" - }; - } - - // Update a BackupPlanAssociation. - rpc UpdateBackupPlanAssociation(UpdateBackupPlanAssociationRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - patch: "/v1/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}" - body: "backup_plan_association" - }; - option (google.api.method_signature) = - "backup_plan_association,update_mask"; - option (google.longrunning.operation_info) = { - response_type: "BackupPlanAssociation" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single BackupPlanAssociation. - rpc GetBackupPlanAssociation(GetBackupPlanAssociationRequest) - returns (BackupPlanAssociation) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists BackupPlanAssociations in a given project and location. - rpc ListBackupPlanAssociations(ListBackupPlanAssociationsRequest) - returns (ListBackupPlanAssociationsResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" - }; - option (google.api.method_signature) = "parent"; - } - - // List BackupPlanAssociations for a given resource type. - rpc FetchBackupPlanAssociationsForResourceType( - FetchBackupPlanAssociationsForResourceTypeRequest) - returns (FetchBackupPlanAssociationsForResourceTypeResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType" - }; - option (google.api.method_signature) = "parent,resource_type"; - } - - // Deletes a single BackupPlanAssociation. - rpc DeleteBackupPlanAssociation(DeleteBackupPlanAssociationRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - delete: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" - }; - option (google.api.method_signature) = "name"; - option (google.longrunning.operation_info) = { - response_type: "google.protobuf.Empty" - metadata_type: "OperationMetadata" - }; - } - - // Triggers a new Backup. - rpc TriggerBackup(TriggerBackupRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup" - body: "*" - }; - option (google.api.method_signature) = "name,rule_id"; - option (google.longrunning.operation_info) = { - response_type: "BackupPlanAssociation" - metadata_type: "OperationMetadata" - }; - } - - // Gets details of a single DataSourceReference. - rpc GetDataSourceReference(GetDataSourceReferenceRequest) - returns (DataSourceReference) { - option (google.api.http) = { - get: "/v1/{name=projects/*/locations/*/dataSourceReferences/*}" - }; - option (google.api.method_signature) = "name"; - } - - // Lists DataSourceReferences for a given project and location. - rpc ListDataSourceReferences(ListDataSourceReferencesRequest) - returns (ListDataSourceReferencesResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/dataSourceReferences" - }; - option (google.api.method_signature) = "parent"; - } - - // Fetch DataSourceReferences for a given project, location and resource type. - rpc FetchDataSourceReferencesForResourceType( - FetchDataSourceReferencesForResourceTypeRequest) - returns (FetchDataSourceReferencesForResourceTypeResponse) { - option (google.api.http) = { - get: "/v1/{parent=projects/*/locations/*}/dataSourceReferences:fetchForResourceType" - }; - option (google.api.method_signature) = "parent,resource_type"; - } - - // Initializes the service related config for a project. - rpc InitializeService(InitializeServiceRequest) - returns (google.longrunning.Operation) { - option (google.api.http) = { - post: "/v1/{name=projects/*/locations/*/serviceConfig}:initialize" - body: "*" - }; - option (google.longrunning.operation_info) = { - response_type: "InitializeServiceResponse" - metadata_type: "OperationMetadata" - }; - } -} - -// Network configuration for ManagementServer instance. -message NetworkConfig { - // VPC peering modes supported by Cloud BackupDR. - enum PeeringMode { - // Peering mode not set. - PEERING_MODE_UNSPECIFIED = 0; - - // Connect using Private Service Access to the Management Server. Private - // services access provides an IP address range for multiple Google Cloud - // services, including Cloud BackupDR. - PRIVATE_SERVICE_ACCESS = 1; - } - - // Optional. The resource name of the Google Compute Engine VPC network to - // which the ManagementServer instance is connected. - string network = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The network connect mode of the ManagementServer instance. For - // this version, only PRIVATE_SERVICE_ACCESS is supported. - PeeringMode peering_mode = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// ManagementURI for the Management Server resource. -message ManagementURI { - // Output only. The ManagementServer AGM/RD WebUI URL. - string web_ui = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The ManagementServer AGM/RD API URL. - string api = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ManagementURI depending on the Workforce Identity i.e. either 1p or 3p. -message WorkforceIdentityBasedManagementURI { - // Output only. First party Management URI for Google Identities. - string first_party_management_uri = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Third party Management URI for External Identity Providers. - string third_party_management_uri = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// OAuth Client ID depending on the Workforce Identity i.e. either 1p or 3p, -message WorkforceIdentityBasedOAuth2ClientID { - // Output only. First party OAuth Client ID for Google Identities. - string first_party_oauth2_client_id = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Third party OAuth Client ID for External Identity Providers. - string third_party_oauth2_client_id = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// ManagementServer describes a single BackupDR ManagementServer instance. -message ManagementServer { - option (google.api.resource) = { - type: "backupdr.googleapis.com/ManagementServer" - pattern: "projects/{project}/locations/{location}/managementServers/{managementserver}" - plural: "managementServers" - singular: "managementServer" - }; - - // Type of backup service resource. - enum InstanceType { - // Instance type is not mentioned. - INSTANCE_TYPE_UNSPECIFIED = 0; - - // Instance for backup and restore management (i.e., AGM). - BACKUP_RESTORE = 1; - } - - // State of Management server instance. - enum InstanceState { - // State not set. - INSTANCE_STATE_UNSPECIFIED = 0; - - // The instance is being created. - CREATING = 1; - - // The instance has been created and is fully usable. - READY = 2; - - // The instance configuration is being updated. Certain kinds of updates - // may cause the instance to become unusable while the update is in - // progress. - UPDATING = 3; - - // The instance is being deleted. - DELETING = 4; - - // The instance is being repaired and may be unstable. - REPAIRING = 5; - - // Maintenance is being performed on this instance. - MAINTENANCE = 6; - - // The instance is experiencing an issue and might be unusable. You can get - // further details from the statusMessage field of Instance resource. - ERROR = 7; - } - - // Output only. Identifier. The resource name. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Optional. The description of the ManagementServer instance (2048 characters - // or less). - string description = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resource labels to represent user provided metadata. - // Labels currently defined: - // 1. migrate_from_go= - // If set to true, the MS is created in migration ready mode. - map labels = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time when the instance was created. - google.protobuf.Timestamp create_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the instance was updated. - google.protobuf.Timestamp update_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The type of the ManagementServer resource. - InstanceType type = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The hostname or ip address of the exposed AGM endpoints, used - // by clients to connect to AGM/RD graphical user interface and APIs. - ManagementURI management_uri = 11 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The hostnames of the exposed AGM endpoints for both types of - // user i.e. 1p and 3p, used to connect AGM/RM UI. - WorkforceIdentityBasedManagementURI workforce_identity_based_management_uri = - 16 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The ManagementServer state. - InstanceState state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. VPC networks to which the ManagementServer instance is connected. - // For this version, only a single network is supported. This field is - // optional if MS is created without PSA - repeated NetworkConfig networks = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Server specified ETag for the ManagementServer resource to - // prevent simultaneous updates from overwiting each other. - string etag = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The OAuth 2.0 client id is required to make API calls to the - // BackupDR instance API of this ManagementServer. This is the value that - // should be provided in the 'aud' field of the OIDC ID Token (see openid - // specification - // https://openid.net/specs/openid-connect-core-1_0.html#IDToken). - string oauth2_client_id = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The OAuth client IDs for both types of user i.e. 1p and 3p. - WorkforceIdentityBasedOAuth2ClientID - workforce_identity_based_oauth2_client_id = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The hostname or ip address of the exposed AGM endpoints, used - // by BAs to connect to BA proxy. - repeated string ba_proxy_uri = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - google.protobuf.BoolValue satisfies_pzs = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Reserved for future use. - bool satisfies_pzi = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for listing management servers. -message ListManagementServersRequest { - // Required. The project and location for which to retrieve management servers - // information, in the format 'projects/{project_id}/locations/{location}'. In - // Cloud BackupDR, locations map to Google Cloud regions, for example - // **us-central1**. To retrieve management servers for all locations, use "-" - // for the - // '{location}' value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/ManagementServer" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - optional string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - optional string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for listing management servers. -message ListManagementServersResponse { - // The list of ManagementServer instances in the project for the specified - // location. - // - // If the '{location}' value in the request is "-", the response contains a - // list of instances from all locations. In case any location is unreachable, - // the response will only return management servers in reachable locations and - // the 'unreachable' field will be populated with a list of unreachable - // locations. - repeated ManagementServer management_servers = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for getting a management server instance. -message GetManagementServerRequest { - // Required. Name of the management server resource name, in the format - // 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/ManagementServer" - } - ]; -} - -// Request message for creating a management server instance. -message CreateManagementServerRequest { - // Required. The management server project and location in the format - // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - // locations map to Google Cloud regions, for example **us-central1**. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/ManagementServer" - } - ]; - - // Required. The name of the management server to create. The name must be - // unique for the specified project and location. - string management_server_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. A [management server - // resource][google.cloud.backupdr.v1.ManagementServer] - ManagementServer management_server = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for deleting a management server instance. -message DeleteManagementServerRequest { - // Required. Name of the resource - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/ManagementServer" - } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for initializing the service. -message InitializeServiceRequest { - // Required. The resource name of the serviceConfig used to initialize the - // service. Format: - // `projects/{project_id}/locations/{location}/serviceConfig`. - string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource type to which the default service config will be - // applied. Examples include, "compute.googleapis.com/Instance" and - // "storage.googleapis.com/Bucket". - string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // The configuration for initializing the resource. - oneof initialization_config { - // Optional. The configuration for initializing a Cloud SQL instance. - CloudSqlInstanceInitializationConfig - cloud_sql_instance_initialization_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - } -} - -// Response message for initializing the service. -message InitializeServiceResponse { - // The resource name of the default `BackupVault` created. - // Format: - // `projects/{project_id}/locations/{location}/backupVaults/{backup_vault_id}`. - string backup_vault_name = 1; - - // The resource name of the default `BackupPlan` created. - // Format: - // `projects/{project_id}/locations/{location}/backupPlans/{backup_plan_id}`. - string backup_plan_name = 2; -} - -// Represents the metadata of the long-running operation. -message OperationMetadata { - // Output only. The time the operation was created. - google.protobuf.Timestamp create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time the operation finished running. - google.protobuf.Timestamp end_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Server-defined resource path for the target of the operation. - string target = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Name of the verb executed by the operation. - string verb = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Human-readable status of the operation, if any. - string status_message = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Identifies whether the user has requested cancellation - // of the operation. Operations that have successfully been cancelled - // have - // [google.longrunning.Operation.error][google.longrunning.Operation.error] - // value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, - // corresponding to 'Code.CANCELLED'. - bool requested_cancellation = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. API version used to start the operation. - string api_version = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. AdditionalInfo contains additional Info related to backup plan - // association resource. - map additional_info = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto deleted file mode 100644 index 0e88524f3b2..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplan.proto +++ /dev/null @@ -1,622 +0,0 @@ -// Copyright 2025 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -syntax = "proto3"; - -package google.cloud.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/type/dayofweek.proto"; -import "google/type/month.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupPlanProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; - -// A `BackupPlan` specifies some common fields, such as `description` as well -// as one or more `BackupRule` messages. Each `BackupRule` has a retention -// policy and defines a schedule by which the system is to perform backup -// workloads. -message BackupPlan { - option (google.api.resource) = { - type: "backupdr.googleapis.com/BackupPlan" - pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}" - plural: "backupPlans" - singular: "backupPlan" - }; - - // `State` enumerates the possible states for a `BackupPlan`. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // The resource is being created. - CREATING = 1; - - // The resource has been created and is fully usable. - ACTIVE = 2; - - // The resource is being deleted. - DELETING = 3; - - // The resource has been created but is not usable. - INACTIVE = 4; - - // The resource is being updated. - UPDATING = 5; - } - - // Output only. Identifier. The resource name of the `BackupPlan`. - // - // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Optional. The description of the `BackupPlan` resource. - // - // The description allows for additional details about `BackupPlan` and its - // use cases to be provided. An example description is the following: "This - // is a backup plan that performs a daily backup at 6pm and retains data for 3 - // months". The description must be at most 2048 characters. - string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This collection of key/value pairs allows for custom labels to be - // supplied by the user. Example, {"tag": "Weekly"}. - map labels = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. When the `BackupPlan` was created. - google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. When the `BackupPlan` was last updated. - google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The backup rules for this `BackupPlan`. There must be at least - // one `BackupRule` message. - repeated BackupRule backup_rules = 6 [(google.api.field_behavior) = REQUIRED]; - - // Output only. The `State` for the `BackupPlan`. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The resource type to which the `BackupPlan` will be applied. - // Examples include, "compute.googleapis.com/Instance", - // "sqladmin.googleapis.com/Instance", "alloydb.googleapis.com/Cluster", - // "compute.googleapis.com/Disk". - string resource_type = 8 [(google.api.field_behavior) = REQUIRED]; - - // Optional. `etag` is returned from the service in the response. As a user of - // the service, you may provide an etag value in this field to prevent stale - // resources. - string etag = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Required. Resource name of backup vault which will be used as storage - // location for backups. Format: - // projects/{project}/locations/{location}/backupVaults/{backupvault} - string backup_vault = 10 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupVault" - } - ]; - - // Output only. The Google Cloud Platform Service Account to be used by the - // BackupVault for taking backups. Specify the email address of the Backup - // Vault Service Account. - string backup_vault_service_account = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Applicable only for CloudSQL resource_type. - // - // Configures how long logs will be stored. It is defined in “days”. This - // value should be greater than or equal to minimum enforced log retention - // duration of the backup vault. - int64 log_retention_days = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. All resource types to which backupPlan can be applied. - repeated string supported_resource_types = 13 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The user friendly revision ID of the `BackupPlanRevision`. - // - // Example: v0, v1, v2, etc. - string revision_id = 14 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource id of the `BackupPlanRevision`. - // - // Format: - // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}` - string revision_name = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// `BackupRule` binds the backup schedule to a retention policy. -message BackupRule { - // Required. Immutable. The unique id of this `BackupRule`. The `rule_id` is - // unique per `BackupPlan`.The `rule_id` must start with a lowercase letter - // followed by up to 62 lowercase letters, numbers, or hyphens. Pattern, - // /[a-z][a-z0-9-]{,62}/. - string rule_id = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.field_behavior) = IMMUTABLE - ]; - - // Required. Configures the duration for which backup data will be kept. It is - // defined in “days”. The value should be greater than or equal to minimum - // enforced retention of the backup vault. - // - // Minimum value is 1 and maximum value is 36159 for custom retention - // on-demand backup. - // Minimum and maximum values are workload specific for all other rules. - int32 backup_retention_days = 4 [(google.api.field_behavior) = REQUIRED]; - - // The schedule that defines the automated backup workloads for this - // `BackupRule`. - oneof backup_schedule_oneof { - // Optional. Defines a schedule that runs within the confines of a defined - // window of time. - StandardSchedule standard_schedule = 5 - [(google.api.field_behavior) = OPTIONAL]; - } -} - -// `StandardSchedule` defines a schedule that run within the confines of a -// defined window of days. We can define recurrence type for schedule as -// HOURLY, DAILY, WEEKLY, MONTHLY or YEARLY. -message StandardSchedule { - // `RecurrenceTypes` enumerates the applicable periodicity for the schedule. - enum RecurrenceType { - // recurrence type not set - RECURRENCE_TYPE_UNSPECIFIED = 0; - - // The `BackupRule` is to be applied hourly. - HOURLY = 1; - - // The `BackupRule` is to be applied daily. - DAILY = 2; - - // The `BackupRule` is to be applied weekly. - WEEKLY = 3; - - // The `BackupRule` is to be applied monthly. - MONTHLY = 4; - - // The `BackupRule` is to be applied yearly. - YEARLY = 5; - } - - // Required. Specifies the `RecurrenceType` for the schedule. - RecurrenceType recurrence_type = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Specifies frequency for hourly backups. A hourly frequency of 2 - // means jobs will run every 2 hours from start time till end time defined. - // - // This is required for `recurrence_type`, `HOURLY` and is not applicable - // otherwise. A validation error will occur if a value is supplied and - // `recurrence_type` is not `HOURLY`. - // - // Value of hourly frequency should be between 4 and 23. - // - // Reason for limit : We found that there is bandwidth limitation of 3GB/S for - // GMI while taking a backup and 5GB/S while doing a restore. Given the amount - // of parallel backups and restore we are targeting, this will potentially - // take the backup time to mins and hours (in worst case scenario). - int32 hourly_frequency = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies days of week like, MONDAY or TUESDAY, on which jobs - // will run. - // - // This is required for `recurrence_type`, `WEEKLY` and is not applicable - // otherwise. A validation error will occur if a value is supplied and - // `recurrence_type` is not `WEEKLY`. - repeated google.type.DayOfWeek days_of_week = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies days of months like 1, 5, or 14 on which jobs will run. - // - // Values for `days_of_month` are only applicable for `recurrence_type`, - // `MONTHLY` and `YEARLY`. A validation error will occur if other values are - // supplied. - repeated int32 days_of_month = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies a week day of the month like, FIRST SUNDAY or LAST - // MONDAY, on which jobs will run. This will be specified by two fields in - // `WeekDayOfMonth`, one for the day, e.g. `MONDAY`, and one for the week, - // e.g. `LAST`. - // - // This field is only applicable for `recurrence_type`, `MONTHLY` and - // `YEARLY`. A validation error will occur if other values are supplied. - WeekDayOfMonth week_day_of_month = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the months of year, like `FEBRUARY` and/or `MAY`, on - // which jobs will run. - // - // This field is only applicable when `recurrence_type` is `YEARLY`. A - // validation error will occur if other values are supplied. - repeated google.type.Month months = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Required. A BackupWindow defines the window of day during which backup jobs - // will run. Jobs are queued at the beginning of the window and will be marked - // as `NOT_RUN` if they do not start by the end of the window. - // - // Note: running jobs will not be cancelled at the end of the window. - BackupWindow backup_window = 7 [(google.api.field_behavior) = REQUIRED]; - - // Required. The time zone to be used when interpreting the schedule. - // The value of this field must be a time zone name from the IANA tz database. - // See https://en.wikipedia.org/wiki/List_of_tz_database_time_zones for the - // list of valid timezone names. For e.g., Europe/Paris. - string time_zone = 8 [(google.api.field_behavior) = REQUIRED]; -} - -// `BackupWindow` defines a window of the day during which backup jobs will run. -message BackupWindow { - // Required. The hour of day (0-23) when the window starts for e.g. if value - // of start hour of day is 6 that mean backup window start at 6:00. - int32 start_hour_of_day = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The hour of day (1-24) when the window end for e.g. if value of - // end hour of day is 10 that mean backup window end time is 10:00. - // - // End hour of day should be greater than start hour of day. - // 0 <= start_hour_of_day < end_hour_of_day <= 24 - // - // End hour of day is not include in backup window that mean if - // end_hour_of_day= 10 jobs should start before 10:00. - int32 end_hour_of_day = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// `WeekDayOfMonth` defines the week day of the month on which the backups will -// run. The message combines a `WeekOfMonth` and `DayOfWeek` to produce values -// like `FIRST`/`MONDAY` or `LAST`/`FRIDAY`. -message WeekDayOfMonth { - // `WeekOfMonth` enumerates possible weeks in the month, e.g. the first, - // third, or last week of the month. - enum WeekOfMonth { - // The zero value. Do not use. - WEEK_OF_MONTH_UNSPECIFIED = 0; - - // The first week of the month. - FIRST = 1; - - // The second week of the month. - SECOND = 2; - - // The third week of the month. - THIRD = 3; - - // The fourth week of the month. - FOURTH = 4; - - // The last week of the month. - LAST = 5; - } - - // Required. Specifies the week of the month. - WeekOfMonth week_of_month = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Specifies the day of the week. - google.type.DayOfWeek day_of_week = 2 - [(google.api.field_behavior) = REQUIRED]; -} - -// The request message for creating a `BackupPlan`. -message CreateBackupPlanRequest { - // Required. The `BackupPlan` project and location in the format - // `projects/{project}/locations/{location}`. In Cloud BackupDR locations - // map to GCP regions, for example **us-central1**. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupPlan" - } - ]; - - // Required. The name of the `BackupPlan` to create. The name must be unique - // for the specified project and location.The name must start with a lowercase - // letter followed by up to 62 lowercase letters, numbers, or hyphens. - // Pattern, /[a-z][a-z0-9-]{,62}/. - string backup_plan_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The `BackupPlan` resource object to create. - BackupPlan backup_plan = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// The request message for getting a list `BackupPlan`. -message ListBackupPlansRequest { - // Required. The project and location for which to retrieve `BackupPlans` - // information. Format: `projects/{project}/locations/{location}`. In Cloud - // BackupDR, locations map to GCP regions, for e.g. **us-central1**. To - // retrieve backup plans for all locations, use "-" for the - // `{location}` value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupPlan" - } - ]; - - // Optional. The maximum number of `BackupPlans` to return in a single - // response. If not specified, a default value will be chosen by the service. - // Note that the response may include a partial list and a caller should - // only rely on the response's - // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] - // to determine if there are more instances left to be queried. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value of - // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] - // received from a previous `ListBackupPlans` call. - // Provide this to retrieve the subsequent page in a multi-page list of - // results. When paginating, all other parameters provided to - // `ListBackupPlans` must match the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field match expression used to filter the results. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Field by which to sort the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for getting a list of `BackupPlan`. -message ListBackupPlansResponse { - // The list of `BackupPlans` in the project for the specified - // location. - // - // If the `{location}` value in the request is "-", the response contains a - // list of resources from all locations. In case any location is unreachable, - // the response will only return backup plans in reachable locations and - // the 'unreachable' field will be populated with a list of unreachable - // locations. - // BackupPlan - repeated BackupPlan backup_plans = 1; - - // A token which may be sent as - // [page_token][google.cloud.backupdr.v1.ListBackupPlansRequest.page_token] in - // a subsequent `ListBackupPlans` call to retrieve the next page of results. - // If this field is omitted or empty, then there are no more results to - // return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// The request message for getting a `BackupPlan`. -message GetBackupPlanRequest { - // Required. The resource name of the `BackupPlan` to retrieve. - // - // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlan" - } - ]; -} - -// The request message for deleting a `BackupPlan`. -message DeleteBackupPlanRequest { - // Required. The resource name of the `BackupPlan` to delete. - // - // Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlan" - } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for updating a backup plan. -message UpdateBackupPlanRequest { - // Required. The resource being updated - BackupPlan backup_plan = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - // Field mask is used to specify the fields to be overwritten in the - // BackupPlan resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then the request will fail. - // Currently, these fields are supported in update: description, schedules, - // retention period, adding and removing Backup Rules. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// `BackupPlanRevision` represents a snapshot of a `BackupPlan` at a point in -// time. -message BackupPlanRevision { - option (google.api.resource) = { - type: "backupdr.googleapis.com/BackupPlanRevision" - pattern: "projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}" - plural: "backupPlanRevisions" - singular: "backupPlanRevision" - }; - - // The state of the `BackupPlanRevision`. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // The resource is being created. - CREATING = 1; - - // The resource has been created and is fully usable. - ACTIVE = 2; - - // The resource is being deleted. - DELETING = 3; - - // The resource has been created but is not usable. - INACTIVE = 4; - } - - // Output only. Identifier. The resource name of the `BackupPlanRevision`. - // - // Format: - // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Output only. The user friendly revision ID of the `BackupPlanRevision`. - // - // Example: v0, v1, v2, etc. - string revision_id = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Resource State - State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The Backup Plan being encompassed by this revision. - BackupPlan backup_plan_snapshot = 4; - - // Output only. The timestamp that the revision was created. - google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The request message for getting a `BackupPlanRevision`. -message GetBackupPlanRevisionRequest { - // Required. The resource name of the `BackupPlanRevision` to retrieve. - // - // Format: - // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlanRevision" - } - ]; -} - -// The request message for getting a list of `BackupPlanRevision`. -message ListBackupPlanRevisionsRequest { - // Required. The project and location for which to retrieve - // `BackupPlanRevisions` information. Format: - // `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In - // Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupPlanRevision" - } - ]; - - // Optional. The maximum number of `BackupPlans` to return in a single - // response. If not specified, a default value will be chosen by the service. - // Note that the response may include a partial list and a caller should - // only rely on the response's - // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] - // to determine if there are more instances left to be queried. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The value of - // [next_page_token][google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token] - // received from a previous `ListBackupPlans` call. - // Provide this to retrieve the subsequent page in a multi-page list of - // results. When paginating, all other parameters provided to - // `ListBackupPlans` must match the call that provided the page token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// The response message for getting a list of `BackupPlanRevision`. -message ListBackupPlanRevisionsResponse { - // The list of `BackupPlanRevisions` in the project for the specified - // location. - // - // If the `{location}` value in the request is "-", the response contains a - // list of resources from all locations. In case any location is unreachable, - // the response will only return backup plans in reachable locations and - // the 'unreachable' field will be populated with a list of unreachable - // locations. - repeated BackupPlanRevision backup_plan_revisions = 1; - - // A token which may be sent as - // [page_token][google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.page_token] - // in a subsequent `ListBackupPlanRevisions` call to retrieve the next page of - // results. If this field is omitted or empty, then there are no more results - // to return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto deleted file mode 100644 index 2f97b4c8c17..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupplanassociation.proto +++ /dev/null @@ -1,436 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupPlanAssociationProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; - -// A BackupPlanAssociation represents a single BackupPlanAssociation which -// contains details like workload, backup plan etc -message BackupPlanAssociation { - option (google.api.resource) = { - type: "backupdr.googleapis.com/BackupPlanAssociation" - pattern: "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}" - plural: "backupPlanAssociations" - singular: "backupPlanAssociation" - }; - - // Enum for State of BackupPlan Association - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // The resource is being created. - CREATING = 1; - - // The resource has been created and is fully usable. - ACTIVE = 2; - - // The resource is being deleted. - DELETING = 3; - - // The resource has been created but is not usable. - INACTIVE = 4; - - // The resource is being updated. - UPDATING = 5; - } - - // Output only. Identifier. The resource name of BackupPlanAssociation in - // below format Format : - // projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId} - string name = 1 [ - (google.api.field_behavior) = IDENTIFIER, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Required. Immutable. Resource type of workload on which backupplan is - // applied - string resource_type = 2 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Immutable. Resource name of workload on which the backup plan is - // applied. - // - // The format can either be the resource name (e.g., - // "projects/my-project/zones/us-central1-a/instances/my-instance") or the - // full resource URI (e.g., - // "https://www.googleapis.com/compute/v1/projects/my-project/zones/us-central1-a/instances/my-instance"). - string resource = 3 [ - (google.api.field_behavior) = IMMUTABLE, - (google.api.field_behavior) = REQUIRED - ]; - - // Required. Resource name of backup plan which needs to be applied on - // workload. Format: - // projects/{project}/locations/{location}/backupPlans/{backupPlanId} - string backup_plan = 4 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlan" - } - ]; - - // Output only. The time when the instance was created. - google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the instance was updated. - google.protobuf.Timestamp update_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The BackupPlanAssociation resource state. - State state = 7 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The config info related to backup rules. - repeated RuleConfigInfo rules_config_info = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Resource name of data source which will be used as storage - // location for backups taken. Format : - // projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource} - string data_source = 9 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Properties of the protected GCP resource. - oneof resource_properties { - // Output only. Cloud SQL instance's backup plan association properties. - CloudSqlInstanceBackupPlanAssociationProperties - cloud_sql_instance_backup_plan_association_properties = 10 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. The user friendly revision ID of the `BackupPlanRevision`. - // - // Example: v0, v1, v2, etc. - string backup_plan_revision_id = 11 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The resource id of the `BackupPlanRevision`. - // - // Format: - // `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision_id}` - string backup_plan_revision_name = 12 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Message for rules config info. -message RuleConfigInfo { - // Enum for LastBackupState - enum LastBackupState { - // State not set. - LAST_BACKUP_STATE_UNSPECIFIED = 0; - - // The first backup is pending. - FIRST_BACKUP_PENDING = 1; - - // The most recent backup could not be run/failed because of the lack of - // permissions. - PERMISSION_DENIED = 2; - - // The last backup operation succeeded. - SUCCEEDED = 3; - - // The last backup operation failed. - FAILED = 4; - } - - // Output only. Backup Rule id fetched from backup plan. - string rule_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The last backup state for rule. - LastBackupState last_backup_state = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. google.rpc.Status object to store the last backup error. - google.rpc.Status last_backup_error = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The point in time when the last successful backup was captured - // from the source. - google.protobuf.Timestamp last_successful_backup_consistency_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for creating a backup plan. -message CreateBackupPlanAssociationRequest { - // Required. The backup plan association project and location in the format - // `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations - // map to GCP regions, for example **us-central1**. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupPlanAssociation" - } - ]; - - // Required. The name of the backup plan association to create. The name must - // be unique for the specified project and location. - string backup_plan_association_id = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - BackupPlanAssociation backup_plan_association = 3 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for List BackupPlanAssociation -message ListBackupPlanAssociationsRequest { - // Required. The project and location for which to retrieve backup Plan - // Associations information, in the format - // `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations - // map to GCP regions, for example **us-central1**. To retrieve backup plan - // associations for all locations, use "-" for the - // `{location}` value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupPlanAssociation" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for List BackupPlanAssociation -message ListBackupPlanAssociationsResponse { - // The list of Backup Plan Associations in the project for the specified - // location. - // - // If the `{location}` value in the request is "-", the response contains a - // list of instances from all locations. In case any location is unreachable, - // the response will only return backup plan associations in reachable - // locations and the 'unreachable' field will be populated with a list of - // unreachable locations. - repeated BackupPlanAssociation backup_plan_associations = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for the FetchBackupPlanAssociationsForResourceType method. -message FetchBackupPlanAssociationsForResourceTypeRequest { - // Required. The parent resource name. - // Format: projects/{project}/locations/{location} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupPlanAssociation" - } - ]; - - // Required. The type of the GCP resource. - // Ex: sql.googleapis.com/Instance - string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The maximum number of BackupPlanAssociations to return. The - // service may return fewer than this value. If unspecified, at most 50 - // BackupPlanAssociations will be returned. The maximum value is 100; values - // above 100 will be coerced to 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous call of - // `FetchBackupPlanAssociationsForResourceType`. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `FetchBackupPlanAssociationsForResourceType` must match - // the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter expression that filters the results fetched in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. Supported - // fields: - // * resource - // * backup_plan - // * state - // * data_source - // * cloud_sql_instance_backup_plan_association_properties.instance_create_time - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A comma-separated list of fields to order by, sorted in ascending - // order. Use "desc" after a field name for descending. - // - // Supported fields: - // * name - string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the FetchBackupPlanAssociationsForResourceType method. -message FetchBackupPlanAssociationsForResourceTypeResponse { - // Output only. The BackupPlanAssociations from the specified parent. - repeated BackupPlanAssociation backup_plan_associations = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // 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 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Request message for getting a BackupPlanAssociation resource. -message GetBackupPlanAssociationRequest { - // Required. Name of the backup plan association resource, in the format - // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlanAssociation" - } - ]; -} - -// Request message for deleting a backup plan association. -message DeleteBackupPlanAssociationRequest { - // Required. Name of the backup plan association resource, in the format - // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlanAssociation" - } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for updating a backup plan association. -message UpdateBackupPlanAssociationRequest { - // Required. The resource being updated - BackupPlanAssociation backup_plan_association = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The list of fields to update. - // Field mask is used to specify the fields to be overwritten in the - // BackupPlanAssociation resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then the request will fail. - // Currently backup_plan_association.backup_plan is the only supported field. - google.protobuf.FieldMask update_mask = 2 - [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and t - // he request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for triggering a backup. -message TriggerBackupRequest { - // Required. Name of the backup plan association resource, in the format - // `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlanAssociation" - } - ]; - - // Required. backup rule_id for which a backup needs to be triggered. - string rule_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto deleted file mode 100644 index 8e82cbdb878..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault.proto +++ /dev/null @@ -1,1390 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; -import "google/api/resource.proto"; -import "google/cloud/backupdr/v1/backupvault_ba.proto"; -import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; -import "google/cloud/backupdr/v1/backupvault_disk.proto"; -import "google/cloud/backupdr/v1/backupvault_gce.proto"; -import "google/protobuf/duration.proto"; -import "google/protobuf/field_mask.proto"; -import "google/protobuf/timestamp.proto"; -import "google/rpc/status.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupVaultProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKey" - pattern: "projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key}" -}; -option (google.api.resource_definition) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - pattern: "projects/{project}/locations/{location}/keyRings/{key_ring}/cryptoKeys/{crypto_key}/cryptoKeyVersions/{crypto_key_version}" -}; - -// Message describing a BackupVault object. -message BackupVault { - option (google.api.resource) = { - type: "backupdr.googleapis.com/BackupVault" - pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}" - plural: "backupVaults" - singular: "backupVault" - }; - - // How a backup's enforced retention end time is inherited. - enum BackupRetentionInheritance { - // Inheritance behavior not set. This will default to - // `INHERIT_VAULT_RETENTION`. - BACKUP_RETENTION_INHERITANCE_UNSPECIFIED = 0; - - // The enforced retention end time of a backup will be inherited from the - // backup vault's `backup_minimum_enforced_retention_duration` field. - // - // This is the default behavior. - INHERIT_VAULT_RETENTION = 1; - - // The enforced retention end time of a backup will always match the expire - // time of the backup. - // - // If this is set, the backup's enforced retention end time will be set to - // match the expire time during creation of the backup. When updating, the - // ERET and expire time must be updated together and have the same value. - // Invalid update requests will be rejected by the server. - MATCH_BACKUP_EXPIRE_TIME = 2; - } - - // Holds the state of the backup vault resource. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // The backup vault is being created. - CREATING = 1; - - // The backup vault has been created and is fully usable. - ACTIVE = 2; - - // The backup vault is being deleted. - DELETING = 3; - - // The backup vault is experiencing an issue and might be unusable. - ERROR = 4; - - // The backup vault is being updated. - UPDATING = 5; - } - - // Holds the access restriction for the backup vault. - enum AccessRestriction { - // Access restriction not set. If user does not provide any value or pass - // this value, it will be changed to WITHIN_ORGANIZATION. - ACCESS_RESTRICTION_UNSPECIFIED = 0; - - // Access to or from resources outside your current project will be denied. - WITHIN_PROJECT = 1; - - // Access to or from resources outside your current organization will be - // denied. - WITHIN_ORGANIZATION = 2; - - // No access restriction. - UNRESTRICTED = 3; - - // Access to or from resources outside your current organization will be - // denied except for backup appliance. - WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4; - } - - // Message describing the EncryptionConfig of backup vault. - // This determines how data within the vault is encrypted at rest. - message EncryptionConfig { - // Optional. The Cloud KMS key name to encrypt backups in this backup vault. - // Must be in the same region as the vault. Some workload backups like - // compute disk backups may use their inherited source key instead. Format: - // projects/{project}/locations/{location}/keyRings/{ring}/cryptoKeys/{key} - optional string kms_key_name = 1 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKey" - } - ]; - } - - // Output only. Identifier. Name of the backup vault to create. It must have - // the - // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}"`. - // `{backupvault}` cannot be changed after creation. It must be between 3-63 - // characters long and must be unique within the project and location. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Optional. The description of the BackupVault instance (2048 characters or - // less). - optional string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resource labels to represent user provided metadata. - // No labels currently defined: - map labels = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time when the instance was created. - optional google.protobuf.Timestamp create_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the instance was updated. - optional google.protobuf.Timestamp update_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Required. The default and minimum enforced retention for each backup within - // the backup vault. The enforced retention for each backup can be extended. - optional google.protobuf.Duration backup_minimum_enforced_retention_duration = - 20 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Setting for how a backup's enforced retention end time is - // inherited. - optional BackupRetentionInheritance backup_retention_inheritance = 27 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Set to true when there are no backups nested under this - // resource. - optional bool deletable = 8 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Server specified ETag for the backup vault resource to - // prevent simultaneous updates from overwiting each other. - optional string etag = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The BackupVault resource instance state. - State state = 10 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Time after which the BackupVault resource is locked. - optional google.protobuf.Timestamp effective_time = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The number of backups in this backup vault. - int64 backup_count = 17 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Service account used by the BackupVault Service for this - // BackupVault. The user should grant this account permissions in their - // workload project to enable the service to run backups and restores there. - string service_account = 18 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Total size of the storage used by all backup resources. - int64 total_stored_bytes = 19 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Immutable after resource creation until resource deletion. - string uid = 21 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Optional. User annotations. See https://google.aip.dev/128#annotations - // Stores small amounts of arbitrary data. - map annotations = 22 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Note: This field is added for future use case and will not be - // supported in the current release. - // - // Access restriction for the backup vault. - // Default value is WITHIN_ORGANIZATION if not provided during creation. - AccessRestriction access_restriction = 24 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The encryption config of the backup vault. - optional EncryptionConfig encryption_config = 29 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Message describing a DataSource object. -// Datasource object used to represent Datasource details for both admin and -// basic view. -message DataSource { - option (google.api.resource) = { - type: "backupdr.googleapis.com/DataSource" - pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}" - plural: "dataSources" - singular: "dataSource" - }; - - // Holds the state of the data source resource. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // The data source is being created. - CREATING = 1; - - // The data source has been created and is fully usable. - ACTIVE = 2; - - // The data source is being deleted. - DELETING = 3; - - // The data source is experiencing an issue and might be unusable. - ERROR = 4; - } - - // Output only. Identifier. Name of the datasource to create. - // It must have the - // format`"projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}"`. - // `{datasource}` cannot be changed after creation. It must be between 3-63 - // characters long and must be unique within the backup vault. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Output only. The DataSource resource instance state. - State state = 21 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Resource labels to represent user provided metadata. - // No labels currently defined: - map labels = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The time when the instance was created. - optional google.protobuf.Timestamp create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the instance was updated. - optional google.protobuf.Timestamp update_time = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Number of backups in the data source. - optional int64 backup_count = 7; - - // Server specified ETag for the ManagementServer resource to prevent - // simultaneous updates from overwiting each other. - optional string etag = 14; - - // The number of bytes (metadata and data) stored in this datasource. - optional int64 total_stored_bytes = 23; - - // Output only. The backup configuration state. - BackupConfigState config_state = 24 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Details of how the resource is configured for backup. - BackupConfigInfo backup_config_info = 25 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The source resource that is represented by this DataSource. It can be a - // Google Cloud resource, or one backed up by a Backup Appliance. - oneof source_resource { - // The backed up resource is a Google Cloud resource. - // The word 'DataSource' was included in the names to indicate that this is - // the representation of the Google Cloud resource used within the - // DataSource object. - DataSourceGcpResource data_source_gcp_resource = 26; - - // The backed up resource is a backup appliance application. - DataSourceBackupApplianceApplication - data_source_backup_appliance_application = 27; - } - - // Output only. This field is set to true if the backup is blocked by vault - // access restriction. - bool backup_blocked_by_vault_access_restriction = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// BackupConfigInfo has information about how the resource is configured -// for Backup and about the most recent backup to this vault. -message BackupConfigInfo { - // LastBackupstate tracks whether the last backup was not yet started, - // successful, failed, or could not be run because of the lack of permissions. - enum LastBackupState { - // Status not set. - LAST_BACKUP_STATE_UNSPECIFIED = 0; - - // The first backup has not yet completed - FIRST_BACKUP_PENDING = 1; - - // The most recent backup was successful - SUCCEEDED = 2; - - // The most recent backup failed - FAILED = 3; - - // The most recent backup could not be run/failed because of the lack of - // permissions - PERMISSION_DENIED = 4; - } - - // Output only. The status of the last backup to this BackupVault - LastBackupState last_backup_state = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If the last backup were successful, this field has the - // consistency date. - google.protobuf.Timestamp last_successful_backup_consistency_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. If the last backup failed, this field has the error message. - google.rpc.Status last_backup_error = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configuration Info has the resource format-specific configuration. - oneof backup_config { - // Configuration for a Google Cloud resource. - GcpBackupConfig gcp_backup_config = 4; - - // Configuration for an application backed up by a Backup Appliance. - BackupApplianceBackupConfig backup_appliance_backup_config = 5; - } -} - -// GcpBackupConfig captures the Backup configuration details for Google Cloud -// resources. All Google Cloud resources regardless of type are protected with -// backup plan associations. -message GcpBackupConfig { - // The name of the backup plan. - string backup_plan = 1 [(google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlan" - }]; - - // The description of the backup plan. - string backup_plan_description = 2; - - // The name of the backup plan association. - string backup_plan_association = 3 [(google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlanAssociation" - }]; - - // The names of the backup plan rules which point to this backupvault - repeated string backup_plan_rules = 4; - - // The name of the backup plan revision. - string backup_plan_revision_name = 5; - - // The user friendly id of the backup plan revision. - // E.g. v0, v1 etc. - string backup_plan_revision_id = 6; -} - -// BackupApplianceBackupConfig captures the backup configuration for -// applications that are protected by Backup Appliances. -message BackupApplianceBackupConfig { - // The name of the backup appliance. - string backup_appliance_name = 1; - - // The ID of the backup appliance. - int64 backup_appliance_id = 2; - - // The ID of the SLA of this application. - int64 sla_id = 3; - - // The name of the application. - string application_name = 4; - - // The name of the host where the application is running. - string host_name = 5; - - // The name of the SLT associated with the application. - string slt_name = 6; - - // The name of the SLP associated with the application. - string slp_name = 7; -} - -// DataSourceGcpResource is used for protected resources that are Google Cloud -// Resources. This name is easeier to understand than GcpResourceDataSource or -// GcpDataSourceResource -message DataSourceGcpResource { - // Output only. Full resource pathname URL of the source Google Cloud - // resource. - string gcp_resourcename = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Location of the resource: //"global"/"unspecified". - string location = 2; - - // The type of the Google Cloud resource. Use the Unified Resource Type, - // eg. compute.googleapis.com/Instance. - string type = 3; - - // gcp_Properties has properties of the Google Cloud Resource. - oneof gcp_resource_properties { - // ComputeInstanceDataSourceProperties has a subset of Compute Instance - // properties that are useful at the Datasource level. - ComputeInstanceDataSourceProperties compute_instance_datasource_properties = - 4; - - // Output only. CloudSqlInstanceDataSourceProperties has a subset of Cloud - // SQL Instance properties that are useful at the Datasource level. - CloudSqlInstanceDataSourceProperties - cloud_sql_instance_datasource_properties = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // DiskDataSourceProperties has a subset of Disk properties that are useful - // at the Datasource level. - DiskDataSourceProperties disk_datasource_properties = 7; - } -} - -// BackupApplianceApplication describes a Source Resource when it is an -// application backed up by a BackupAppliance. -message DataSourceBackupApplianceApplication { - // The name of the Application as known to the Backup Appliance. - string application_name = 1; - - // Appliance name. - string backup_appliance = 2; - - // Appliance Id of the Backup Appliance. - int64 appliance_id = 3; - - // The type of the application. e.g. VMBackup - string type = 4; - - // The appid field of the application within the Backup Appliance. - int64 application_id = 8; - - // Hostname of the host where the application is running. - string hostname = 6; - - // Hostid of the application host. - int64 host_id = 7; -} - -// ServiceLockInfo represents the details of a lock taken by the service on a -// Backup resource. -message ServiceLockInfo { - // Output only. The name of the operation that created this lock. - // The lock will automatically be released when the operation completes. - string operation = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// BackupApplianceLockInfo contains metadata about the backupappliance that -// created the lock. -message BackupApplianceLockInfo { - // Required. The ID of the backup/recovery appliance that created this lock. - int64 backup_appliance_id = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The name of the backup/recovery appliance that created this lock. - string backup_appliance_name = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The reason for the lock: e.g. MOUNT/RESTORE/BACKUP/etc. The - // value of this string is only meaningful to the client and it is not - // interpreted by the BackupVault service. - string lock_reason = 5 [(google.api.field_behavior) = REQUIRED]; - - // The information about this lock. - oneof lock_source { - // The job name on the backup/recovery appliance that created this lock. - string job_name = 6; - - // The image name that depends on this Backup. - string backup_image = 7; - - // The SLA on the backup/recovery appliance that owns the lock. - int64 sla_id = 8; - } -} - -// BackupLock represents a single lock on a Backup resource. An unexpired -// lock on a Backup prevents the Backup from being deleted. -message BackupLock { - // Required. The time after which this lock is not considered valid and will - // no longer protect the Backup from deletion. - google.protobuf.Timestamp lock_until_time = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Metadata about the owner and reason for the lock. - oneof ClientLockInfo { - // If the client is a backup and recovery appliance, this - // contains metadata about why the lock exists. - BackupApplianceLockInfo backup_appliance_lock_info = 3; - - // Output only. Contains metadata about the lock exist for Google Cloud - // native backups. - ServiceLockInfo service_lock_info = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} - -// Message describing a Backup object. -message Backup { - option (google.api.resource) = { - type: "backupdr.googleapis.com/Backup" - pattern: "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}" - plural: "backups" - singular: "backup" - }; - - // Holds the state of the backup resource. - enum State { - // State not set. - STATE_UNSPECIFIED = 0; - - // The backup is being created. - CREATING = 1; - - // The backup has been created and is fully usable. - ACTIVE = 2; - - // The backup is being deleted. - DELETING = 3; - - // The backup is experiencing an issue and might be unusable. - ERROR = 4; - - // The backup is being uploaded. - UPLOADING = 5; - } - - // Type of the backup, scheduled or ondemand. - enum BackupType { - // Backup type is unspecified. - BACKUP_TYPE_UNSPECIFIED = 0; - - // Scheduled backup. - SCHEDULED = 1; - - // On demand backup. - ON_DEMAND = 2; - - // Operational backup. - ON_DEMAND_OPERATIONAL = 3; - } - - // GCPBackupPlanInfo captures the plan configuration details of Google Cloud - // resources at the time of backup. - message GCPBackupPlanInfo { - // Resource name of backup plan by which workload is protected at the time - // of the backup. - // Format: - // projects/{project}/locations/{location}/backupPlans/{backupPlanId} - string backup_plan = 1 [(google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupPlan" - }]; - - // The rule id of the backup plan which triggered this backup in case of - // scheduled backup or used for - string backup_plan_rule_id = 2; - - // Resource name of the backup plan revision which triggered this backup in - // case of scheduled backup or used for on demand backup. - // Format: - // projects/{project}/locations/{location}/backupPlans/{backupPlanId}/revisions/{revisionId} - string backup_plan_revision_name = 3; - - // The user friendly id of the backup plan revision which triggered this - // backup in case of scheduled backup or used for on demand backup. - string backup_plan_revision_id = 4; - } - - // Output only. Identifier. Name of the backup to create. It must have the - // format`"projects//locations//backupVaults//dataSources/{datasource}/backups/{backup}"`. - // `{backup}` cannot be changed after creation. It must be between 3-63 - // characters long and must be unique within the datasource. - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = IDENTIFIER - ]; - - // Output only. The description of the Backup instance (2048 characters or - // less). - optional string description = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the instance was created. - optional google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when the instance was updated. - optional google.protobuf.Timestamp update_time = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Resource labels to represent user provided metadata. - // No labels currently defined. - map labels = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The backup can not be deleted before this time. - optional google.protobuf.Timestamp enforced_retention_end_time = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. Setting for how the enforced retention end time is inherited. - // This value is copied from this backup's BackupVault. - optional BackupVault.BackupRetentionInheritance backup_retention_inheritance = - 30 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. When this backup is automatically expired. - optional google.protobuf.Timestamp expire_time = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The point in time when this backup was captured from the - // source. - optional google.protobuf.Timestamp consistency_time = 9 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Server specified ETag to prevent updates from overwriting each - // other. - optional string etag = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Output only. The Backup resource instance state. - State state = 15 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The list of BackupLocks taken by the service to prevent the - // deletion of the backup. - repeated BackupLock service_locks = 17 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The list of BackupLocks taken by the accessor Backup Appliance. - repeated BackupLock backup_appliance_locks = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Workload specific backup properties. - oneof backup_properties { - // Output only. Compute Engine specific backup properties. - ComputeInstanceBackupProperties compute_instance_backup_properties = 19 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Cloud SQL specific backup properties. - CloudSqlInstanceBackupProperties cloud_sql_instance_backup_properties = 26 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Backup Appliance specific backup properties. - BackupApplianceBackupProperties backup_appliance_backup_properties = 21 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Disk specific backup properties. - DiskBackupProperties disk_backup_properties = 28 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. Type of the backup, unspecified, scheduled or ondemand. - BackupType backup_type = 20 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Configuration Info has the resource format-specific configuration. - oneof plan_info { - // Output only. Configuration for a Google Cloud resource. - GCPBackupPlanInfo gcp_backup_plan_info = 22 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Output only. source resource size in bytes at the time of the backup. - int64 resource_size_bytes = 23 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. Output only. Reserved for future use. - optional bool satisfies_pzs = 24 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Output only. Reserved for future use. - optional bool satisfies_pzi = 25 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.field_behavior) = OPTIONAL - ]; - - // Resource that is being backed up. - oneof source_resource { - // Output only. Unique identifier of the GCP resource that is being backed - // up. - BackupGcpResource gcp_resource = 31 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } - - // Optional. Output only. The list of KMS key versions used to encrypt the - // backup. - repeated string kms_key_versions = 33 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "cloudkms.googleapis.com/CryptoKeyVersion" - } - ]; -} - -// Message for creating a BackupVault. -message CreateBackupVaultRequest { - // Required. Value for parent. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupVault" - } - ]; - - // Required. ID of the requesting object - // If auto-generating ID server-side, remove this field and - // backup_vault_id from the method_signature of Create RPC - string backup_vault_id = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being created - BackupVault backup_vault = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 4 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Only validate the request, but do not perform mutations. - // The default is 'false'. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for listing backupvault stores. -message ListBackupVaultsRequest { - // Required. The project and location for which to retrieve backupvault stores - // information, in the format 'projects/{project_id}/locations/{location}'. In - // Cloud Backup and DR, locations map to Google Cloud regions, for example - // **us-central1**. - // To retrieve backupvault stores for all locations, use "-" for the - // '{location}' value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupVault" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Reserved for future use to provide a BASIC & FULL view of Backup - // Vault. - BackupVaultView view = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for listing BackupVaults. -message ListBackupVaultsResponse { - // The list of BackupVault instances in the project for the specified - // location. - // - // If the '{location}' value in the request is "-", the response contains a - // list of instances from all locations. In case any location is unreachable, - // the response will only return backup vaults in reachable locations and - // the 'unreachable' field will be populated with a list of unreachable - // locations. - repeated BackupVault backup_vaults = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for fetching usable BackupVaults. -message FetchUsableBackupVaultsRequest { - // Required. The project and location for which to retrieve backupvault stores - // information, in the format 'projects/{project_id}/locations/{location}'. In - // Cloud Backup and DR, locations map to Google Cloud regions, for example - // **us-central1**. - // To retrieve backupvault stores for all locations, use "-" for the - // '{location}' value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/BackupVault" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for fetching usable BackupVaults. -message FetchUsableBackupVaultsResponse { - // The list of BackupVault instances in the project for the specified - // location. - // - // If the '{location}' value in the request is "-", the response contains a - // list of instances from all locations. In case any location is unreachable, - // the response will only return backup vaults in reachable locations and - // the 'unreachable' field will be populated with a list of unreachable - // locations. - repeated BackupVault backup_vaults = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for the FetchBackupsForResourceType method. -message FetchBackupsForResourceTypeRequest { - // Required. Datasources are the parent resource for the backups. - // Format: - // projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/Backup" - } - ]; - - // Required. The type of the GCP resource. - // Ex: sqladmin.googleapis.com/Instance - string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The maximum number of Backups to return. The service may - // return fewer than this value. If unspecified, at most 50 - // Backups will be returned. The maximum value is 100; values - // above 100 will be coerced to 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous call of - // `FetchBackupsForResourceType`. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `FetchBackupsForResourceType` must match - // the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter expression that filters the results fetched in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. Supported - // fields: - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A comma-separated list of fields to order by, sorted in ascending - // order. Use "desc" after a field name for descending. - string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This parameter is used to specify the view of the backup. - // If not specified, the default view is BASIC. - BackupView view = 7 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the FetchBackupsForResourceType method. -message FetchBackupsForResourceTypeResponse { - // The Backups from the specified parent. - repeated Backup backups = 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; -} - -// Request message for getting a BackupVault. -message GetBackupVaultRequest { - // Required. Name of the backupvault store resource name, in the format - // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupVault" - } - ]; - - // Optional. Reserved for future use to provide a BASIC & FULL view of Backup - // Vault - BackupVaultView view = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for updating a BackupVault. -message UpdateBackupVaultRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // BackupVault resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then the request will fail. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being updated - BackupVault backup_vault = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Only validate the request, but do not perform mutations. - // The default is 'false'. - bool validate_only = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, will not check plan duration against backup vault - // enforcement duration. - bool force = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, we will force update access restriction even if - // some non compliant data sources are present. The default is 'false'. - bool force_update_access_restriction = 6 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Message for deleting a BackupVault. -message DeleteBackupVaultRequest { - // Required. Name of the resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/BackupVault" - } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. If set to true, any data source from this backup vault will also - // be deleted. - bool force = 3 [(google.api.field_behavior) = OPTIONAL]; - - // The current etag of the backup vault. - // If an etag is provided and does not match the current etag of the - // connection, deletion will be blocked. - string etag = 4; - - // Optional. Only validate the request, but do not perform mutations. - // The default is 'false'. - bool validate_only = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If true and the BackupVault is not found, the request will - // succeed but no action will be taken. - bool allow_missing = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. If set to true, backupvault deletion will proceed even if there - // are backup plans referencing the backupvault. The default is 'false'. - bool ignore_backup_plan_references = 7 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for listing DataSources. -message ListDataSourcesRequest { - // Required. The project and location for which to retrieve data - // sources information, in the format - // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - // locations map to Google Cloud regions, for example **us-central1**. - // To retrieve data sources for all locations, use "-" for the - // '{location}' value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/DataSource" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for listing DataSources. -message ListDataSourcesResponse { - // The list of DataSource instances in the project for the specified - // location. - // - // If the '{location}' value in the request is "-", the response contains a - // list of instances from all locations. In case any location is unreachable, - // the response will only return data sources in reachable locations - // and the 'unreachable' field will be populated with a list of unreachable - // locations. - repeated DataSource data_sources = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for getting a DataSource instance. -message GetDataSourceRequest { - // Required. Name of the data source resource name, in the format - // 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/DataSource" - } - ]; -} - -// Request message for updating a data source instance. -message UpdateDataSourceRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // DataSource resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then the request will fail. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being updated - DataSource data_source = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Enable upsert. - bool allow_missing = 4 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for listing Backups. -message ListBackupsRequest { - // Required. The project and location for which to retrieve backup - // information, in the format - // 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - // locations map to Google Cloud regions, for example **us-central1**. - // To retrieve data sources for all locations, use "-" for the - // '{location}' value. - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/Backup" - } - ]; - - // Optional. Requested page size. Server may return fewer items than - // requested. If unspecified, server will pick an appropriate default. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A token identifying a page of results the server should return. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Filtering results. - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Hint for how to order the results. - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Reserved for future use to provide a BASIC & FULL view of Backup - // resource. - BackupView view = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for listing Backups. -message ListBackupsResponse { - // The list of Backup instances in the project for the specified - // location. - // - // If the '{location}' value in the request is "-", the response contains a - // list of instances from all locations. In case any location is unreachable, - // the response will only return data sources in reachable locations - // and the 'unreachable' field will be populated with a list of unreachable - // locations. - repeated Backup backups = 1; - - // A token identifying a page of results the server should return. - string next_page_token = 2; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request message for getting a Backup. -message GetBackupRequest { - // Required. Name of the data source resource name, in the format - // 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } - ]; - - // Optional. Reserved for future use to provide a BASIC & FULL view of Backup - // resource. - BackupView view = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// Request message for updating a Backup. -message UpdateBackupRequest { - // Required. Field mask is used to specify the fields to be overwritten in the - // Backup resource by the update. - // The fields specified in the update_mask are relative to the resource, not - // the full request. A field will be overwritten if it is in the mask. If the - // user does not provide a mask then the request will fail. - google.protobuf.FieldMask update_mask = 1 - [(google.api.field_behavior) = REQUIRED]; - - // Required. The resource being updated - Backup backup = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes since the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 3 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Message for deleting a Backup. -message DeleteBackupRequest { - // Required. Name of the resource. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; -} - -// Request message for restoring from a Backup. -message RestoreBackupRequest { - // Required. The resource name of the Backup instance, in the format - // 'projects/*/locations/*/backupVaults/*/dataSources/*/backups/'. - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { type: "backupdr.googleapis.com/Backup" } - ]; - - // Optional. An optional request ID to identify requests. Specify a unique - // request ID so that if you must retry your request, the server will know to - // ignore the request if it has already been completed. The server will - // guarantee that for at least 60 minutes after the first request. - // - // For example, consider a situation where you make an initial request and - // the request times out. If you make the request again with the same request - // ID, the server can check if original operation with the same request ID - // was received, and if so, will ignore the second request. This prevents - // clients from accidentally creating duplicate commitments. - // - // The request ID must be a valid UUID with the exception that zero UUID is - // not supported (00000000-0000-0000-0000-000000000000). - string request_id = 2 [ - (google.api.field_info).format = UUID4, - (google.api.field_behavior) = OPTIONAL - ]; - - // The target environment for the restore operation. - oneof target_environment { - // Compute Engine target environment to be used during restore. - ComputeInstanceTargetEnvironment compute_instance_target_environment = 3; - - // Disk target environment to be used during restore. - DiskTargetEnvironment disk_target_environment = 5; - - // Region disk target environment to be used during restore. - RegionDiskTargetEnvironment region_disk_target_environment = 6; - } - - // The property overrides for the instance being restored. - oneof instance_properties { - // Compute Engine instance properties to be overridden during restore. - ComputeInstanceRestoreProperties compute_instance_restore_properties = 4; - - // Disk properties to be overridden during restore. - DiskRestoreProperties disk_restore_properties = 7; - } - - // Optional. A field mask used to clear server-side default values - // for fields within the `instance_properties` oneof. - // - // When a field in this mask is cleared, the server will not apply its - // default logic (like inheriting a value from the source) for that field. - // - // The most common current use case is clearing default encryption keys. - // - // Examples of field mask paths: - // - Compute Instance Disks: - // `compute_instance_restore_properties.disks.*.disk_encryption_key` - // - Single Disk: `disk_restore_properties.disk_encryption_key` - optional google.protobuf.FieldMask clear_overrides_field_mask = 8 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Response message for restoring from a Backup. -message RestoreBackupResponse { - // Details of the target resource created/modified as part of restore. - TargetResource target_resource = 1; -} - -// Details of the target resource created/modified as part of restore. -message TargetResource { - // Minimum details to identify the restored resource. - oneof target_resource_info { - // Details of the native Google Cloud resource created as part of restore. - GcpResource gcp_resource = 1; - } -} - -// Minimum details to identify a Google Cloud resource -message GcpResource { - // Name of the Google Cloud resource. - string gcp_resourcename = 1; - - // Location of the resource: //"global"/"unspecified". - string location = 2; - - // Type of the resource. Use the Unified Resource Type, - // eg. compute.googleapis.com/Instance. - string type = 3; -} - -// Minimum details to identify a Google Cloud resource for a backup. -message BackupGcpResource { - // Name of the Google Cloud resource. - string gcp_resourcename = 1; - - // Location of the resource: //"global"/"unspecified". - string location = 2; - - // Type of the resource. Use the Unified Resource Type, - // eg. compute.googleapis.com/Instance. - string type = 3; -} - -// Backup configuration state. Is the resource configured for backup? -enum BackupConfigState { - // The possible states of backup configuration. - // Status not set. - BACKUP_CONFIG_STATE_UNSPECIFIED = 0; - - // The data source is actively protected (i.e. there is a - // BackupPlanAssociation or Appliance SLA pointing to it) - ACTIVE = 1; - - // The data source is no longer protected (but may have backups under it) - PASSIVE = 2; -} - -// BackupView contains enum options for Partial and Full view. -enum BackupView { - // If the value is not set, the default 'FULL' view is used. - BACKUP_VIEW_UNSPECIFIED = 0; - - // Includes basic data about the Backup, but not the full contents. - BACKUP_VIEW_BASIC = 1; - - // Includes all data about the Backup. - // This is the default value (for both ListBackups and GetBackup). - BACKUP_VIEW_FULL = 2; -} - -// BackupVaultView contains enum options for Partial and Full view. -enum BackupVaultView { - // If the value is not set, the default 'FULL' view is used. - BACKUP_VAULT_VIEW_UNSPECIFIED = 0; - - // Includes basic data about the Backup Vault, but not the full contents. - BACKUP_VAULT_VIEW_BASIC = 1; - - // Includes all data about the Backup Vault. - // This is the default value (for both ListBackupVaults and GetBackupVault). - BACKUP_VAULT_VIEW_FULL = 2; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto deleted file mode 100644 index 42d294ff894..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_ba.proto +++ /dev/null @@ -1,49 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupvaultBaProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; - -// BackupApplianceBackupProperties represents BackupDR backup appliance's -// properties. -message BackupApplianceBackupProperties { - // Output only. The numeric generation ID of the backup (monotonically - // increasing). - optional int32 generation_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The time when this backup object was finalized (if none, - // backup is not finalized). - optional google.protobuf.Timestamp finalize_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. The earliest timestamp of data available in this Backup. - optional google.protobuf.Timestamp recovery_range_start_time = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The latest timestamp of data available in this Backup. - optional google.protobuf.Timestamp recovery_range_end_time = 4 - [(google.api.field_behavior) = OPTIONAL]; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto deleted file mode 100644 index c50279109b4..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto +++ /dev/null @@ -1,146 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupvaultCloudSqlProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; -option (google.api.resource_definition) = { - type: "sqladmin.googleapis.com/Instance" - pattern: "projects/{project}/instances/{instance}" -}; - -// CloudSqlInstanceDataSourceProperties represents the properties of a -// Cloud SQL resource that are stored in the DataSource. -message CloudSqlInstanceDataSourceProperties { - // Output only. Name of the Cloud SQL instance backed up by the datasource. - // Format: - // projects/{project}/instances/{instance} - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "sqladmin.googleapis.com/Instance" - } - ]; - - // Output only. The installed database version of the Cloud SQL instance. - string database_installed_version = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The instance creation timestamp. - google.protobuf.Timestamp instance_create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The tier (or machine type) for this instance. Example: - // `db-custom-1-3840` - string instance_tier = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// CloudSqlInstanceBackupProperties represents Cloud SQL Instance -// Backup properties. -message CloudSqlInstanceBackupProperties { - // Output only. The installed database version of the Cloud SQL instance - // when the backup was taken. - string database_installed_version = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Whether the backup is a final backup. - bool final_backup = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The source instance of the backup. - // Format: - // projects/{project}/instances/{instance} - string source_instance = 4 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "sqladmin.googleapis.com/Instance" - } - ]; - - // Output only. The instance creation timestamp. - google.protobuf.Timestamp instance_create_time = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The tier (or machine type) for this instance. Example: - // `db-custom-1-3840` - string instance_tier = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The instance delete timestamp. - google.protobuf.Timestamp instance_delete_time = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// CloudSqlInstanceDataSourceReferenceProperties represents the properties of a -// Cloud SQL resource that are stored in the DataSourceReference. -message CloudSqlInstanceDataSourceReferenceProperties { - // Output only. Name of the Cloud SQL instance backed up by the datasource. - // Format: - // projects/{project}/instances/{instance} - string name = 1 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "sqladmin.googleapis.com/Instance" - } - ]; - - // Output only. The installed database version of the Cloud SQL instance. - string database_installed_version = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The instance creation timestamp. - google.protobuf.Timestamp instance_create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The tier (or machine type) for this instance. Example: - // `db-custom-1-3840` - string instance_tier = 5 [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// CloudSqlInstanceInitializationConfig contains the configuration for -// initializing a Cloud SQL instance. -message CloudSqlInstanceInitializationConfig { - // The edition of the Cloud SQL instance. For details, see - // https://cloud.google.com/sql/docs/editions-intro. - enum Edition { - // Unspecified edition. - EDITION_UNSPECIFIED = 0; - - // Enterprise edition. - ENTERPRISE = 1; - - // Enterprise Plus edition. - ENTERPRISE_PLUS = 2; - } - - // Required. The edition of the Cloud SQL instance. - Edition edition = 1 [(google.api.field_behavior) = REQUIRED]; -} - -// Cloud SQL instance's BPA properties. -message CloudSqlInstanceBackupPlanAssociationProperties { - // Output only. The time when the instance was created. - google.protobuf.Timestamp instance_create_time = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto deleted file mode 100644 index f91c17525d8..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_disk.proto +++ /dev/null @@ -1,227 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/backupdr/v1/backupvault_gce.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupvaultDiskProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; -option (google.api.resource_definition) = { - type: "compute.googleapis.com/StoragePool" - pattern: "projects/{project}/zones/{zone}/storagePools/{storage_pool}" -}; - -// DiskTargetEnvironment represents the target environment for the disk. -message DiskTargetEnvironment { - // Required. Target project for the disk. - string project = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Target zone for the disk. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// RegionDiskTargetEnvironment represents the target environment for the disk. -message RegionDiskTargetEnvironment { - // Required. Target project for the disk. - string project = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. Target region for the disk. - string region = 2 [(google.api.field_behavior) = REQUIRED]; - - // Required. Target URLs of the replica zones for the disk. - repeated string replica_zones = 3 [(google.api.field_behavior) = REQUIRED]; -} - -// DiskRestoreProperties represents the properties of a Disk restore. -message DiskRestoreProperties { - // The supported access modes of the disk. - enum AccessMode { - // The default AccessMode, means the disk can be attached to single instance - // in RW mode. - READ_WRITE_SINGLE = 0; - - // The AccessMode means the disk can be attached to multiple instances in RW - // mode. - READ_WRITE_MANY = 1; - - // The AccessMode means the disk can be attached to multiple instances in RO - // mode. - READ_ONLY_MANY = 2; - } - - // Architecture of the source disk. - enum Architecture { - // Default value. This value is unused. - ARCHITECTURE_UNSPECIFIED = 0; - - // Disks with architecture X86_64 - X86_64 = 1; - - // Disks with architecture ARM64 - ARM64 = 2; - } - - // Required. Name of the disk. - optional string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. An optional description of this resource. Provide this property - // when you create the resource. - optional string description = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Required. The size of the disk in GB. - optional int64 size_gb = 3 [(google.api.field_behavior) = REQUIRED]; - - // Optional. A list of publicly available licenses that are applicable to this - // backup. This is applicable if the original image had licenses attached, - // e.g. Windows image - repeated string licenses = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of features to enable in the guest operating system. This - // is applicable only for bootable images. - repeated GuestOsFeature guest_os_feature = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Encrypts the disk using a - // customer-supplied encryption key or a customer-managed encryption key. - optional CustomerEncryptionKey disk_encryption_key = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Physical block size of the persistent disk, in bytes. - // If not present in a request, a default value is used. - // Currently, the supported size is 4096. - optional int64 physical_block_size_bytes = 7 - [(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. - optional int64 provisioned_iops = 8 [(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. - optional int64 provisioned_throughput = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates whether this disk is using confidential compute mode. - // Encryption with a Cloud KMS key is required to enable this option. - optional bool enable_confidential_compute = 10 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The storage pool in which the new disk is created. You can - // provide this as a partial or full URL to the resource. - optional string storage_pool = 11 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.resource_reference) = { - type: "compute.googleapis.com/StoragePool" - } - ]; - - // Optional. The access mode of the disk. - optional AccessMode access_mode = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The architecture of the source disk. Valid values are - // ARM64 or X86_64. - optional Architecture architecture = 14 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resource policies applied to this disk. - repeated string resource_policy = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Required. URL of the disk type resource describing which disk type to use - // to create the disk. - optional string type = 16 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Labels to apply to this disk. These can be modified later using - // setLabels method. Label values can be empty. - map labels = 17 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Resource manager tags to be bound to the disk. - map resource_manager_tags = 18 - [(google.api.field_behavior) = OPTIONAL]; -} - -// DiskBackupProperties represents the properties of a Disk backup. -message DiskBackupProperties { - // Architecture of the source disk. - enum Architecture { - // Default value. This value is unused. - ARCHITECTURE_UNSPECIFIED = 0; - - // Disks with architecture X86_64 - X86_64 = 1; - - // Disks with architecture ARM64 - ARM64 = 2; - } - - // A description of the source disk. - optional string description = 1; - - // A list of publicly available licenses that are applicable to this backup. - // This is applicable if the original image had licenses attached, e.g. - // Windows image. - repeated string licenses = 2; - - // A list of guest OS features that are applicable to this backup. - repeated GuestOsFeature guest_os_feature = 3; - - // The architecture of the source disk. Valid values are - // ARM64 or X86_64. - optional Architecture architecture = 4; - - // The URL of the type of the disk. - optional string type = 5; - - // Size(in GB) of the source disk. - optional int64 size_gb = 6; - - // Region and zone are mutually exclusive fields. - // The URL of the region of the source disk. - optional string region = 7; - - // The URL of the Zone where the source disk. - optional string zone = 8; - - // The URL of the Zones where the source disk should be replicated. - repeated string replica_zones = 9; - - // The source disk used to create this backup. - optional string source_disk = 10; -} - -// DiskDataSourceProperties represents the properties of a -// Disk resource that are stored in the DataSource. -// . -message DiskDataSourceProperties { - // Name of the disk backed up by the datasource. - string name = 1; - - // The description of the disk. - string description = 2; - - // The type of the disk. - string type = 3; - - // The size of the disk in GB. - int64 size_gb = 4; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto deleted file mode 100644 index 22961a9d788..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/backupvault_gce.proto +++ /dev/null @@ -1,957 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/field_info.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "BackupvaultGceProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; - -// ComputeInstanceBackupProperties represents Compute Engine instance backup -// properties. -message ComputeInstanceBackupProperties { - // An optional text description for the instances that are created from these - // properties. - optional string description = 1; - - // A list of tags to apply to the instances that are created from these - // properties. The tags identify valid sources or targets for network - // firewalls. The setTags method can modify this list of tags. Each tag within - // the list must comply with RFC1035 (https://www.ietf.org/rfc/rfc1035.txt). - optional Tags tags = 2; - - // The machine type to use for instances that are created from these - // properties. - optional string machine_type = 3; - - // Enables instances created based on these properties to send packets with - // source IP addresses other than their own and receive packets with - // destination IP addresses other than their own. If these instances will be - // used as an IP gateway or it will be set as the next-hop in a Route - // resource, specify `true`. If unsure, leave this set to `false`. See the - // https://cloud.google.com/vpc/docs/using-routes#canipforward - // documentation for more information. - optional bool can_ip_forward = 4; - - // An array of network access configurations for this interface. - repeated NetworkInterface network_interface = 5; - - // An array of disks that are associated with the instances that are created - // from these properties. - repeated AttachedDisk disk = 6; - - // The metadata key/value pairs to assign to instances that are created from - // these properties. These pairs can consist of custom metadata or predefined - // keys. See https://cloud.google.com/compute/docs/metadata/overview for more - // information. - optional Metadata metadata = 7; - - // A list of service accounts with specified scopes. Access tokens for these - // service accounts are available to the instances that are created from - // these properties. Use metadata queries to obtain the access tokens for - // these instances. - repeated ServiceAccount service_account = 8; - - // Specifies the scheduling options for the instances that are created from - // these properties. - optional Scheduling scheduling = 9; - - // A list of guest accelerator cards' type and count to use for instances - // created from these properties. - repeated AcceleratorConfig guest_accelerator = 10; - - // Minimum cpu/platform to be used by instances. The instance may be - // scheduled on the specified or newer cpu/platform. Applicable values are the - // friendly names of CPU platforms, such as - // `minCpuPlatform: Intel Haswell` or `minCpuPlatform: Intel Sandy Bridge`. - // For more information, read - // https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform. - optional string min_cpu_platform = 11; - - // KeyRevocationActionType of the instance. Supported options are "STOP" and - // "NONE". The default value is "NONE" if it is not specified. - optional KeyRevocationActionType key_revocation_action_type = 12; - - // The source instance used to create this backup. This can be a partial or - // full URL to the resource. For example, the following are valid values: - // -https://www.googleapis.com/compute/v1/projects/project/zones/zone/instances/instance - // -projects/project/zones/zone/instances/instance - optional string source_instance = 13; - - // Labels to apply to instances that are created from these properties. - map labels = 14; -} - -// ComputeInstanceRestoreProperties represents Compute Engine instance -// properties to be overridden during restore. -message ComputeInstanceRestoreProperties { - // The private IPv6 google access type for the VMs. - enum InstancePrivateIpv6GoogleAccess { - // Default value. This value is unused. - INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0; - - // Each network interface inherits PrivateIpv6GoogleAccess from its - // subnetwork. - INHERIT_FROM_SUBNETWORK = 1; - - // Outbound private IPv6 access from VMs in this subnet to Google services. - // If specified, the subnetwork who is attached to the instance's default - // network interface will be assigned an internal IPv6 prefix if it doesn't - // have before. - ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2; - - // Bidirectional private IPv6 access to/from Google services. If - // specified, the subnetwork who is attached to the instance's default - // network interface will be assigned an internal IPv6 prefix if it doesn't - // have before. - ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3; - } - - // Required. Name of the compute instance. - optional string name = 1 [(google.api.field_behavior) = REQUIRED]; - - // Optional. Controls for advanced machine-related behavior features. - optional AdvancedMachineFeatures advanced_machine_features = 2 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Allows this instance to send and receive packets with - // non-matching destination or source IPs. - optional bool can_ip_forward = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Controls Confidential compute options on the instance - optional ConfidentialInstanceConfig confidential_instance_config = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether the resource should be protected against deletion. - optional bool deletion_protection = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An optional description of this resource. Provide this property - // when you create the resource. - optional string description = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Array of disks associated with this instance. Persistent disks - // must be created before you can assign them. Source regional persistent - // disks will be restored with default replica zones if not specified. - repeated AttachedDisk disks = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Enables display device for the instance. - optional DisplayDevice display_device = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of the type and count of accelerator cards attached to the - // instance. - repeated AcceleratorConfig guest_accelerators = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the hostname of the instance. The specified hostname - // must be RFC1035 compliant. If hostname is not specified, the default - // hostname is [INSTANCE_NAME].c.[PROJECT_ID].internal when using the global - // DNS, and [INSTANCE_NAME].[ZONE].c.[PROJECT_ID].internal when using zonal - // DNS. - optional string hostname = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Encrypts suspended data for an instance with a - // customer-managed encryption key. - optional CustomerEncryptionKey instance_encryption_key = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. KeyRevocationActionType of the instance. - optional KeyRevocationActionType key_revocation_action_type = 12 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Labels to apply to this instance. - map labels = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Full or partial URL of the machine type resource to use for this - // instance. - optional string machine_type = 14 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This includes custom metadata and predefined keys. - optional Metadata metadata = 15 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Minimum CPU platform to use for this instance. - optional string min_cpu_platform = 16 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An array of network configurations for this instance. These - // specify how interfaces are configured to interact with other network - // services, such as connecting to the internet. Multiple interfaces are - // supported per instance. Required to restore in different project or region. - repeated NetworkInterface network_interfaces = 17 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Configure network performance such as egress bandwidth tier. - optional NetworkPerformanceConfig network_performance_config = 18 - [(google.api.field_behavior) = OPTIONAL]; - - // Input only. Additional params passed with the request, but not persisted - // as part of resource payload. - optional InstanceParams params = 19 - [(google.api.field_behavior) = INPUT_ONLY]; - - // Optional. The private IPv6 google access type for the VM. - // If not specified, use INHERIT_FROM_SUBNETWORK as default. - optional InstancePrivateIpv6GoogleAccess private_ipv6_google_access = 20 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the reservations that this instance can consume from. - optional AllocationAffinity allocation_affinity = 21 [ - json_name = "reservationAffinity", - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Resource policies applied to this instance. - // By default, no resource policies will be applied. - repeated string resource_policies = 22 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Sets the scheduling options for this instance. - optional Scheduling scheduling = 23 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of service accounts, with their specified scopes, - // authorized for this instance. Only one service account per VM instance is - // supported. - repeated ServiceAccount service_accounts = 24 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Tags to apply to this instance. Tags are used to identify valid - // sources or targets for network firewalls and are specified by the client - // during instance creation. - optional Tags tags = 26 [(google.api.field_behavior) = OPTIONAL]; -} - -// ComputeInstanceTargetEnvironment represents Compute Engine target -// environment to be used during restore. -message ComputeInstanceTargetEnvironment { - // Required. Target project for the Compute Engine instance. - string project = 1 [(google.api.field_behavior) = REQUIRED]; - - // Required. The zone of the Compute Engine instance. - string zone = 2 [(google.api.field_behavior) = REQUIRED]; -} - -// ComputeInstanceDataSourceProperties represents the properties of a -// ComputeEngine resource that are stored in the DataSource. -message ComputeInstanceDataSourceProperties { - // Name of the compute instance backed up by the datasource. - string name = 1; - - // The description of the Compute Engine instance. - string description = 2; - - // The machine type of the instance. - string machine_type = 3; - - // The total number of disks attached to the Instance. - int64 total_disk_count = 4; - - // The sum of all the disk sizes. - int64 total_disk_size_gb = 5; -} - -// Specifies options for controlling advanced machine features. -message AdvancedMachineFeatures { - // Optional. Whether to enable nested virtualization or not (default is - // false). - optional bool enable_nested_virtualization = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of threads per physical core. To disable simultaneous - // multithreading (SMT) set this to 1. If unset, the maximum number - // of threads supported per core by the underlying processor is - // assumed. - optional int32 threads_per_core = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of physical cores to expose to an instance. Multiply - // by the number of threads per core to compute the total number of virtual - // CPUs to expose to the instance. If unset, the number of cores is - // inferred from the instance's nominal CPU count and the underlying - // platform's SMT width. - optional int32 visible_core_count = 3 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Whether to enable UEFI networking for instance creation. - optional bool enable_uefi_networking = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A set of Confidential Instance options. -message ConfidentialInstanceConfig { - // Optional. Defines whether the instance should have confidential compute - // enabled. - optional bool enable_confidential_compute = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A set of Display Device options -message DisplayDevice { - // Optional. Enables display for the Compute Engine VM - optional bool enable_display = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// A specification of the type and number of accelerator cards attached to the -// instance. -message AcceleratorConfig { - // Optional. Full or partial URL of the accelerator type resource to attach to - // this instance. - optional string accelerator_type = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The number of the guest accelerator cards exposed to this - // instance. - optional int32 accelerator_count = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A customer-supplied encryption key. -message CustomerEncryptionKey { - // The key to use for encryption. - oneof key { - // Optional. Specifies a 256-bit customer-supplied - // encryption key. - string raw_key = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. RSA-wrapped 2048-bit - // customer-supplied encryption key to either encrypt or decrypt this - // resource. - string rsa_encrypted_key = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of the encryption key that is stored in Google Cloud - // KMS. - string kms_key_name = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Optional. The service account being used for the encryption request for the - // given KMS key. If absent, the Compute Engine default service account is - // used. - optional string kms_key_service_account = 4 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A key/value pair to be used for storing metadata. -message Entry { - // Optional. Key for the metadata entry. - optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Value for the metadata entry. These are free-form strings, and - // only have meaning as interpreted by the image running in the instance. The - // only restriction placed on values is that their size must be less than - // or equal to 262144 bytes (256 KiB). - optional string value = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A metadata key/value entry. -message Metadata { - // Optional. Array of key/value pairs. The total size of all keys and values - // must be less than 512 KB. - repeated Entry items = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// A network interface resource attached to an instance. -// s -message NetworkInterface { - // Stack type for this network interface. - enum StackType { - // Default should be STACK_TYPE_UNSPECIFIED. - STACK_TYPE_UNSPECIFIED = 0; - - // The network interface will be assigned IPv4 address. - IPV4_ONLY = 1; - - // The network interface can have both IPv4 and IPv6 addresses. - IPV4_IPV6 = 2; - } - - // IPv6 access type for this network interface. - enum Ipv6AccessType { - // IPv6 access type not set. Means this network interface hasn't been - // turned on IPv6 yet. - UNSPECIFIED_IPV6_ACCESS_TYPE = 0; - - // This network interface can have internal IPv6. - INTERNAL = 1; - - // This network interface can have external IPv6. - EXTERNAL = 2; - } - - // Nic type for this network interface. - enum NicType { - // Default should be NIC_TYPE_UNSPECIFIED. - NIC_TYPE_UNSPECIFIED = 0; - - // VIRTIO - VIRTIO_NET = 1; - - // GVNIC - GVNIC = 2; - } - - // Optional. URL of the VPC network resource for this instance. - optional string network = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The URL of the Subnetwork resource for this instance. - optional string subnetwork = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An IPv4 internal IP address to assign to the instance for this - // network interface. If not specified by the user, an unused internal IP is - // assigned by the system. - optional string ip_address = 3 [ - json_name = "networkIP", - (google.api.field_info).format = IPV4, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. An IPv6 internal network address for this network interface. To - // use a static internal IP address, it must be unused and in the same region - // as the instance's zone. If not specified, Google Cloud will automatically - // assign an internal IPv6 address from the instance's subnetwork. - optional string ipv6_address = 4 [ - (google.api.field_info).format = IPV6, - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. The prefix length of the primary internal IPv6 range. - optional int32 internal_ipv6_prefix_length = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Output only. [Output Only] The name of the network interface, which is - // generated by the server. - optional string name = 6 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Optional. An array of configurations for this interface. Currently, only - // one access config,ONE_TO_ONE_NAT is supported. If there are no - // accessConfigs specified, then this instance will have - // no external internet access. - repeated AccessConfig access_configs = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An array of IPv6 access configurations for this interface. - // Currently, only one IPv6 access config, DIRECT_IPV6, is supported. If there - // is no ipv6AccessConfig specified, then this instance will - // have no external IPv6 Internet access. - repeated AccessConfig ipv6_access_configs = 8 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. An array of alias IP ranges for this network interface. - // You can only specify this field for network interfaces in VPC networks. - repeated AliasIpRange alias_ip_ranges = 9 - [(google.api.field_behavior) = OPTIONAL]; - - // The stack type for this network interface. - optional StackType stack_type = 10; - - // Optional. [Output Only] One of EXTERNAL, INTERNAL to indicate whether the - // IP can be accessed from the Internet. This field is always inherited from - // its subnetwork. - optional Ipv6AccessType ipv6_access_type = 11 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The networking queue count that's specified by users for the - // network interface. Both Rx and Tx queues will be set to this number. It'll - // be empty if not specified by the users. - optional int32 queue_count = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The type of vNIC to be used on this interface. This may be gVNIC - // or VirtioNet. - optional NicType nic_type = 13 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The URL of the network attachment that this interface should - // connect to in the following format: - // projects/{project_number}/regions/{region_name}/networkAttachments/{network_attachment_name}. - optional string network_attachment = 14 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Network performance configuration. -message NetworkPerformanceConfig { - // Network performance tier. - enum Tier { - // This value is unused. - TIER_UNSPECIFIED = 0; - - // Default network performance config. - DEFAULT = 1; - - // Tier 1 network performance config. - TIER_1 = 2; - } - - // Optional. The tier of the total egress bandwidth. - optional Tier total_egress_bandwidth_tier = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// An access configuration attached to an instance's network interface. -// Only one access config per instance is supported. -message AccessConfig { - // The type of configuration. - enum AccessType { - // Default value. This value is unused. - ACCESS_TYPE_UNSPECIFIED = 0; - - // ONE_TO_ONE_NAT - ONE_TO_ONE_NAT = 1; - - // Direct IPv6 access. - DIRECT_IPV6 = 2; - } - - // Network tier property used by addresses, instances and forwarding rules. - enum NetworkTier { - // Default value. This value is unused. - NETWORK_TIER_UNSPECIFIED = 0; - - // High quality, Google-grade network tier, support for all networking - // products. - PREMIUM = 1; - - // Public internet quality, only limited support for other networking - // products. - STANDARD = 2; - } - - // Optional. In accessConfigs (IPv4), the - // default and only option is ONE_TO_ONE_NAT. In - // ipv6AccessConfigs, the default and only option is - // DIRECT_IPV6. - optional AccessType type = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of this access configuration. - optional string name = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The external IP address of this access configuration. - optional string external_ip = 3 - [json_name = "natIP", (google.api.field_behavior) = OPTIONAL]; - - // Optional. The external IPv6 address of this access configuration. - optional string external_ipv6 = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The prefix length of the external IPv6 range. - optional int32 external_ipv6_prefix_length = 5 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether a public DNS 'PTR' record should be created to - // map the external IP address of the instance to a DNS domain name. - optional bool set_public_ptr = 6 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The DNS domain name for the public PTR record. - optional string public_ptr_domain_name = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This signifies the networking tier used for configuring this - // access - optional NetworkTier network_tier = 8 - [(google.api.field_behavior) = OPTIONAL]; -} - -// An alias IP range attached to an instance's network interface. -message AliasIpRange { - // Optional. The IP alias ranges to allocate for this interface. - optional string ip_cidr_range = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The name of a subnetwork secondary IP range from which to - // allocate an IP alias range. If not specified, the primary range of the - // subnetwork is used. - optional string subnetwork_range_name = 2 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Additional instance params. -message InstanceParams { - // Optional. Resource manager tags to be bound to the instance. - map resource_manager_tags = 1 - [(google.api.field_behavior) = OPTIONAL]; -} - -// Specifies the reservations that this instance can consume from. -message AllocationAffinity { - // Indicates whether to consume from a reservation or not. - enum Type { - // Default value. This value is unused. - TYPE_UNSPECIFIED = 0; - - // Do not consume from any allocated capacity. - NO_RESERVATION = 1; - - // Consume any allocation available. - ANY_RESERVATION = 2; - - // Must consume from a specific reservation. Must specify key value fields - // for specifying the reservations. - SPECIFIC_RESERVATION = 3; - } - - // Optional. Specifies the type of reservation from which this instance can - // consume - optional Type consume_allocation_type = 1 [ - json_name = "consumeReservationType", - (google.api.field_behavior) = OPTIONAL - ]; - - // Optional. Corresponds to the label key of a reservation resource. - optional string key = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Corresponds to the label values of a reservation resource. - repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; -} - -// Sets the scheduling options for an Instance. -message Scheduling { - // Defines the maintenance behavior for this instance= - enum OnHostMaintenance { - // Default value. This value is unused. - ON_HOST_MAINTENANCE_UNSPECIFIED = 0; - - // Tells Compute Engine to terminate and (optionally) restart the instance - // away from the maintenance activity. - TERMINATE = 1; - - // Default, Allows Compute Engine to automatically migrate instances - // out of the way of maintenance events. - MIGRATE = 1000; - } - - // Node Affinity: the configuration of desired nodes onto which this Instance - // could be scheduled. - message NodeAffinity { - // Defines the type of node selections. - enum Operator { - // Default value. This value is unused. - OPERATOR_UNSPECIFIED = 0; - - // Requires Compute Engine to seek for matched nodes. - IN = 1; - - // Requires Compute Engine to avoid certain nodes. - NOT_IN = 2; - } - - // Optional. Corresponds to the label key of Node resource. - optional string key = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines the operation of node selection. - optional Operator operator = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Corresponds to the label values of Node resource. - repeated string values = 3 [(google.api.field_behavior) = OPTIONAL]; - } - - // Defines the provisioning model for an instance. - enum ProvisioningModel { - // Default value. This value is not used. - PROVISIONING_MODEL_UNSPECIFIED = 0; - - // Standard provisioning with user controlled runtime, no discounts. - STANDARD = 1; - - // Heavily discounted, no guaranteed runtime. - SPOT = 2; - } - - // Defines the supported termination actions for an instance. - enum InstanceTerminationAction { - // Default value. This value is unused. - INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0; - - // Delete the VM. - DELETE = 1; - - // Stop the VM without storing in-memory content. default action. - STOP = 2; - } - - // Optional. Defines the maintenance behavior for this instance. - optional OnHostMaintenance on_host_maintenance = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the instance should be automatically restarted - // if it is terminated by Compute Engine (not terminated by a user). - optional bool automatic_restart = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Defines whether the instance is preemptible. - optional bool preemptible = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A set of node affinity and anti-affinity configurations. - // Overrides reservationAffinity. - repeated NodeAffinity node_affinities = 4 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The minimum number of virtual CPUs this instance will consume - // when running on a sole-tenant node. - optional int32 min_node_cpus = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the provisioning model of the instance. - optional ProvisioningModel provisioning_model = 6 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the termination action for the instance. - optional InstanceTerminationAction instance_termination_action = 7 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the maximum amount of time a Local Ssd Vm should wait - // while recovery of the Local Ssd state is attempted. Its value should be in - // between 0 and 168 hours with hour granularity and the default value being 1 - // hour. - optional SchedulingDuration local_ssd_recovery_timeout = 10 - [(google.api.field_behavior) = OPTIONAL]; -} - -// A SchedulingDuration represents a fixed-length span of time represented -// as a count of seconds and fractions of seconds at nanosecond -// resolution. It is independent of any calendar and concepts like "day" -// or "month". Range is approximately 10,000 years. -message SchedulingDuration { - // Optional. Span of time at a resolution of a second. - optional int64 seconds = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Span of time that's a fraction of a second at nanosecond - // resolution. - optional int32 nanos = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A service account. -message ServiceAccount { - // Optional. Email address of the service account. - optional string email = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The list of scopes to be made available for this service account. - repeated string scopes = 2 [(google.api.field_behavior) = OPTIONAL]; -} - -// A set of instance tags. -message Tags { - // Optional. An array of tags. Each tag must be 1-63 characters long, and - // comply with RFC1035. - repeated string items = 1 [(google.api.field_behavior) = OPTIONAL]; -} - -// An instance-attached disk resource. -message AttachedDisk { - // Specifies the parameters to initialize this disk. - message InitializeParams { - // Optional. Specifies the disk name. If not specified, the default is to - // use the name of the instance. - optional string disk_name = 1 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. URL of the zone where the disk should be created. - // Required for each regional disk associated with the instance. - repeated string replica_zones = 2 [(google.api.field_behavior) = OPTIONAL]; - } - - // List of the Disk Types. - enum DiskType { - // Default value, which is unused. - DISK_TYPE_UNSPECIFIED = 0; - - // A scratch disk type. - SCRATCH = 1; - - // A persistent disk type. - PERSISTENT = 2; - } - - // List of the Disk Modes. - enum DiskMode { - // Default value, which is unused. - DISK_MODE_UNSPECIFIED = 0; - - // Attaches this disk in read-write mode. Only one - // virtual machine at a time can be attached to a disk in read-write mode. - READ_WRITE = 1; - - // Attaches this disk in read-only mode. Multiple virtual machines can use - // a disk in read-only mode at a time. - READ_ONLY = 2; - - // The disk is locked for administrative reasons. Nobody else - // can use the disk. This mode is used (for example) when taking - // a snapshot of a disk to prevent mounting the disk while it is - // being snapshotted. - LOCKED = 3; - } - - // List of the Disk Interfaces. - enum DiskInterface { - // Default value, which is unused. - DISK_INTERFACE_UNSPECIFIED = 0; - - // SCSI Disk Interface. - SCSI = 1; - - // NVME Disk Interface. - NVME = 2; - - // NVDIMM Disk Interface. - NVDIMM = 3; - - // ISCSI Disk Interface. - ISCSI = 4; - } - - // List of the states of the Disk. - enum DiskSavedState { - // Default Disk state has not been preserved. - DISK_SAVED_STATE_UNSPECIFIED = 0; - - // Disk state has been preserved. - PRESERVED = 1; - } - - // Optional. Specifies the parameters to initialize this disk. - optional InitializeParams initialize_params = 1 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. This is used as an identifier for the disks. This is the unique - // name has to provided to modify disk parameters like disk_name and - // replica_zones (in case of RePDs) - optional string device_name = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Type of the resource. - optional string kind = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Specifies the type of the disk. - optional DiskType disk_type_deprecated = 6 [deprecated = true]; - - // Optional. The mode in which to attach this disk. - optional DiskMode mode = 7 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies a valid partial or full URL to an existing Persistent - // Disk resource. - optional string source = 8 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A zero-based index to this disk, where 0 is reserved for the - // boot disk. - optional int64 index = 9 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Indicates that this is a boot disk. The virtual machine will use - // the first partition of the disk for its root filesystem. - optional bool boot = 10 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies whether the disk will be auto-deleted when the instance - // is deleted (but not when the disk is detached from the instance). - optional bool auto_delete = 11 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Any valid publicly visible licenses. - repeated string license = 12 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Specifies the disk interface to use for attaching this disk. - optional DiskInterface disk_interface = 13 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A list of features to enable on the guest operating system. - // Applicable only for bootable images. - repeated GuestOsFeature guest_os_feature = 14 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Encrypts or decrypts a disk using a customer-supplied - // encryption key. - optional CustomerEncryptionKey disk_encryption_key = 15 - [(google.api.field_behavior) = OPTIONAL]; - - // Optional. The size of the disk in GB. - optional int64 disk_size_gb = 16 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. Output only. The state of the disk. - optional DiskSavedState saved_state = 17 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Optional. Output only. The URI of the disk type resource. For example: - // projects/project/zones/zone/diskTypes/pd-standard or pd-ssd - optional string disk_type = 18 [ - (google.api.field_behavior) = OPTIONAL, - (google.api.field_behavior) = OUTPUT_ONLY - ]; - - // Optional. Specifies the type of the disk. - optional DiskType type = 19 [(google.api.field_behavior) = OPTIONAL]; -} - -// Feature type of the Guest OS. -message GuestOsFeature { - // List of the Feature Types. - enum FeatureType { - // Default value, which is unused. - FEATURE_TYPE_UNSPECIFIED = 0; - - // VIRTIO_SCSI_MULTIQUEUE feature type. - VIRTIO_SCSI_MULTIQUEUE = 1; - - // WINDOWS feature type. - WINDOWS = 2; - - // MULTI_IP_SUBNET feature type. - MULTI_IP_SUBNET = 3; - - // UEFI_COMPATIBLE feature type. - UEFI_COMPATIBLE = 4; - - // SECURE_BOOT feature type. - SECURE_BOOT = 5; - - // GVNIC feature type. - GVNIC = 6; - - // SEV_CAPABLE feature type. - SEV_CAPABLE = 7; - - // BARE_METAL_LINUX_COMPATIBLE feature type. - BARE_METAL_LINUX_COMPATIBLE = 8; - - // SUSPEND_RESUME_COMPATIBLE feature type. - SUSPEND_RESUME_COMPATIBLE = 9; - - // SEV_LIVE_MIGRATABLE feature type. - SEV_LIVE_MIGRATABLE = 10; - - // SEV_SNP_CAPABLE feature type. - SEV_SNP_CAPABLE = 11; - - // TDX_CAPABLE feature type. - TDX_CAPABLE = 12; - - // IDPF feature type. - IDPF = 13; - - // SEV_LIVE_MIGRATABLE_V2 feature type. - SEV_LIVE_MIGRATABLE_V2 = 14; - } - - // The ID of a supported feature. - optional FeatureType type = 1; -} - -// Specifies whether the virtual machine instance will be shut down on key -// revocation. It is currently used in instance, instance properties and GMI -// protos -enum KeyRevocationActionType { - // Default value. This value is unused. - KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0; - - // Indicates user chose no operation. - NONE = 1; - - // Indicates user chose to opt for VM shutdown on key revocation. - STOP = 2; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto b/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto deleted file mode 100644 index 70626639879..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/datasourcereference.proto +++ /dev/null @@ -1,249 +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.backupdr.v1; - -import "google/api/field_behavior.proto"; -import "google/api/resource.proto"; -import "google/cloud/backupdr/v1/backupvault.proto"; -import "google/cloud/backupdr/v1/backupvault_cloudsql.proto"; -import "google/protobuf/timestamp.proto"; - -option csharp_namespace = "Google.Cloud.BackupDR.V1"; -option go_package = "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb"; -option java_multiple_files = true; -option java_outer_classname = "DataSourceReferenceProto"; -option java_package = "com.google.cloud.backupdr.v1"; -option php_namespace = "Google\\Cloud\\BackupDR\\V1"; -option ruby_package = "Google::Cloud::BackupDR::V1"; - -// DataSourceReference is a reference to a DataSource resource. -message DataSourceReference { - option (google.api.resource) = { - type: "backupdr.googleapis.com/DataSourceReference" - pattern: "projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}" - plural: "dataSourceReferences" - singular: "dataSourceReference" - }; - - // Identifier. The resource name of the DataSourceReference. - // Format: - // projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} - string name = 1 [(google.api.field_behavior) = IDENTIFIER]; - - // Output only. The resource name of the DataSource. - // Format: - // projects/{project}/locations/{location}/backupVaults/{backupVault}/dataSources/{dataSource} - string data_source = 2 [ - (google.api.field_behavior) = OUTPUT_ONLY, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/DataSource" - } - ]; - - // Output only. The time when the DataSourceReference was created. - google.protobuf.Timestamp create_time = 3 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The backup configuration state of the DataSource. - BackupConfigState data_source_backup_config_state = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Number of backups in the DataSource. - int64 data_source_backup_count = 5 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Information of backup configuration on the DataSource. - DataSourceBackupConfigInfo data_source_backup_config_info = 6 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The GCP resource that the DataSource is associated with. - DataSourceGcpResourceInfo data_source_gcp_resource_info = 7 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Total size of the storage used by all backup resources for the - // referenced datasource. - optional int64 total_stored_bytes = 8 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// Information of backup configuration on the DataSource. -message DataSourceBackupConfigInfo { - // Output only. The status of the last backup in this DataSource - BackupConfigInfo.LastBackupState last_backup_state = 1 - [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. Timestamp of the last successful backup to this DataSource. - google.protobuf.Timestamp last_successful_backup_consistency_time = 2 - [(google.api.field_behavior) = OUTPUT_ONLY]; -} - -// The GCP resource that the DataSource is associated with. -message DataSourceGcpResourceInfo { - // Output only. The resource name of the GCP resource. - // Ex: projects/{project}/zones/{zone}/instances/{instance} - string gcp_resourcename = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The type of the GCP resource. - // Ex: compute.googleapis.com/Instance - string type = 2 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // Output only. The location of the GCP resource. - // Ex: //"global"/"unspecified" - string location = 3 [(google.api.field_behavior) = OUTPUT_ONLY]; - - // The properties of the GCP resource. - oneof resource_properties { - // Output only. The properties of the Cloud SQL instance. - CloudSqlInstanceDataSourceReferenceProperties - cloud_sql_instance_properties = 4 - [(google.api.field_behavior) = OUTPUT_ONLY]; - } -} - -// Request for the GetDataSourceReference method. -message GetDataSourceReferenceRequest { - // Required. The name of the DataSourceReference to retrieve. - // Format: - // projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} - string name = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - type: "backupdr.googleapis.com/DataSourceReference" - } - ]; -} - -// Request for the ListDataSourceReferences method. -message ListDataSourceReferencesRequest { - // Required. The parent resource name. - // Format: projects/{project}/locations/{location} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/DataSourceReference" - } - ]; - - // Optional. The maximum number of DataSourceReferences to return. The service - // may return fewer than this value. If unspecified, at most 50 - // DataSourceReferences will be returned. The maximum value is 100; values - // above 100 will be coerced to 100. - int32 page_size = 2 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous `ListDataSourceReferences` - // call. Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `ListDataSourceReferences` must match the call that provided the page - // token. - string page_token = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter expression that filters the results listed in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. - // - // The following field and operator combinations are supported: - // - // * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` - // * data_source_gcp_resource_info.type with `=`, `!=` - string filter = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A comma-separated list of fields to order by, sorted in ascending - // order. Use "desc" after a field name for descending. - // - // Supported fields: - // - // * data_source - // * data_source_gcp_resource_info.gcp_resourcename - string order_by = 5 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the ListDataSourceReferences method. -message ListDataSourceReferencesResponse { - // The DataSourceReferences from the specified parent. - repeated DataSourceReference data_source_references = 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; - - // Locations that could not be reached. - repeated string unreachable = 3; -} - -// Request for the FetchDataSourceReferencesForResourceType method. -message FetchDataSourceReferencesForResourceTypeRequest { - // Required. The parent resource name. - // Format: projects/{project}/locations/{location} - string parent = 1 [ - (google.api.field_behavior) = REQUIRED, - (google.api.resource_reference) = { - child_type: "backupdr.googleapis.com/DataSourceReference" - } - ]; - - // Required. The type of the GCP resource. - // Ex: sql.googleapis.com/Instance - string resource_type = 2 [(google.api.field_behavior) = REQUIRED]; - - // Optional. The maximum number of DataSourceReferences to return. The service - // may return fewer than this value. If unspecified, at most 50 - // DataSourceReferences will be returned. The maximum value is 100; values - // above 100 will be coerced to 100. - int32 page_size = 3 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A page token, received from a previous call of - // `FetchDataSourceReferencesForResourceType`. - // Provide this to retrieve the subsequent page. - // - // When paginating, all other parameters provided to - // `FetchDataSourceReferencesForResourceType` must match - // the call that provided the page token. - string page_token = 4 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A filter expression that filters the results fetched in the - // response. The expression must specify the field name, a comparison - // operator, and the value that you want to use for filtering. Supported - // fields: - // * data_source - // * data_source_gcp_resource_info.gcp_resourcename - // * data_source_backup_config_state - // * data_source_backup_count - // * data_source_backup_config_info.last_backup_state - // * data_source_gcp_resource_info.gcp_resourcename - // * data_source_gcp_resource_info.type - // * data_source_gcp_resource_info.location - // * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time - string filter = 5 [(google.api.field_behavior) = OPTIONAL]; - - // Optional. A comma-separated list of fields to order by, sorted in ascending - // order. Use "desc" after a field name for descending. - // - // Supported fields: - // * name - string order_by = 6 [(google.api.field_behavior) = OPTIONAL]; -} - -// Response for the FetchDataSourceReferencesForResourceType method. -message FetchDataSourceReferencesForResourceTypeResponse { - // The DataSourceReferences from the specified parent. - repeated DataSourceReference data_source_references = 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; -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts b/owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts deleted file mode 100644 index 30f0900de60..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/protos.d.ts +++ /dev/null @@ -1,25533 +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 backupdr. */ - namespace backupdr { - - /** Namespace v1. */ - namespace v1 { - - /** Represents a BackupDR */ - class BackupDR extends $protobuf.rpc.Service { - - /** - * Constructs a new BackupDR 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 BackupDR 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): BackupDR; - - /** - * Calls ListManagementServers. - * @param request ListManagementServersRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListManagementServersResponse - */ - public listManagementServers(request: google.cloud.backupdr.v1.IListManagementServersRequest, callback: google.cloud.backupdr.v1.BackupDR.ListManagementServersCallback): void; - - /** - * Calls ListManagementServers. - * @param request ListManagementServersRequest message or plain object - * @returns Promise - */ - public listManagementServers(request: google.cloud.backupdr.v1.IListManagementServersRequest): Promise; - - /** - * Calls GetManagementServer. - * @param request GetManagementServerRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ManagementServer - */ - public getManagementServer(request: google.cloud.backupdr.v1.IGetManagementServerRequest, callback: google.cloud.backupdr.v1.BackupDR.GetManagementServerCallback): void; - - /** - * Calls GetManagementServer. - * @param request GetManagementServerRequest message or plain object - * @returns Promise - */ - public getManagementServer(request: google.cloud.backupdr.v1.IGetManagementServerRequest): Promise; - - /** - * Calls CreateManagementServer. - * @param request CreateManagementServerRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createManagementServer(request: google.cloud.backupdr.v1.ICreateManagementServerRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateManagementServerCallback): void; - - /** - * Calls CreateManagementServer. - * @param request CreateManagementServerRequest message or plain object - * @returns Promise - */ - public createManagementServer(request: google.cloud.backupdr.v1.ICreateManagementServerRequest): Promise; - - /** - * Calls DeleteManagementServer. - * @param request DeleteManagementServerRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteManagementServer(request: google.cloud.backupdr.v1.IDeleteManagementServerRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteManagementServerCallback): void; - - /** - * Calls DeleteManagementServer. - * @param request DeleteManagementServerRequest message or plain object - * @returns Promise - */ - public deleteManagementServer(request: google.cloud.backupdr.v1.IDeleteManagementServerRequest): Promise; - - /** - * Calls CreateBackupVault. - * @param request CreateBackupVaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback): void; - - /** - * Calls CreateBackupVault. - * @param request CreateBackupVaultRequest message or plain object - * @returns Promise - */ - public createBackupVault(request: google.cloud.backupdr.v1.ICreateBackupVaultRequest): Promise; - - /** - * Calls ListBackupVaults. - * @param request ListBackupVaultsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupVaultsResponse - */ - public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback): void; - - /** - * Calls ListBackupVaults. - * @param request ListBackupVaultsRequest message or plain object - * @returns Promise - */ - public listBackupVaults(request: google.cloud.backupdr.v1.IListBackupVaultsRequest): Promise; - - /** - * Calls FetchUsableBackupVaults. - * @param request FetchUsableBackupVaultsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse - */ - public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback): void; - - /** - * Calls FetchUsableBackupVaults. - * @param request FetchUsableBackupVaultsRequest message or plain object - * @returns Promise - */ - public fetchUsableBackupVaults(request: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): Promise; - - /** - * Calls GetBackupVault. - * @param request GetBackupVaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupVault - */ - public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback): void; - - /** - * Calls GetBackupVault. - * @param request GetBackupVaultRequest message or plain object - * @returns Promise - */ - public getBackupVault(request: google.cloud.backupdr.v1.IGetBackupVaultRequest): Promise; - - /** - * Calls UpdateBackupVault. - * @param request UpdateBackupVaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback): void; - - /** - * Calls UpdateBackupVault. - * @param request UpdateBackupVaultRequest message or plain object - * @returns Promise - */ - public updateBackupVault(request: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): Promise; - - /** - * Calls DeleteBackupVault. - * @param request DeleteBackupVaultRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback): void; - - /** - * Calls DeleteBackupVault. - * @param request DeleteBackupVaultRequest message or plain object - * @returns Promise - */ - public deleteBackupVault(request: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): Promise; - - /** - * Calls ListDataSources. - * @param request ListDataSourcesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDataSourcesResponse - */ - public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest, callback: google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback): void; - - /** - * Calls ListDataSources. - * @param request ListDataSourcesRequest message or plain object - * @returns Promise - */ - public listDataSources(request: google.cloud.backupdr.v1.IListDataSourcesRequest): Promise; - - /** - * Calls GetDataSource. - * @param request GetDataSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DataSource - */ - public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback): void; - - /** - * Calls GetDataSource. - * @param request GetDataSourceRequest message or plain object - * @returns Promise - */ - public getDataSource(request: google.cloud.backupdr.v1.IGetDataSourceRequest): Promise; - - /** - * Calls UpdateDataSource. - * @param request UpdateDataSourceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback): void; - - /** - * Calls UpdateDataSource. - * @param request UpdateDataSourceRequest message or plain object - * @returns Promise - */ - public updateDataSource(request: google.cloud.backupdr.v1.IUpdateDataSourceRequest): Promise; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupsResponse - */ - public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupsCallback): void; - - /** - * Calls ListBackups. - * @param request ListBackupsRequest message or plain object - * @returns Promise - */ - public listBackups(request: google.cloud.backupdr.v1.IListBackupsRequest): Promise; - - /** - * Calls FetchBackupsForResourceType. - * @param request FetchBackupsForResourceTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchBackupsForResourceTypeResponse - */ - public fetchBackupsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceTypeCallback): void; - - /** - * Calls FetchBackupsForResourceType. - * @param request FetchBackupsForResourceTypeRequest message or plain object - * @returns Promise - */ - public fetchBackupsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest): Promise; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Backup - */ - public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupCallback): void; - - /** - * Calls GetBackup. - * @param request GetBackupRequest message or plain object - * @returns Promise - */ - public getBackup(request: google.cloud.backupdr.v1.IGetBackupRequest): Promise; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback): void; - - /** - * Calls UpdateBackup. - * @param request UpdateBackupRequest message or plain object - * @returns Promise - */ - public updateBackup(request: google.cloud.backupdr.v1.IUpdateBackupRequest): Promise; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback): void; - - /** - * Calls DeleteBackup. - * @param request DeleteBackupRequest message or plain object - * @returns Promise - */ - public deleteBackup(request: google.cloud.backupdr.v1.IDeleteBackupRequest): Promise; - - /** - * Calls RestoreBackup. - * @param request RestoreBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback): void; - - /** - * Calls RestoreBackup. - * @param request RestoreBackupRequest message or plain object - * @returns Promise - */ - public restoreBackup(request: google.cloud.backupdr.v1.IRestoreBackupRequest): Promise; - - /** - * Calls CreateBackupPlan. - * @param request CreateBackupPlanRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback): void; - - /** - * Calls CreateBackupPlan. - * @param request CreateBackupPlanRequest message or plain object - * @returns Promise - */ - public createBackupPlan(request: google.cloud.backupdr.v1.ICreateBackupPlanRequest): Promise; - - /** - * Calls UpdateBackupPlan. - * @param request UpdateBackupPlanRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackupPlan(request: google.cloud.backupdr.v1.IUpdateBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanCallback): void; - - /** - * Calls UpdateBackupPlan. - * @param request UpdateBackupPlanRequest message or plain object - * @returns Promise - */ - public updateBackupPlan(request: google.cloud.backupdr.v1.IUpdateBackupPlanRequest): Promise; - - /** - * Calls GetBackupPlan. - * @param request GetBackupPlanRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupPlan - */ - public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback): void; - - /** - * Calls GetBackupPlan. - * @param request GetBackupPlanRequest message or plain object - * @returns Promise - */ - public getBackupPlan(request: google.cloud.backupdr.v1.IGetBackupPlanRequest): Promise; - - /** - * Calls ListBackupPlans. - * @param request ListBackupPlansRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupPlansResponse - */ - public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback): void; - - /** - * Calls ListBackupPlans. - * @param request ListBackupPlansRequest message or plain object - * @returns Promise - */ - public listBackupPlans(request: google.cloud.backupdr.v1.IListBackupPlansRequest): Promise; - - /** - * Calls DeleteBackupPlan. - * @param request DeleteBackupPlanRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback): void; - - /** - * Calls DeleteBackupPlan. - * @param request DeleteBackupPlanRequest message or plain object - * @returns Promise - */ - public deleteBackupPlan(request: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): Promise; - - /** - * Calls GetBackupPlanRevision. - * @param request GetBackupPlanRevisionRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupPlanRevision - */ - public getBackupPlanRevision(request: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevisionCallback): void; - - /** - * Calls GetBackupPlanRevision. - * @param request GetBackupPlanRevisionRequest message or plain object - * @returns Promise - */ - public getBackupPlanRevision(request: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest): Promise; - - /** - * Calls ListBackupPlanRevisions. - * @param request ListBackupPlanRevisionsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupPlanRevisionsResponse - */ - public listBackupPlanRevisions(request: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisionsCallback): void; - - /** - * Calls ListBackupPlanRevisions. - * @param request ListBackupPlanRevisionsRequest message or plain object - * @returns Promise - */ - public listBackupPlanRevisions(request: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest): Promise; - - /** - * Calls CreateBackupPlanAssociation. - * @param request CreateBackupPlanAssociationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback): void; - - /** - * Calls CreateBackupPlanAssociation. - * @param request CreateBackupPlanAssociationRequest message or plain object - * @returns Promise - */ - public createBackupPlanAssociation(request: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): Promise; - - /** - * Calls UpdateBackupPlanAssociation. - * @param request UpdateBackupPlanAssociationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public updateBackupPlanAssociation(request: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociationCallback): void; - - /** - * Calls UpdateBackupPlanAssociation. - * @param request UpdateBackupPlanAssociationRequest message or plain object - * @returns Promise - */ - public updateBackupPlanAssociation(request: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest): Promise; - - /** - * Calls GetBackupPlanAssociation. - * @param request GetBackupPlanAssociationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and BackupPlanAssociation - */ - public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback): void; - - /** - * Calls GetBackupPlanAssociation. - * @param request GetBackupPlanAssociationRequest message or plain object - * @returns Promise - */ - public getBackupPlanAssociation(request: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): Promise; - - /** - * Calls ListBackupPlanAssociations. - * @param request ListBackupPlanAssociationsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse - */ - public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, callback: google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback): void; - - /** - * Calls ListBackupPlanAssociations. - * @param request ListBackupPlanAssociationsRequest message or plain object - * @returns Promise - */ - public listBackupPlanAssociations(request: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): Promise; - - /** - * Calls FetchBackupPlanAssociationsForResourceType. - * @param request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchBackupPlanAssociationsForResourceTypeResponse - */ - public fetchBackupPlanAssociationsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceTypeCallback): void; - - /** - * Calls FetchBackupPlanAssociationsForResourceType. - * @param request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object - * @returns Promise - */ - public fetchBackupPlanAssociationsForResourceType(request: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest): Promise; - - /** - * Calls DeleteBackupPlanAssociation. - * @param request DeleteBackupPlanAssociationRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, callback: google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback): void; - - /** - * Calls DeleteBackupPlanAssociation. - * @param request DeleteBackupPlanAssociationRequest message or plain object - * @returns Promise - */ - public deleteBackupPlanAssociation(request: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): Promise; - - /** - * Calls TriggerBackup. - * @param request TriggerBackupRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest, callback: google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback): void; - - /** - * Calls TriggerBackup. - * @param request TriggerBackupRequest message or plain object - * @returns Promise - */ - public triggerBackup(request: google.cloud.backupdr.v1.ITriggerBackupRequest): Promise; - - /** - * Calls GetDataSourceReference. - * @param request GetDataSourceReferenceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and DataSourceReference - */ - public getDataSourceReference(request: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, callback: google.cloud.backupdr.v1.BackupDR.GetDataSourceReferenceCallback): void; - - /** - * Calls GetDataSourceReference. - * @param request GetDataSourceReferenceRequest message or plain object - * @returns Promise - */ - public getDataSourceReference(request: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest): Promise; - - /** - * Calls ListDataSourceReferences. - * @param request ListDataSourceReferencesRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListDataSourceReferencesResponse - */ - public listDataSourceReferences(request: google.cloud.backupdr.v1.IListDataSourceReferencesRequest, callback: google.cloud.backupdr.v1.BackupDR.ListDataSourceReferencesCallback): void; - - /** - * Calls ListDataSourceReferences. - * @param request ListDataSourceReferencesRequest message or plain object - * @returns Promise - */ - public listDataSourceReferences(request: google.cloud.backupdr.v1.IListDataSourceReferencesRequest): Promise; - - /** - * Calls FetchDataSourceReferencesForResourceType. - * @param request FetchDataSourceReferencesForResourceTypeRequest message or plain object - * @param callback Node-style callback called with the error, if any, and FetchDataSourceReferencesForResourceTypeResponse - */ - public fetchDataSourceReferencesForResourceType(request: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, callback: google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceTypeCallback): void; - - /** - * Calls FetchDataSourceReferencesForResourceType. - * @param request FetchDataSourceReferencesForResourceTypeRequest message or plain object - * @returns Promise - */ - public fetchDataSourceReferencesForResourceType(request: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest): Promise; - - /** - * Calls InitializeService. - * @param request InitializeServiceRequest message or plain object - * @param callback Node-style callback called with the error, if any, and Operation - */ - public initializeService(request: google.cloud.backupdr.v1.IInitializeServiceRequest, callback: google.cloud.backupdr.v1.BackupDR.InitializeServiceCallback): void; - - /** - * Calls InitializeService. - * @param request InitializeServiceRequest message or plain object - * @returns Promise - */ - public initializeService(request: google.cloud.backupdr.v1.IInitializeServiceRequest): Promise; - } - - namespace BackupDR { - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. - * @param error Error, if any - * @param [response] ListManagementServersResponse - */ - type ListManagementServersCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListManagementServersResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. - * @param error Error, if any - * @param [response] ManagementServer - */ - type GetManagementServerCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ManagementServer) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteManagementServerCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. - * @param error Error, if any - * @param [response] ListBackupVaultsResponse - */ - type ListBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupVaultsResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. - * @param error Error, if any - * @param [response] FetchUsableBackupVaultsResponse - */ - type FetchUsableBackupVaultsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. - * @param error Error, if any - * @param [response] BackupVault - */ - type GetBackupVaultCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupVault) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupVaultCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. - * @param error Error, if any - * @param [response] ListDataSourcesResponse - */ - type ListDataSourcesCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListDataSourcesResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. - * @param error Error, if any - * @param [response] DataSource - */ - type GetDataSourceCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.DataSource) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateDataSourceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. - * @param error Error, if any - * @param [response] ListBackupsResponse - */ - type ListBackupsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupsResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupsForResourceType}. - * @param error Error, if any - * @param [response] FetchBackupsForResourceTypeResponse - */ - type FetchBackupsForResourceTypeCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. - * @param error Error, if any - * @param [response] Backup - */ - type GetBackupCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.Backup) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type RestoreBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlan}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. - * @param error Error, if any - * @param [response] BackupPlan - */ - type GetBackupPlanCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlan) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. - * @param error Error, if any - * @param [response] ListBackupPlansResponse - */ - type ListBackupPlansCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlansResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupPlanCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanRevision}. - * @param error Error, if any - * @param [response] BackupPlanRevision - */ - type GetBackupPlanRevisionCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlanRevision) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanRevisions}. - * @param error Error, if any - * @param [response] ListBackupPlanRevisionsResponse - */ - type ListBackupPlanRevisionsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. - * @param error Error, if any - * @param [response] Operation - */ - type CreateBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlanAssociation}. - * @param error Error, if any - * @param [response] Operation - */ - type UpdateBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. - * @param error Error, if any - * @param [response] BackupPlanAssociation - */ - type GetBackupPlanAssociationCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.BackupPlanAssociation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. - * @param error Error, if any - * @param [response] ListBackupPlanAssociationsResponse - */ - type ListBackupPlanAssociationsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupPlanAssociationsForResourceType}. - * @param error Error, if any - * @param [response] FetchBackupPlanAssociationsForResourceTypeResponse - */ - type FetchBackupPlanAssociationsForResourceTypeCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. - * @param error Error, if any - * @param [response] Operation - */ - type DeleteBackupPlanAssociationCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. - * @param error Error, if any - * @param [response] Operation - */ - type TriggerBackupCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSourceReference}. - * @param error Error, if any - * @param [response] DataSourceReference - */ - type GetDataSourceReferenceCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.DataSourceReference) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSourceReferences}. - * @param error Error, if any - * @param [response] ListDataSourceReferencesResponse - */ - type ListDataSourceReferencesCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListDataSourceReferencesResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchDataSourceReferencesForResourceType}. - * @param error Error, if any - * @param [response] FetchDataSourceReferencesForResourceTypeResponse - */ - type FetchDataSourceReferencesForResourceTypeCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse) => void; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|initializeService}. - * @param error Error, if any - * @param [response] Operation - */ - type InitializeServiceCallback = (error: (Error|null), response?: google.longrunning.Operation) => void; - } - - /** Properties of a NetworkConfig. */ - interface INetworkConfig { - - /** NetworkConfig network */ - network?: (string|null); - - /** NetworkConfig peeringMode */ - peeringMode?: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null); - } - - /** Represents a NetworkConfig. */ - class NetworkConfig implements INetworkConfig { - - /** - * Constructs a new NetworkConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.INetworkConfig); - - /** NetworkConfig network. */ - public network: string; - - /** NetworkConfig peeringMode. */ - public peeringMode: (google.cloud.backupdr.v1.NetworkConfig.PeeringMode|keyof typeof google.cloud.backupdr.v1.NetworkConfig.PeeringMode); - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.INetworkConfig): google.cloud.backupdr.v1.NetworkConfig; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @param message NetworkConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkConfig; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkConfig; - - /** - * Verifies a NetworkConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkConfig; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @param message NetworkConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.NetworkConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace NetworkConfig { - - /** PeeringMode enum. */ - enum PeeringMode { - PEERING_MODE_UNSPECIFIED = 0, - PRIVATE_SERVICE_ACCESS = 1 - } - } - - /** Properties of a ManagementURI. */ - interface IManagementURI { - - /** ManagementURI webUi */ - webUi?: (string|null); - - /** ManagementURI api */ - api?: (string|null); - } - - /** Represents a ManagementURI. */ - class ManagementURI implements IManagementURI { - - /** - * Constructs a new ManagementURI. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IManagementURI); - - /** ManagementURI webUi. */ - public webUi: string; - - /** ManagementURI api. */ - public api: string; - - /** - * Creates a new ManagementURI instance using the specified properties. - * @param [properties] Properties to set - * @returns ManagementURI instance - */ - public static create(properties?: google.cloud.backupdr.v1.IManagementURI): google.cloud.backupdr.v1.ManagementURI; - - /** - * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @param message ManagementURI message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @param message ManagementURI message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ManagementURI message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementURI; - - /** - * Decodes a ManagementURI message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementURI; - - /** - * Verifies a ManagementURI message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ManagementURI - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementURI; - - /** - * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. - * @param message ManagementURI - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ManagementURI to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ManagementURI - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkforceIdentityBasedManagementURI. */ - interface IWorkforceIdentityBasedManagementURI { - - /** WorkforceIdentityBasedManagementURI firstPartyManagementUri */ - firstPartyManagementUri?: (string|null); - - /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri */ - thirdPartyManagementUri?: (string|null); - } - - /** Represents a WorkforceIdentityBasedManagementURI. */ - class WorkforceIdentityBasedManagementURI implements IWorkforceIdentityBasedManagementURI { - - /** - * Constructs a new WorkforceIdentityBasedManagementURI. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI); - - /** WorkforceIdentityBasedManagementURI firstPartyManagementUri. */ - public firstPartyManagementUri: string; - - /** WorkforceIdentityBasedManagementURI thirdPartyManagementUri. */ - public thirdPartyManagementUri: string; - - /** - * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkforceIdentityBasedManagementURI instance - */ - public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; - - /** - * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @param message WorkforceIdentityBasedManagementURI message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @param message WorkforceIdentityBasedManagementURI message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkforceIdentityBasedManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; - - /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkforceIdentityBasedManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; - - /** - * Verifies a WorkforceIdentityBasedManagementURI message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkforceIdentityBasedManagementURI - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI; - - /** - * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. - * @param message WorkforceIdentityBasedManagementURI - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkforceIdentityBasedManagementURI to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkforceIdentityBasedManagementURI - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WorkforceIdentityBasedOAuth2ClientID. */ - interface IWorkforceIdentityBasedOAuth2ClientID { - - /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId */ - firstPartyOauth2ClientId?: (string|null); - - /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId */ - thirdPartyOauth2ClientId?: (string|null); - } - - /** Represents a WorkforceIdentityBasedOAuth2ClientID. */ - class WorkforceIdentityBasedOAuth2ClientID implements IWorkforceIdentityBasedOAuth2ClientID { - - /** - * Constructs a new WorkforceIdentityBasedOAuth2ClientID. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID); - - /** WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. */ - public firstPartyOauth2ClientId: string; - - /** WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. */ - public thirdPartyOauth2ClientId: string; - - /** - * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. - * @param [properties] Properties to set - * @returns WorkforceIdentityBasedOAuth2ClientID instance - */ - public static create(properties?: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; - - /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @param message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WorkforceIdentityBasedOAuth2ClientID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; - - /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WorkforceIdentityBasedOAuth2ClientID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; - - /** - * Verifies a WorkforceIdentityBasedOAuth2ClientID message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WorkforceIdentityBasedOAuth2ClientID - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID; - - /** - * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. - * @param message WorkforceIdentityBasedOAuth2ClientID - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ManagementServer. */ - interface IManagementServer { - - /** ManagementServer name */ - name?: (string|null); - - /** ManagementServer description */ - description?: (string|null); - - /** ManagementServer labels */ - labels?: ({ [k: string]: string }|null); - - /** ManagementServer createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer type */ - type?: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType|null); - - /** ManagementServer managementUri */ - managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); - - /** ManagementServer workforceIdentityBasedManagementUri */ - workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); - - /** ManagementServer state */ - state?: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState|null); - - /** ManagementServer networks */ - networks?: (google.cloud.backupdr.v1.INetworkConfig[]|null); - - /** ManagementServer etag */ - etag?: (string|null); - - /** ManagementServer oauth2ClientId */ - oauth2ClientId?: (string|null); - - /** ManagementServer workforceIdentityBasedOauth2ClientId */ - workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); - - /** ManagementServer baProxyUri */ - baProxyUri?: (string[]|null); - - /** ManagementServer satisfiesPzs */ - satisfiesPzs?: (google.protobuf.IBoolValue|null); - - /** ManagementServer satisfiesPzi */ - satisfiesPzi?: (boolean|null); - } - - /** Represents a ManagementServer. */ - class ManagementServer implements IManagementServer { - - /** - * Constructs a new ManagementServer. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IManagementServer); - - /** ManagementServer name. */ - public name: string; - - /** ManagementServer description. */ - public description: string; - - /** ManagementServer labels. */ - public labels: { [k: string]: string }; - - /** ManagementServer createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** ManagementServer type. */ - public type: (google.cloud.backupdr.v1.ManagementServer.InstanceType|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceType); - - /** ManagementServer managementUri. */ - public managementUri?: (google.cloud.backupdr.v1.IManagementURI|null); - - /** ManagementServer workforceIdentityBasedManagementUri. */ - public workforceIdentityBasedManagementUri?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null); - - /** ManagementServer state. */ - public state: (google.cloud.backupdr.v1.ManagementServer.InstanceState|keyof typeof google.cloud.backupdr.v1.ManagementServer.InstanceState); - - /** ManagementServer networks. */ - public networks: google.cloud.backupdr.v1.INetworkConfig[]; - - /** ManagementServer etag. */ - public etag: string; - - /** ManagementServer oauth2ClientId. */ - public oauth2ClientId: string; - - /** ManagementServer workforceIdentityBasedOauth2ClientId. */ - public workforceIdentityBasedOauth2ClientId?: (google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null); - - /** ManagementServer baProxyUri. */ - public baProxyUri: string[]; - - /** ManagementServer satisfiesPzs. */ - public satisfiesPzs?: (google.protobuf.IBoolValue|null); - - /** ManagementServer satisfiesPzi. */ - public satisfiesPzi: boolean; - - /** - * Creates a new ManagementServer instance using the specified properties. - * @param [properties] Properties to set - * @returns ManagementServer instance - */ - public static create(properties?: google.cloud.backupdr.v1.IManagementServer): google.cloud.backupdr.v1.ManagementServer; - - /** - * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @param message ManagementServer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @param message ManagementServer message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IManagementServer, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ManagementServer message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ManagementServer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ManagementServer; - - /** - * Decodes a ManagementServer message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ManagementServer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ManagementServer; - - /** - * Verifies a ManagementServer message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ManagementServer - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ManagementServer; - - /** - * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. - * @param message ManagementServer - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ManagementServer, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ManagementServer to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ManagementServer - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ManagementServer { - - /** InstanceType enum. */ - enum InstanceType { - INSTANCE_TYPE_UNSPECIFIED = 0, - BACKUP_RESTORE = 1 - } - - /** InstanceState enum. */ - enum InstanceState { - INSTANCE_STATE_UNSPECIFIED = 0, - CREATING = 1, - READY = 2, - UPDATING = 3, - DELETING = 4, - REPAIRING = 5, - MAINTENANCE = 6, - ERROR = 7 - } - } - - /** Properties of a ListManagementServersRequest. */ - interface IListManagementServersRequest { - - /** ListManagementServersRequest parent */ - parent?: (string|null); - - /** ListManagementServersRequest pageSize */ - pageSize?: (number|null); - - /** ListManagementServersRequest pageToken */ - pageToken?: (string|null); - - /** ListManagementServersRequest filter */ - filter?: (string|null); - - /** ListManagementServersRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListManagementServersRequest. */ - class ListManagementServersRequest implements IListManagementServersRequest { - - /** - * Constructs a new ListManagementServersRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListManagementServersRequest); - - /** ListManagementServersRequest parent. */ - public parent: string; - - /** ListManagementServersRequest pageSize. */ - public pageSize: number; - - /** ListManagementServersRequest pageToken. */ - public pageToken: string; - - /** ListManagementServersRequest filter. */ - public filter?: (string|null); - - /** ListManagementServersRequest orderBy. */ - public orderBy?: (string|null); - - /** - * Creates a new ListManagementServersRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListManagementServersRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListManagementServersRequest): google.cloud.backupdr.v1.ListManagementServersRequest; - - /** - * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @param message ListManagementServersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @param message ListManagementServersRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListManagementServersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersRequest; - - /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListManagementServersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersRequest; - - /** - * Verifies a ListManagementServersRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListManagementServersRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersRequest; - - /** - * Creates a plain object from a ListManagementServersRequest message. Also converts values to other types if specified. - * @param message ListManagementServersRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListManagementServersRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListManagementServersRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListManagementServersRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListManagementServersResponse. */ - interface IListManagementServersResponse { - - /** ListManagementServersResponse managementServers */ - managementServers?: (google.cloud.backupdr.v1.IManagementServer[]|null); - - /** ListManagementServersResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListManagementServersResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListManagementServersResponse. */ - class ListManagementServersResponse implements IListManagementServersResponse { - - /** - * Constructs a new ListManagementServersResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListManagementServersResponse); - - /** ListManagementServersResponse managementServers. */ - public managementServers: google.cloud.backupdr.v1.IManagementServer[]; - - /** ListManagementServersResponse nextPageToken. */ - public nextPageToken: string; - - /** ListManagementServersResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListManagementServersResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListManagementServersResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListManagementServersResponse): google.cloud.backupdr.v1.ListManagementServersResponse; - - /** - * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @param message ListManagementServersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @param message ListManagementServersResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListManagementServersResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListManagementServersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListManagementServersResponse; - - /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListManagementServersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListManagementServersResponse; - - /** - * Verifies a ListManagementServersResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListManagementServersResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListManagementServersResponse; - - /** - * Creates a plain object from a ListManagementServersResponse message. Also converts values to other types if specified. - * @param message ListManagementServersResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListManagementServersResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListManagementServersResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListManagementServersResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetManagementServerRequest. */ - interface IGetManagementServerRequest { - - /** GetManagementServerRequest name */ - name?: (string|null); - } - - /** Represents a GetManagementServerRequest. */ - class GetManagementServerRequest implements IGetManagementServerRequest { - - /** - * Constructs a new GetManagementServerRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest); - - /** GetManagementServerRequest name. */ - public name: string; - - /** - * Creates a new GetManagementServerRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetManagementServerRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetManagementServerRequest): google.cloud.backupdr.v1.GetManagementServerRequest; - - /** - * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @param message GetManagementServerRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @param message GetManagementServerRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetManagementServerRequest; - - /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetManagementServerRequest; - - /** - * Verifies a GetManagementServerRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetManagementServerRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetManagementServerRequest; - - /** - * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. - * @param message GetManagementServerRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetManagementServerRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetManagementServerRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CreateManagementServerRequest. */ - interface ICreateManagementServerRequest { - - /** CreateManagementServerRequest parent */ - parent?: (string|null); - - /** CreateManagementServerRequest managementServerId */ - managementServerId?: (string|null); - - /** CreateManagementServerRequest managementServer */ - managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); - - /** CreateManagementServerRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateManagementServerRequest. */ - class CreateManagementServerRequest implements ICreateManagementServerRequest { - - /** - * Constructs a new CreateManagementServerRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest); - - /** CreateManagementServerRequest parent. */ - public parent: string; - - /** CreateManagementServerRequest managementServerId. */ - public managementServerId: string; - - /** CreateManagementServerRequest managementServer. */ - public managementServer?: (google.cloud.backupdr.v1.IManagementServer|null); - - /** CreateManagementServerRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateManagementServerRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateManagementServerRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICreateManagementServerRequest): google.cloud.backupdr.v1.CreateManagementServerRequest; - - /** - * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @param message CreateManagementServerRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @param message CreateManagementServerRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateManagementServerRequest; - - /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateManagementServerRequest; - - /** - * Verifies a CreateManagementServerRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateManagementServerRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateManagementServerRequest; - - /** - * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. - * @param message CreateManagementServerRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CreateManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateManagementServerRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateManagementServerRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteManagementServerRequest. */ - interface IDeleteManagementServerRequest { - - /** DeleteManagementServerRequest name */ - name?: (string|null); - - /** DeleteManagementServerRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteManagementServerRequest. */ - class DeleteManagementServerRequest implements IDeleteManagementServerRequest { - - /** - * Constructs a new DeleteManagementServerRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest); - - /** DeleteManagementServerRequest name. */ - public name: string; - - /** DeleteManagementServerRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteManagementServerRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteManagementServerRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteManagementServerRequest): google.cloud.backupdr.v1.DeleteManagementServerRequest; - - /** - * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @param message DeleteManagementServerRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @param message DeleteManagementServerRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteManagementServerRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteManagementServerRequest; - - /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteManagementServerRequest; - - /** - * Verifies a DeleteManagementServerRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteManagementServerRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteManagementServerRequest; - - /** - * Creates a plain object from a DeleteManagementServerRequest message. Also converts values to other types if specified. - * @param message DeleteManagementServerRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DeleteManagementServerRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteManagementServerRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteManagementServerRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InitializeServiceRequest. */ - interface IInitializeServiceRequest { - - /** InitializeServiceRequest name */ - name?: (string|null); - - /** InitializeServiceRequest resourceType */ - resourceType?: (string|null); - - /** InitializeServiceRequest requestId */ - requestId?: (string|null); - - /** InitializeServiceRequest cloudSqlInstanceInitializationConfig */ - cloudSqlInstanceInitializationConfig?: (google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null); - } - - /** Represents an InitializeServiceRequest. */ - class InitializeServiceRequest implements IInitializeServiceRequest { - - /** - * Constructs a new InitializeServiceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IInitializeServiceRequest); - - /** InitializeServiceRequest name. */ - public name: string; - - /** InitializeServiceRequest resourceType. */ - public resourceType: string; - - /** InitializeServiceRequest requestId. */ - public requestId: string; - - /** InitializeServiceRequest cloudSqlInstanceInitializationConfig. */ - public cloudSqlInstanceInitializationConfig?: (google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null); - - /** InitializeServiceRequest initializationConfig. */ - public initializationConfig?: "cloudSqlInstanceInitializationConfig"; - - /** - * Creates a new InitializeServiceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns InitializeServiceRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IInitializeServiceRequest): google.cloud.backupdr.v1.InitializeServiceRequest; - - /** - * Encodes the specified InitializeServiceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. - * @param message InitializeServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IInitializeServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InitializeServiceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. - * @param message InitializeServiceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IInitializeServiceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InitializeServiceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InitializeServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InitializeServiceRequest; - - /** - * Decodes an InitializeServiceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InitializeServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InitializeServiceRequest; - - /** - * Verifies an InitializeServiceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InitializeServiceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InitializeServiceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InitializeServiceRequest; - - /** - * Creates a plain object from an InitializeServiceRequest message. Also converts values to other types if specified. - * @param message InitializeServiceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.InitializeServiceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InitializeServiceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InitializeServiceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InitializeServiceResponse. */ - interface IInitializeServiceResponse { - - /** InitializeServiceResponse backupVaultName */ - backupVaultName?: (string|null); - - /** InitializeServiceResponse backupPlanName */ - backupPlanName?: (string|null); - } - - /** Represents an InitializeServiceResponse. */ - class InitializeServiceResponse implements IInitializeServiceResponse { - - /** - * Constructs a new InitializeServiceResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IInitializeServiceResponse); - - /** InitializeServiceResponse backupVaultName. */ - public backupVaultName: string; - - /** InitializeServiceResponse backupPlanName. */ - public backupPlanName: string; - - /** - * Creates a new InitializeServiceResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns InitializeServiceResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IInitializeServiceResponse): google.cloud.backupdr.v1.InitializeServiceResponse; - - /** - * Encodes the specified InitializeServiceResponse message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. - * @param message InitializeServiceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IInitializeServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InitializeServiceResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. - * @param message InitializeServiceResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IInitializeServiceResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InitializeServiceResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InitializeServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InitializeServiceResponse; - - /** - * Decodes an InitializeServiceResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InitializeServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InitializeServiceResponse; - - /** - * Verifies an InitializeServiceResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InitializeServiceResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InitializeServiceResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InitializeServiceResponse; - - /** - * Creates a plain object from an InitializeServiceResponse message. Also converts values to other types if specified. - * @param message InitializeServiceResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.InitializeServiceResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InitializeServiceResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InitializeServiceResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an OperationMetadata. */ - interface IOperationMetadata { - - /** OperationMetadata createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime */ - endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target */ - target?: (string|null); - - /** OperationMetadata verb */ - verb?: (string|null); - - /** OperationMetadata statusMessage */ - statusMessage?: (string|null); - - /** OperationMetadata requestedCancellation */ - requestedCancellation?: (boolean|null); - - /** OperationMetadata apiVersion */ - apiVersion?: (string|null); - - /** OperationMetadata additionalInfo */ - additionalInfo?: ({ [k: string]: string }|null); - } - - /** Represents an OperationMetadata. */ - class OperationMetadata implements IOperationMetadata { - - /** - * Constructs a new OperationMetadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IOperationMetadata); - - /** OperationMetadata createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata endTime. */ - public endTime?: (google.protobuf.ITimestamp|null); - - /** OperationMetadata target. */ - public target: string; - - /** OperationMetadata verb. */ - public verb: string; - - /** OperationMetadata statusMessage. */ - public statusMessage: string; - - /** OperationMetadata requestedCancellation. */ - public requestedCancellation: boolean; - - /** OperationMetadata apiVersion. */ - public apiVersion: string; - - /** OperationMetadata additionalInfo. */ - public additionalInfo: { [k: string]: string }; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @param [properties] Properties to set - * @returns OperationMetadata instance - */ - public static create(properties?: google.cloud.backupdr.v1.IOperationMetadata): google.cloud.backupdr.v1.OperationMetadata; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @param message OperationMetadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IOperationMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.OperationMetadata; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.OperationMetadata; - - /** - * Verifies an OperationMetadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OperationMetadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.OperationMetadata; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @param message OperationMetadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.OperationMetadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OperationMetadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OperationMetadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupPlan. */ - interface IBackupPlan { - - /** BackupPlan name */ - name?: (string|null); - - /** BackupPlan description */ - description?: (string|null); - - /** BackupPlan labels */ - labels?: ({ [k: string]: string }|null); - - /** BackupPlan createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlan updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlan backupRules */ - backupRules?: (google.cloud.backupdr.v1.IBackupRule[]|null); - - /** BackupPlan state */ - state?: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State|null); - - /** BackupPlan resourceType */ - resourceType?: (string|null); - - /** BackupPlan etag */ - etag?: (string|null); - - /** BackupPlan backupVault */ - backupVault?: (string|null); - - /** BackupPlan backupVaultServiceAccount */ - backupVaultServiceAccount?: (string|null); - - /** BackupPlan logRetentionDays */ - logRetentionDays?: (number|Long|string|null); - - /** BackupPlan supportedResourceTypes */ - supportedResourceTypes?: (string[]|null); - - /** BackupPlan revisionId */ - revisionId?: (string|null); - - /** BackupPlan revisionName */ - revisionName?: (string|null); - } - - /** Represents a BackupPlan. */ - class BackupPlan implements IBackupPlan { - - /** - * Constructs a new BackupPlan. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupPlan); - - /** BackupPlan name. */ - public name: string; - - /** BackupPlan description. */ - public description: string; - - /** BackupPlan labels. */ - public labels: { [k: string]: string }; - - /** BackupPlan createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlan updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlan backupRules. */ - public backupRules: google.cloud.backupdr.v1.IBackupRule[]; - - /** BackupPlan state. */ - public state: (google.cloud.backupdr.v1.BackupPlan.State|keyof typeof google.cloud.backupdr.v1.BackupPlan.State); - - /** BackupPlan resourceType. */ - public resourceType: string; - - /** BackupPlan etag. */ - public etag: string; - - /** BackupPlan backupVault. */ - public backupVault: string; - - /** BackupPlan backupVaultServiceAccount. */ - public backupVaultServiceAccount: string; - - /** BackupPlan logRetentionDays. */ - public logRetentionDays: (number|Long|string); - - /** BackupPlan supportedResourceTypes. */ - public supportedResourceTypes: string[]; - - /** BackupPlan revisionId. */ - public revisionId: string; - - /** BackupPlan revisionName. */ - public revisionName: string; - - /** - * Creates a new BackupPlan instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupPlan instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupPlan): google.cloud.backupdr.v1.BackupPlan; - - /** - * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. - * @param message BackupPlan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. - * @param message BackupPlan message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlan, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupPlan message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlan; - - /** - * Decodes a BackupPlan message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlan; - - /** - * Verifies a BackupPlan message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupPlan - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlan; - - /** - * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. - * @param message BackupPlan - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupPlan, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupPlan to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupPlan - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupPlan { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3, - INACTIVE = 4, - UPDATING = 5 - } - } - - /** Properties of a BackupRule. */ - interface IBackupRule { - - /** BackupRule ruleId */ - ruleId?: (string|null); - - /** BackupRule backupRetentionDays */ - backupRetentionDays?: (number|null); - - /** BackupRule standardSchedule */ - standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); - } - - /** Represents a BackupRule. */ - class BackupRule implements IBackupRule { - - /** - * Constructs a new BackupRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupRule); - - /** BackupRule ruleId. */ - public ruleId: string; - - /** BackupRule backupRetentionDays. */ - public backupRetentionDays: number; - - /** BackupRule standardSchedule. */ - public standardSchedule?: (google.cloud.backupdr.v1.IStandardSchedule|null); - - /** BackupRule backupScheduleOneof. */ - public backupScheduleOneof?: "standardSchedule"; - - /** - * Creates a new BackupRule instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupRule instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupRule): google.cloud.backupdr.v1.BackupRule; - - /** - * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. - * @param message BackupRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. - * @param message BackupRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupRule; - - /** - * Decodes a BackupRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupRule; - - /** - * Verifies a BackupRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupRule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupRule; - - /** - * Creates a plain object from a BackupRule message. Also converts values to other types if specified. - * @param message BackupRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a StandardSchedule. */ - interface IStandardSchedule { - - /** StandardSchedule recurrenceType */ - recurrenceType?: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null); - - /** StandardSchedule hourlyFrequency */ - hourlyFrequency?: (number|null); - - /** StandardSchedule daysOfWeek */ - daysOfWeek?: (google.type.DayOfWeek[]|null); - - /** StandardSchedule daysOfMonth */ - daysOfMonth?: (number[]|null); - - /** StandardSchedule weekDayOfMonth */ - weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); - - /** StandardSchedule months */ - months?: (google.type.Month[]|null); - - /** StandardSchedule backupWindow */ - backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); - - /** StandardSchedule timeZone */ - timeZone?: (string|null); - } - - /** Represents a StandardSchedule. */ - class StandardSchedule implements IStandardSchedule { - - /** - * Constructs a new StandardSchedule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IStandardSchedule); - - /** StandardSchedule recurrenceType. */ - public recurrenceType: (google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|keyof typeof google.cloud.backupdr.v1.StandardSchedule.RecurrenceType); - - /** StandardSchedule hourlyFrequency. */ - public hourlyFrequency: number; - - /** StandardSchedule daysOfWeek. */ - public daysOfWeek: google.type.DayOfWeek[]; - - /** StandardSchedule daysOfMonth. */ - public daysOfMonth: number[]; - - /** StandardSchedule weekDayOfMonth. */ - public weekDayOfMonth?: (google.cloud.backupdr.v1.IWeekDayOfMonth|null); - - /** StandardSchedule months. */ - public months: google.type.Month[]; - - /** StandardSchedule backupWindow. */ - public backupWindow?: (google.cloud.backupdr.v1.IBackupWindow|null); - - /** StandardSchedule timeZone. */ - public timeZone: string; - - /** - * Creates a new StandardSchedule instance using the specified properties. - * @param [properties] Properties to set - * @returns StandardSchedule instance - */ - public static create(properties?: google.cloud.backupdr.v1.IStandardSchedule): google.cloud.backupdr.v1.StandardSchedule; - - /** - * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. - * @param message StandardSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. - * @param message StandardSchedule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IStandardSchedule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a StandardSchedule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns StandardSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.StandardSchedule; - - /** - * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns StandardSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.StandardSchedule; - - /** - * Verifies a StandardSchedule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns StandardSchedule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.StandardSchedule; - - /** - * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. - * @param message StandardSchedule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.StandardSchedule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this StandardSchedule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for StandardSchedule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace StandardSchedule { - - /** RecurrenceType enum. */ - enum RecurrenceType { - RECURRENCE_TYPE_UNSPECIFIED = 0, - HOURLY = 1, - DAILY = 2, - WEEKLY = 3, - MONTHLY = 4, - YEARLY = 5 - } - } - - /** Properties of a BackupWindow. */ - interface IBackupWindow { - - /** BackupWindow startHourOfDay */ - startHourOfDay?: (number|null); - - /** BackupWindow endHourOfDay */ - endHourOfDay?: (number|null); - } - - /** Represents a BackupWindow. */ - class BackupWindow implements IBackupWindow { - - /** - * Constructs a new BackupWindow. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupWindow); - - /** BackupWindow startHourOfDay. */ - public startHourOfDay: number; - - /** BackupWindow endHourOfDay. */ - public endHourOfDay: number; - - /** - * Creates a new BackupWindow instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupWindow instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupWindow): google.cloud.backupdr.v1.BackupWindow; - - /** - * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. - * @param message BackupWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. - * @param message BackupWindow message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupWindow, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupWindow message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupWindow; - - /** - * Decodes a BackupWindow message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupWindow; - - /** - * Verifies a BackupWindow message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupWindow - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupWindow; - - /** - * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. - * @param message BackupWindow - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupWindow, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupWindow to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupWindow - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a WeekDayOfMonth. */ - interface IWeekDayOfMonth { - - /** WeekDayOfMonth weekOfMonth */ - weekOfMonth?: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null); - - /** WeekDayOfMonth dayOfWeek */ - dayOfWeek?: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek|null); - } - - /** Represents a WeekDayOfMonth. */ - class WeekDayOfMonth implements IWeekDayOfMonth { - - /** - * Constructs a new WeekDayOfMonth. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth); - - /** WeekDayOfMonth weekOfMonth. */ - public weekOfMonth: (google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|keyof typeof google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth); - - /** WeekDayOfMonth dayOfWeek. */ - public dayOfWeek: (google.type.DayOfWeek|keyof typeof google.type.DayOfWeek); - - /** - * Creates a new WeekDayOfMonth instance using the specified properties. - * @param [properties] Properties to set - * @returns WeekDayOfMonth instance - */ - public static create(properties?: google.cloud.backupdr.v1.IWeekDayOfMonth): google.cloud.backupdr.v1.WeekDayOfMonth; - - /** - * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. - * @param message WeekDayOfMonth message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. - * @param message WeekDayOfMonth message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IWeekDayOfMonth, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a WeekDayOfMonth message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns WeekDayOfMonth - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.WeekDayOfMonth; - - /** - * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns WeekDayOfMonth - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.WeekDayOfMonth; - - /** - * Verifies a WeekDayOfMonth message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns WeekDayOfMonth - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.WeekDayOfMonth; - - /** - * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. - * @param message WeekDayOfMonth - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.WeekDayOfMonth, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this WeekDayOfMonth to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for WeekDayOfMonth - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace WeekDayOfMonth { - - /** WeekOfMonth enum. */ - enum WeekOfMonth { - WEEK_OF_MONTH_UNSPECIFIED = 0, - FIRST = 1, - SECOND = 2, - THIRD = 3, - FOURTH = 4, - LAST = 5 - } - } - - /** Properties of a CreateBackupPlanRequest. */ - interface ICreateBackupPlanRequest { - - /** CreateBackupPlanRequest parent */ - parent?: (string|null); - - /** CreateBackupPlanRequest backupPlanId */ - backupPlanId?: (string|null); - - /** CreateBackupPlanRequest backupPlan */ - backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); - - /** CreateBackupPlanRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateBackupPlanRequest. */ - class CreateBackupPlanRequest implements ICreateBackupPlanRequest { - - /** - * Constructs a new CreateBackupPlanRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest); - - /** CreateBackupPlanRequest parent. */ - public parent: string; - - /** CreateBackupPlanRequest backupPlanId. */ - public backupPlanId: string; - - /** CreateBackupPlanRequest backupPlan. */ - public backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); - - /** CreateBackupPlanRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateBackupPlanRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupPlanRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanRequest): google.cloud.backupdr.v1.CreateBackupPlanRequest; - - /** - * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. - * @param message CreateBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. - * @param message CreateBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanRequest; - - /** - * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanRequest; - - /** - * Verifies a CreateBackupPlanRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupPlanRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanRequest; - - /** - * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. - * @param message CreateBackupPlanRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupPlanRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupPlanRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupPlansRequest. */ - interface IListBackupPlansRequest { - - /** ListBackupPlansRequest parent */ - parent?: (string|null); - - /** ListBackupPlansRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupPlansRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupPlansRequest filter */ - filter?: (string|null); - - /** ListBackupPlansRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListBackupPlansRequest. */ - class ListBackupPlansRequest implements IListBackupPlansRequest { - - /** - * Constructs a new ListBackupPlansRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest); - - /** ListBackupPlansRequest parent. */ - public parent: string; - - /** ListBackupPlansRequest pageSize. */ - public pageSize: number; - - /** ListBackupPlansRequest pageToken. */ - public pageToken: string; - - /** ListBackupPlansRequest filter. */ - public filter: string; - - /** ListBackupPlansRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListBackupPlansRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupPlansRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansRequest): google.cloud.backupdr.v1.ListBackupPlansRequest; - - /** - * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. - * @param message ListBackupPlansRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. - * @param message ListBackupPlansRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupPlansRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupPlansRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansRequest; - - /** - * Decodes a ListBackupPlansRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupPlansRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansRequest; - - /** - * Verifies a ListBackupPlansRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupPlansRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansRequest; - - /** - * Creates a plain object from a ListBackupPlansRequest message. Also converts values to other types if specified. - * @param message ListBackupPlansRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupPlansRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupPlansRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupPlansResponse. */ - interface IListBackupPlansResponse { - - /** ListBackupPlansResponse backupPlans */ - backupPlans?: (google.cloud.backupdr.v1.IBackupPlan[]|null); - - /** ListBackupPlansResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupPlansResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupPlansResponse. */ - class ListBackupPlansResponse implements IListBackupPlansResponse { - - /** - * Constructs a new ListBackupPlansResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse); - - /** ListBackupPlansResponse backupPlans. */ - public backupPlans: google.cloud.backupdr.v1.IBackupPlan[]; - - /** ListBackupPlansResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupPlansResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupPlansResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupPlansResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupPlansResponse): google.cloud.backupdr.v1.ListBackupPlansResponse; - - /** - * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. - * @param message ListBackupPlansResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. - * @param message ListBackupPlansResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlansResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupPlansResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupPlansResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlansResponse; - - /** - * Decodes a ListBackupPlansResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupPlansResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlansResponse; - - /** - * Verifies a ListBackupPlansResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupPlansResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlansResponse; - - /** - * Creates a plain object from a ListBackupPlansResponse message. Also converts values to other types if specified. - * @param message ListBackupPlansResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupPlansResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupPlansResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupPlansResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupPlanRequest. */ - interface IGetBackupPlanRequest { - - /** GetBackupPlanRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupPlanRequest. */ - class GetBackupPlanRequest implements IGetBackupPlanRequest { - - /** - * Constructs a new GetBackupPlanRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest); - - /** GetBackupPlanRequest name. */ - public name: string; - - /** - * Creates a new GetBackupPlanRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupPlanRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanRequest): google.cloud.backupdr.v1.GetBackupPlanRequest; - - /** - * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. - * @param message GetBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. - * @param message GetBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupPlanRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanRequest; - - /** - * Decodes a GetBackupPlanRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanRequest; - - /** - * Verifies a GetBackupPlanRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupPlanRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanRequest; - - /** - * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. - * @param message GetBackupPlanRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupPlanRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupPlanRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupPlanRequest. */ - interface IDeleteBackupPlanRequest { - - /** DeleteBackupPlanRequest name */ - name?: (string|null); - - /** DeleteBackupPlanRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteBackupPlanRequest. */ - class DeleteBackupPlanRequest implements IDeleteBackupPlanRequest { - - /** - * Constructs a new DeleteBackupPlanRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest); - - /** DeleteBackupPlanRequest name. */ - public name: string; - - /** DeleteBackupPlanRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteBackupPlanRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupPlanRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanRequest): google.cloud.backupdr.v1.DeleteBackupPlanRequest; - - /** - * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. - * @param message DeleteBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. - * @param message DeleteBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanRequest; - - /** - * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanRequest; - - /** - * Verifies a DeleteBackupPlanRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupPlanRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanRequest; - - /** - * Creates a plain object from a DeleteBackupPlanRequest message. Also converts values to other types if specified. - * @param message DeleteBackupPlanRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupPlanRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupPlanRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupPlanRequest. */ - interface IUpdateBackupPlanRequest { - - /** UpdateBackupPlanRequest backupPlan */ - backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); - - /** UpdateBackupPlanRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupPlanRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateBackupPlanRequest. */ - class UpdateBackupPlanRequest implements IUpdateBackupPlanRequest { - - /** - * Constructs a new UpdateBackupPlanRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanRequest); - - /** UpdateBackupPlanRequest backupPlan. */ - public backupPlan?: (google.cloud.backupdr.v1.IBackupPlan|null); - - /** UpdateBackupPlanRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupPlanRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateBackupPlanRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupPlanRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanRequest): google.cloud.backupdr.v1.UpdateBackupPlanRequest; - - /** - * Encodes the specified UpdateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. - * @param message UpdateBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IUpdateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. - * @param message UpdateBackupPlanRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupPlanRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupPlanRequest; - - /** - * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupPlanRequest; - - /** - * Verifies an UpdateBackupPlanRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupPlanRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupPlanRequest; - - /** - * Creates a plain object from an UpdateBackupPlanRequest message. Also converts values to other types if specified. - * @param message UpdateBackupPlanRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.UpdateBackupPlanRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupPlanRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupPlanRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupPlanRevision. */ - interface IBackupPlanRevision { - - /** BackupPlanRevision name */ - name?: (string|null); - - /** BackupPlanRevision revisionId */ - revisionId?: (string|null); - - /** BackupPlanRevision state */ - state?: (google.cloud.backupdr.v1.BackupPlanRevision.State|keyof typeof google.cloud.backupdr.v1.BackupPlanRevision.State|null); - - /** BackupPlanRevision backupPlanSnapshot */ - backupPlanSnapshot?: (google.cloud.backupdr.v1.IBackupPlan|null); - - /** BackupPlanRevision createTime */ - createTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupPlanRevision. */ - class BackupPlanRevision implements IBackupPlanRevision { - - /** - * Constructs a new BackupPlanRevision. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupPlanRevision); - - /** BackupPlanRevision name. */ - public name: string; - - /** BackupPlanRevision revisionId. */ - public revisionId: string; - - /** BackupPlanRevision state. */ - public state: (google.cloud.backupdr.v1.BackupPlanRevision.State|keyof typeof google.cloud.backupdr.v1.BackupPlanRevision.State); - - /** BackupPlanRevision backupPlanSnapshot. */ - public backupPlanSnapshot?: (google.cloud.backupdr.v1.IBackupPlan|null); - - /** BackupPlanRevision createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BackupPlanRevision instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupPlanRevision instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupPlanRevision): google.cloud.backupdr.v1.BackupPlanRevision; - - /** - * Encodes the specified BackupPlanRevision message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. - * @param message BackupPlanRevision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupPlanRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupPlanRevision message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. - * @param message BackupPlanRevision message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlanRevision, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupPlanRevision message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupPlanRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlanRevision; - - /** - * Decodes a BackupPlanRevision message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupPlanRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlanRevision; - - /** - * Verifies a BackupPlanRevision message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupPlanRevision message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupPlanRevision - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlanRevision; - - /** - * Creates a plain object from a BackupPlanRevision message. Also converts values to other types if specified. - * @param message BackupPlanRevision - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupPlanRevision, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupPlanRevision to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupPlanRevision - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupPlanRevision { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3, - INACTIVE = 4 - } - } - - /** Properties of a GetBackupPlanRevisionRequest. */ - interface IGetBackupPlanRevisionRequest { - - /** GetBackupPlanRevisionRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupPlanRevisionRequest. */ - class GetBackupPlanRevisionRequest implements IGetBackupPlanRevisionRequest { - - /** - * Constructs a new GetBackupPlanRevisionRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest); - - /** GetBackupPlanRevisionRequest name. */ - public name: string; - - /** - * Creates a new GetBackupPlanRevisionRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupPlanRevisionRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; - - /** - * Encodes the specified GetBackupPlanRevisionRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. - * @param message GetBackupPlanRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupPlanRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. - * @param message GetBackupPlanRevisionRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupPlanRevisionRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupPlanRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; - - /** - * Decodes a GetBackupPlanRevisionRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupPlanRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; - - /** - * Verifies a GetBackupPlanRevisionRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupPlanRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupPlanRevisionRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanRevisionRequest; - - /** - * Creates a plain object from a GetBackupPlanRevisionRequest message. Also converts values to other types if specified. - * @param message GetBackupPlanRevisionRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanRevisionRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupPlanRevisionRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupPlanRevisionRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupPlanRevisionsRequest. */ - interface IListBackupPlanRevisionsRequest { - - /** ListBackupPlanRevisionsRequest parent */ - parent?: (string|null); - - /** ListBackupPlanRevisionsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupPlanRevisionsRequest pageToken */ - pageToken?: (string|null); - } - - /** Represents a ListBackupPlanRevisionsRequest. */ - class ListBackupPlanRevisionsRequest implements IListBackupPlanRevisionsRequest { - - /** - * Constructs a new ListBackupPlanRevisionsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest); - - /** ListBackupPlanRevisionsRequest parent. */ - public parent: string; - - /** ListBackupPlanRevisionsRequest pageSize. */ - public pageSize: number; - - /** ListBackupPlanRevisionsRequest pageToken. */ - public pageToken: string; - - /** - * Creates a new ListBackupPlanRevisionsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupPlanRevisionsRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; - - /** - * Encodes the specified ListBackupPlanRevisionsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. - * @param message ListBackupPlanRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupPlanRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. - * @param message ListBackupPlanRevisionsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupPlanRevisionsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupPlanRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; - - /** - * Decodes a ListBackupPlanRevisionsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupPlanRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; - - /** - * Verifies a ListBackupPlanRevisionsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupPlanRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupPlanRevisionsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest; - - /** - * Creates a plain object from a ListBackupPlanRevisionsRequest message. Also converts values to other types if specified. - * @param message ListBackupPlanRevisionsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupPlanRevisionsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupPlanRevisionsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupPlanRevisionsResponse. */ - interface IListBackupPlanRevisionsResponse { - - /** ListBackupPlanRevisionsResponse backupPlanRevisions */ - backupPlanRevisions?: (google.cloud.backupdr.v1.IBackupPlanRevision[]|null); - - /** ListBackupPlanRevisionsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupPlanRevisionsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupPlanRevisionsResponse. */ - class ListBackupPlanRevisionsResponse implements IListBackupPlanRevisionsResponse { - - /** - * Constructs a new ListBackupPlanRevisionsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse); - - /** ListBackupPlanRevisionsResponse backupPlanRevisions. */ - public backupPlanRevisions: google.cloud.backupdr.v1.IBackupPlanRevision[]; - - /** ListBackupPlanRevisionsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupPlanRevisionsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupPlanRevisionsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupPlanRevisionsResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; - - /** - * Encodes the specified ListBackupPlanRevisionsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. - * @param message ListBackupPlanRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupPlanRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. - * @param message ListBackupPlanRevisionsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupPlanRevisionsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupPlanRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; - - /** - * Decodes a ListBackupPlanRevisionsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupPlanRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; - - /** - * Verifies a ListBackupPlanRevisionsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupPlanRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupPlanRevisionsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse; - - /** - * Creates a plain object from a ListBackupPlanRevisionsResponse message. Also converts values to other types if specified. - * @param message ListBackupPlanRevisionsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupPlanRevisionsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupPlanRevisionsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupPlanAssociation. */ - interface IBackupPlanAssociation { - - /** BackupPlanAssociation name */ - name?: (string|null); - - /** BackupPlanAssociation resourceType */ - resourceType?: (string|null); - - /** BackupPlanAssociation resource */ - resource?: (string|null); - - /** BackupPlanAssociation backupPlan */ - backupPlan?: (string|null); - - /** BackupPlanAssociation createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlanAssociation updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlanAssociation state */ - state?: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State|null); - - /** BackupPlanAssociation rulesConfigInfo */ - rulesConfigInfo?: (google.cloud.backupdr.v1.IRuleConfigInfo[]|null); - - /** BackupPlanAssociation dataSource */ - dataSource?: (string|null); - - /** BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties */ - cloudSqlInstanceBackupPlanAssociationProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null); - - /** BackupPlanAssociation backupPlanRevisionId */ - backupPlanRevisionId?: (string|null); - - /** BackupPlanAssociation backupPlanRevisionName */ - backupPlanRevisionName?: (string|null); - } - - /** Represents a BackupPlanAssociation. */ - class BackupPlanAssociation implements IBackupPlanAssociation { - - /** - * Constructs a new BackupPlanAssociation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation); - - /** BackupPlanAssociation name. */ - public name: string; - - /** BackupPlanAssociation resourceType. */ - public resourceType: string; - - /** BackupPlanAssociation resource. */ - public resource: string; - - /** BackupPlanAssociation backupPlan. */ - public backupPlan: string; - - /** BackupPlanAssociation createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlanAssociation updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupPlanAssociation state. */ - public state: (google.cloud.backupdr.v1.BackupPlanAssociation.State|keyof typeof google.cloud.backupdr.v1.BackupPlanAssociation.State); - - /** BackupPlanAssociation rulesConfigInfo. */ - public rulesConfigInfo: google.cloud.backupdr.v1.IRuleConfigInfo[]; - - /** BackupPlanAssociation dataSource. */ - public dataSource: string; - - /** BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties. */ - public cloudSqlInstanceBackupPlanAssociationProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null); - - /** BackupPlanAssociation backupPlanRevisionId. */ - public backupPlanRevisionId: string; - - /** BackupPlanAssociation backupPlanRevisionName. */ - public backupPlanRevisionName: string; - - /** BackupPlanAssociation resourceProperties. */ - public resourceProperties?: "cloudSqlInstanceBackupPlanAssociationProperties"; - - /** - * Creates a new BackupPlanAssociation instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupPlanAssociation instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupPlanAssociation): google.cloud.backupdr.v1.BackupPlanAssociation; - - /** - * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. - * @param message BackupPlanAssociation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. - * @param message BackupPlanAssociation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupPlanAssociation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupPlanAssociation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupPlanAssociation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupPlanAssociation; - - /** - * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupPlanAssociation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupPlanAssociation; - - /** - * Verifies a BackupPlanAssociation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupPlanAssociation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupPlanAssociation; - - /** - * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. - * @param message BackupPlanAssociation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupPlanAssociation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupPlanAssociation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupPlanAssociation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupPlanAssociation { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3, - INACTIVE = 4, - UPDATING = 5 - } - } - - /** Properties of a RuleConfigInfo. */ - interface IRuleConfigInfo { - - /** RuleConfigInfo ruleId */ - ruleId?: (string|null); - - /** RuleConfigInfo lastBackupState */ - lastBackupState?: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null); - - /** RuleConfigInfo lastBackupError */ - lastBackupError?: (google.rpc.IStatus|null); - - /** RuleConfigInfo lastSuccessfulBackupConsistencyTime */ - lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a RuleConfigInfo. */ - class RuleConfigInfo implements IRuleConfigInfo { - - /** - * Constructs a new RuleConfigInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IRuleConfigInfo); - - /** RuleConfigInfo ruleId. */ - public ruleId: string; - - /** RuleConfigInfo lastBackupState. */ - public lastBackupState: (google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState); - - /** RuleConfigInfo lastBackupError. */ - public lastBackupError?: (google.rpc.IStatus|null); - - /** RuleConfigInfo lastSuccessfulBackupConsistencyTime. */ - public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new RuleConfigInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns RuleConfigInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.IRuleConfigInfo): google.cloud.backupdr.v1.RuleConfigInfo; - - /** - * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. - * @param message RuleConfigInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. - * @param message RuleConfigInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IRuleConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RuleConfigInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RuleConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RuleConfigInfo; - - /** - * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RuleConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RuleConfigInfo; - - /** - * Verifies a RuleConfigInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RuleConfigInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RuleConfigInfo; - - /** - * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. - * @param message RuleConfigInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.RuleConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RuleConfigInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RuleConfigInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace RuleConfigInfo { - - /** LastBackupState enum. */ - enum LastBackupState { - LAST_BACKUP_STATE_UNSPECIFIED = 0, - FIRST_BACKUP_PENDING = 1, - PERMISSION_DENIED = 2, - SUCCEEDED = 3, - FAILED = 4 - } - } - - /** Properties of a CreateBackupPlanAssociationRequest. */ - interface ICreateBackupPlanAssociationRequest { - - /** CreateBackupPlanAssociationRequest parent */ - parent?: (string|null); - - /** CreateBackupPlanAssociationRequest backupPlanAssociationId */ - backupPlanAssociationId?: (string|null); - - /** CreateBackupPlanAssociationRequest backupPlanAssociation */ - backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); - - /** CreateBackupPlanAssociationRequest requestId */ - requestId?: (string|null); - } - - /** Represents a CreateBackupPlanAssociationRequest. */ - class CreateBackupPlanAssociationRequest implements ICreateBackupPlanAssociationRequest { - - /** - * Constructs a new CreateBackupPlanAssociationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest); - - /** CreateBackupPlanAssociationRequest parent. */ - public parent: string; - - /** CreateBackupPlanAssociationRequest backupPlanAssociationId. */ - public backupPlanAssociationId: string; - - /** CreateBackupPlanAssociationRequest backupPlanAssociation. */ - public backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); - - /** CreateBackupPlanAssociationRequest requestId. */ - public requestId: string; - - /** - * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupPlanAssociationRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; - - /** - * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. - * @param message CreateBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. - * @param message CreateBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; - - /** - * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; - - /** - * Verifies a CreateBackupPlanAssociationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupPlanAssociationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest; - - /** - * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @param message CreateBackupPlanAssociationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupPlanAssociationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupPlanAssociationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupPlanAssociationsRequest. */ - interface IListBackupPlanAssociationsRequest { - - /** ListBackupPlanAssociationsRequest parent */ - parent?: (string|null); - - /** ListBackupPlanAssociationsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupPlanAssociationsRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupPlanAssociationsRequest filter */ - filter?: (string|null); - } - - /** Represents a ListBackupPlanAssociationsRequest. */ - class ListBackupPlanAssociationsRequest implements IListBackupPlanAssociationsRequest { - - /** - * Constructs a new ListBackupPlanAssociationsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest); - - /** ListBackupPlanAssociationsRequest parent. */ - public parent: string; - - /** ListBackupPlanAssociationsRequest pageSize. */ - public pageSize: number; - - /** ListBackupPlanAssociationsRequest pageToken. */ - public pageToken: string; - - /** ListBackupPlanAssociationsRequest filter. */ - public filter: string; - - /** - * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupPlanAssociationsRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; - - /** - * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. - * @param message ListBackupPlanAssociationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. - * @param message ListBackupPlanAssociationsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupPlanAssociationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; - - /** - * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupPlanAssociationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; - - /** - * Verifies a ListBackupPlanAssociationsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupPlanAssociationsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest; - - /** - * Creates a plain object from a ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. - * @param message ListBackupPlanAssociationsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupPlanAssociationsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupPlanAssociationsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupPlanAssociationsResponse. */ - interface IListBackupPlanAssociationsResponse { - - /** ListBackupPlanAssociationsResponse backupPlanAssociations */ - backupPlanAssociations?: (google.cloud.backupdr.v1.IBackupPlanAssociation[]|null); - - /** ListBackupPlanAssociationsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupPlanAssociationsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupPlanAssociationsResponse. */ - class ListBackupPlanAssociationsResponse implements IListBackupPlanAssociationsResponse { - - /** - * Constructs a new ListBackupPlanAssociationsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse); - - /** ListBackupPlanAssociationsResponse backupPlanAssociations. */ - public backupPlanAssociations: google.cloud.backupdr.v1.IBackupPlanAssociation[]; - - /** ListBackupPlanAssociationsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupPlanAssociationsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupPlanAssociationsResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; - - /** - * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. - * @param message ListBackupPlanAssociationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. - * @param message ListBackupPlanAssociationsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupPlanAssociationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; - - /** - * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupPlanAssociationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; - - /** - * Verifies a ListBackupPlanAssociationsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupPlanAssociationsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse; - - /** - * Creates a plain object from a ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. - * @param message ListBackupPlanAssociationsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupPlanAssociationsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupPlanAssociationsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchBackupPlanAssociationsForResourceTypeRequest. */ - interface IFetchBackupPlanAssociationsForResourceTypeRequest { - - /** FetchBackupPlanAssociationsForResourceTypeRequest parent */ - parent?: (string|null); - - /** FetchBackupPlanAssociationsForResourceTypeRequest resourceType */ - resourceType?: (string|null); - - /** FetchBackupPlanAssociationsForResourceTypeRequest pageSize */ - pageSize?: (number|null); - - /** FetchBackupPlanAssociationsForResourceTypeRequest pageToken */ - pageToken?: (string|null); - - /** FetchBackupPlanAssociationsForResourceTypeRequest filter */ - filter?: (string|null); - - /** FetchBackupPlanAssociationsForResourceTypeRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a FetchBackupPlanAssociationsForResourceTypeRequest. */ - class FetchBackupPlanAssociationsForResourceTypeRequest implements IFetchBackupPlanAssociationsForResourceTypeRequest { - - /** - * Constructs a new FetchBackupPlanAssociationsForResourceTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest); - - /** FetchBackupPlanAssociationsForResourceTypeRequest parent. */ - public parent: string; - - /** FetchBackupPlanAssociationsForResourceTypeRequest resourceType. */ - public resourceType: string; - - /** FetchBackupPlanAssociationsForResourceTypeRequest pageSize. */ - public pageSize: number; - - /** FetchBackupPlanAssociationsForResourceTypeRequest pageToken. */ - public pageToken: string; - - /** FetchBackupPlanAssociationsForResourceTypeRequest filter. */ - public filter: string; - - /** FetchBackupPlanAssociationsForResourceTypeRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new FetchBackupPlanAssociationsForResourceTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchBackupPlanAssociationsForResourceTypeRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. - * @param message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. - * @param message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchBackupPlanAssociationsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchBackupPlanAssociationsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; - - /** - * Verifies a FetchBackupPlanAssociationsForResourceTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchBackupPlanAssociationsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchBackupPlanAssociationsForResourceTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest; - - /** - * Creates a plain object from a FetchBackupPlanAssociationsForResourceTypeRequest message. Also converts values to other types if specified. - * @param message FetchBackupPlanAssociationsForResourceTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchBackupPlanAssociationsForResourceTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchBackupPlanAssociationsForResourceTypeResponse. */ - interface IFetchBackupPlanAssociationsForResourceTypeResponse { - - /** FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations */ - backupPlanAssociations?: (google.cloud.backupdr.v1.IBackupPlanAssociation[]|null); - - /** FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a FetchBackupPlanAssociationsForResourceTypeResponse. */ - class FetchBackupPlanAssociationsForResourceTypeResponse implements IFetchBackupPlanAssociationsForResourceTypeResponse { - - /** - * Constructs a new FetchBackupPlanAssociationsForResourceTypeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse); - - /** FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations. */ - public backupPlanAssociations: google.cloud.backupdr.v1.IBackupPlanAssociation[]; - - /** FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new FetchBackupPlanAssociationsForResourceTypeResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchBackupPlanAssociationsForResourceTypeResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. - * @param message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. - * @param message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchBackupPlanAssociationsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchBackupPlanAssociationsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; - - /** - * Verifies a FetchBackupPlanAssociationsForResourceTypeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchBackupPlanAssociationsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchBackupPlanAssociationsForResourceTypeResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse; - - /** - * Creates a plain object from a FetchBackupPlanAssociationsForResourceTypeResponse message. Also converts values to other types if specified. - * @param message FetchBackupPlanAssociationsForResourceTypeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchBackupPlanAssociationsForResourceTypeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupPlanAssociationRequest. */ - interface IGetBackupPlanAssociationRequest { - - /** GetBackupPlanAssociationRequest name */ - name?: (string|null); - } - - /** Represents a GetBackupPlanAssociationRequest. */ - class GetBackupPlanAssociationRequest implements IGetBackupPlanAssociationRequest { - - /** - * Constructs a new GetBackupPlanAssociationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest); - - /** GetBackupPlanAssociationRequest name. */ - public name: string; - - /** - * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupPlanAssociationRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; - - /** - * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. - * @param message GetBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. - * @param message GetBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; - - /** - * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; - - /** - * Verifies a GetBackupPlanAssociationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupPlanAssociationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupPlanAssociationRequest; - - /** - * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @param message GetBackupPlanAssociationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupPlanAssociationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupPlanAssociationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupPlanAssociationRequest. */ - interface IDeleteBackupPlanAssociationRequest { - - /** DeleteBackupPlanAssociationRequest name */ - name?: (string|null); - - /** DeleteBackupPlanAssociationRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteBackupPlanAssociationRequest. */ - class DeleteBackupPlanAssociationRequest implements IDeleteBackupPlanAssociationRequest { - - /** - * Constructs a new DeleteBackupPlanAssociationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest); - - /** DeleteBackupPlanAssociationRequest name. */ - public name: string; - - /** DeleteBackupPlanAssociationRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupPlanAssociationRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; - - /** - * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. - * @param message DeleteBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. - * @param message DeleteBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; - - /** - * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; - - /** - * Verifies a DeleteBackupPlanAssociationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupPlanAssociationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest; - - /** - * Creates a plain object from a DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @param message DeleteBackupPlanAssociationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupPlanAssociationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupPlanAssociationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupPlanAssociationRequest. */ - interface IUpdateBackupPlanAssociationRequest { - - /** UpdateBackupPlanAssociationRequest backupPlanAssociation */ - backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); - - /** UpdateBackupPlanAssociationRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupPlanAssociationRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateBackupPlanAssociationRequest. */ - class UpdateBackupPlanAssociationRequest implements IUpdateBackupPlanAssociationRequest { - - /** - * Constructs a new UpdateBackupPlanAssociationRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest); - - /** UpdateBackupPlanAssociationRequest backupPlanAssociation. */ - public backupPlanAssociation?: (google.cloud.backupdr.v1.IBackupPlanAssociation|null); - - /** UpdateBackupPlanAssociationRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupPlanAssociationRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateBackupPlanAssociationRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupPlanAssociationRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; - - /** - * Encodes the specified UpdateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. - * @param message UpdateBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. - * @param message UpdateBackupPlanAssociationRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; - - /** - * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; - - /** - * Verifies an UpdateBackupPlanAssociationRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupPlanAssociationRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest; - - /** - * Creates a plain object from an UpdateBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @param message UpdateBackupPlanAssociationRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupPlanAssociationRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupPlanAssociationRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TriggerBackupRequest. */ - interface ITriggerBackupRequest { - - /** TriggerBackupRequest name */ - name?: (string|null); - - /** TriggerBackupRequest ruleId */ - ruleId?: (string|null); - - /** TriggerBackupRequest requestId */ - requestId?: (string|null); - } - - /** Represents a TriggerBackupRequest. */ - class TriggerBackupRequest implements ITriggerBackupRequest { - - /** - * Constructs a new TriggerBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest); - - /** TriggerBackupRequest name. */ - public name: string; - - /** TriggerBackupRequest ruleId. */ - public ruleId: string; - - /** TriggerBackupRequest requestId. */ - public requestId: string; - - /** - * Creates a new TriggerBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns TriggerBackupRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.ITriggerBackupRequest): google.cloud.backupdr.v1.TriggerBackupRequest; - - /** - * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. - * @param message TriggerBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. - * @param message TriggerBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ITriggerBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TriggerBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TriggerBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TriggerBackupRequest; - - /** - * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TriggerBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TriggerBackupRequest; - - /** - * Verifies a TriggerBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TriggerBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TriggerBackupRequest; - - /** - * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. - * @param message TriggerBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.TriggerBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TriggerBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TriggerBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudSqlInstanceDataSourceProperties. */ - interface ICloudSqlInstanceDataSourceProperties { - - /** CloudSqlInstanceDataSourceProperties name */ - name?: (string|null); - - /** CloudSqlInstanceDataSourceProperties databaseInstalledVersion */ - databaseInstalledVersion?: (string|null); - - /** CloudSqlInstanceDataSourceProperties instanceCreateTime */ - instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** CloudSqlInstanceDataSourceProperties instanceTier */ - instanceTier?: (string|null); - } - - /** Represents a CloudSqlInstanceDataSourceProperties. */ - class CloudSqlInstanceDataSourceProperties implements ICloudSqlInstanceDataSourceProperties { - - /** - * Constructs a new CloudSqlInstanceDataSourceProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties); - - /** CloudSqlInstanceDataSourceProperties name. */ - public name: string; - - /** CloudSqlInstanceDataSourceProperties databaseInstalledVersion. */ - public databaseInstalledVersion: string; - - /** CloudSqlInstanceDataSourceProperties instanceCreateTime. */ - public instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** CloudSqlInstanceDataSourceProperties instanceTier. */ - public instanceTier: string; - - /** - * Creates a new CloudSqlInstanceDataSourceProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstanceDataSourceProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; - - /** - * Encodes the specified CloudSqlInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. - * @param message CloudSqlInstanceDataSourceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. - * @param message CloudSqlInstanceDataSourceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; - - /** - * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; - - /** - * Verifies a CloudSqlInstanceDataSourceProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstanceDataSourceProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties; - - /** - * Creates a plain object from a CloudSqlInstanceDataSourceProperties message. Also converts values to other types if specified. - * @param message CloudSqlInstanceDataSourceProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstanceDataSourceProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstanceDataSourceProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudSqlInstanceBackupProperties. */ - interface ICloudSqlInstanceBackupProperties { - - /** CloudSqlInstanceBackupProperties databaseInstalledVersion */ - databaseInstalledVersion?: (string|null); - - /** CloudSqlInstanceBackupProperties finalBackup */ - finalBackup?: (boolean|null); - - /** CloudSqlInstanceBackupProperties sourceInstance */ - sourceInstance?: (string|null); - - /** CloudSqlInstanceBackupProperties instanceCreateTime */ - instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** CloudSqlInstanceBackupProperties instanceTier */ - instanceTier?: (string|null); - - /** CloudSqlInstanceBackupProperties instanceDeleteTime */ - instanceDeleteTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CloudSqlInstanceBackupProperties. */ - class CloudSqlInstanceBackupProperties implements ICloudSqlInstanceBackupProperties { - - /** - * Constructs a new CloudSqlInstanceBackupProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties); - - /** CloudSqlInstanceBackupProperties databaseInstalledVersion. */ - public databaseInstalledVersion: string; - - /** CloudSqlInstanceBackupProperties finalBackup. */ - public finalBackup: boolean; - - /** CloudSqlInstanceBackupProperties sourceInstance. */ - public sourceInstance: string; - - /** CloudSqlInstanceBackupProperties instanceCreateTime. */ - public instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** CloudSqlInstanceBackupProperties instanceTier. */ - public instanceTier: string; - - /** CloudSqlInstanceBackupProperties instanceDeleteTime. */ - public instanceDeleteTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CloudSqlInstanceBackupProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstanceBackupProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; - - /** - * Encodes the specified CloudSqlInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. - * @param message CloudSqlInstanceBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. - * @param message CloudSqlInstanceBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; - - /** - * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; - - /** - * Verifies a CloudSqlInstanceBackupProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstanceBackupProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties; - - /** - * Creates a plain object from a CloudSqlInstanceBackupProperties message. Also converts values to other types if specified. - * @param message CloudSqlInstanceBackupProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstanceBackupProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstanceBackupProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudSqlInstanceDataSourceReferenceProperties. */ - interface ICloudSqlInstanceDataSourceReferenceProperties { - - /** CloudSqlInstanceDataSourceReferenceProperties name */ - name?: (string|null); - - /** CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion */ - databaseInstalledVersion?: (string|null); - - /** CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime */ - instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** CloudSqlInstanceDataSourceReferenceProperties instanceTier */ - instanceTier?: (string|null); - } - - /** Represents a CloudSqlInstanceDataSourceReferenceProperties. */ - class CloudSqlInstanceDataSourceReferenceProperties implements ICloudSqlInstanceDataSourceReferenceProperties { - - /** - * Constructs a new CloudSqlInstanceDataSourceReferenceProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties); - - /** CloudSqlInstanceDataSourceReferenceProperties name. */ - public name: string; - - /** CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion. */ - public databaseInstalledVersion: string; - - /** CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime. */ - public instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** CloudSqlInstanceDataSourceReferenceProperties instanceTier. */ - public instanceTier: string; - - /** - * Creates a new CloudSqlInstanceDataSourceReferenceProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstanceDataSourceReferenceProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; - - /** - * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. - * @param message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. - * @param message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstanceDataSourceReferenceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; - - /** - * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstanceDataSourceReferenceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; - - /** - * Verifies a CloudSqlInstanceDataSourceReferenceProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstanceDataSourceReferenceProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstanceDataSourceReferenceProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties; - - /** - * Creates a plain object from a CloudSqlInstanceDataSourceReferenceProperties message. Also converts values to other types if specified. - * @param message CloudSqlInstanceDataSourceReferenceProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstanceDataSourceReferenceProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstanceDataSourceReferenceProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CloudSqlInstanceInitializationConfig. */ - interface ICloudSqlInstanceInitializationConfig { - - /** CloudSqlInstanceInitializationConfig edition */ - edition?: (google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|keyof typeof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|null); - } - - /** Represents a CloudSqlInstanceInitializationConfig. */ - class CloudSqlInstanceInitializationConfig implements ICloudSqlInstanceInitializationConfig { - - /** - * Constructs a new CloudSqlInstanceInitializationConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig); - - /** CloudSqlInstanceInitializationConfig edition. */ - public edition: (google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|keyof typeof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition); - - /** - * Creates a new CloudSqlInstanceInitializationConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstanceInitializationConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; - - /** - * Encodes the specified CloudSqlInstanceInitializationConfig message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. - * @param message CloudSqlInstanceInitializationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstanceInitializationConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. - * @param message CloudSqlInstanceInitializationConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstanceInitializationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; - - /** - * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstanceInitializationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; - - /** - * Verifies a CloudSqlInstanceInitializationConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstanceInitializationConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstanceInitializationConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig; - - /** - * Creates a plain object from a CloudSqlInstanceInitializationConfig message. Also converts values to other types if specified. - * @param message CloudSqlInstanceInitializationConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstanceInitializationConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstanceInitializationConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace CloudSqlInstanceInitializationConfig { - - /** Edition enum. */ - enum Edition { - EDITION_UNSPECIFIED = 0, - ENTERPRISE = 1, - ENTERPRISE_PLUS = 2 - } - } - - /** Properties of a CloudSqlInstanceBackupPlanAssociationProperties. */ - interface ICloudSqlInstanceBackupPlanAssociationProperties { - - /** CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime */ - instanceCreateTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a CloudSqlInstanceBackupPlanAssociationProperties. */ - class CloudSqlInstanceBackupPlanAssociationProperties implements ICloudSqlInstanceBackupPlanAssociationProperties { - - /** - * Constructs a new CloudSqlInstanceBackupPlanAssociationProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties); - - /** CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime. */ - public instanceCreateTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new CloudSqlInstanceBackupPlanAssociationProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns CloudSqlInstanceBackupPlanAssociationProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; - - /** - * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. - * @param message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. - * @param message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CloudSqlInstanceBackupPlanAssociationProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; - - /** - * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CloudSqlInstanceBackupPlanAssociationProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; - - /** - * Verifies a CloudSqlInstanceBackupPlanAssociationProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CloudSqlInstanceBackupPlanAssociationProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CloudSqlInstanceBackupPlanAssociationProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties; - - /** - * Creates a plain object from a CloudSqlInstanceBackupPlanAssociationProperties message. Also converts values to other types if specified. - * @param message CloudSqlInstanceBackupPlanAssociationProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CloudSqlInstanceBackupPlanAssociationProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CloudSqlInstanceBackupPlanAssociationProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupVault. */ - interface IBackupVault { - - /** BackupVault name */ - name?: (string|null); - - /** BackupVault description */ - description?: (string|null); - - /** BackupVault labels */ - labels?: ({ [k: string]: string }|null); - - /** BackupVault createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** BackupVault updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupVault backupMinimumEnforcedRetentionDuration */ - backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); - - /** BackupVault backupRetentionInheritance */ - backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); - - /** BackupVault deletable */ - deletable?: (boolean|null); - - /** BackupVault etag */ - etag?: (string|null); - - /** BackupVault state */ - state?: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State|null); - - /** BackupVault effectiveTime */ - effectiveTime?: (google.protobuf.ITimestamp|null); - - /** BackupVault backupCount */ - backupCount?: (number|Long|string|null); - - /** BackupVault serviceAccount */ - serviceAccount?: (string|null); - - /** BackupVault totalStoredBytes */ - totalStoredBytes?: (number|Long|string|null); - - /** BackupVault uid */ - uid?: (string|null); - - /** BackupVault annotations */ - annotations?: ({ [k: string]: string }|null); - - /** BackupVault accessRestriction */ - accessRestriction?: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction|null); - - /** BackupVault encryptionConfig */ - encryptionConfig?: (google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null); - } - - /** Represents a BackupVault. */ - class BackupVault implements IBackupVault { - - /** - * Constructs a new BackupVault. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupVault); - - /** BackupVault name. */ - public name: string; - - /** BackupVault description. */ - public description?: (string|null); - - /** BackupVault labels. */ - public labels: { [k: string]: string }; - - /** BackupVault createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** BackupVault updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** BackupVault backupMinimumEnforcedRetentionDuration. */ - public backupMinimumEnforcedRetentionDuration?: (google.protobuf.IDuration|null); - - /** BackupVault backupRetentionInheritance. */ - public backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); - - /** BackupVault deletable. */ - public deletable?: (boolean|null); - - /** BackupVault etag. */ - public etag?: (string|null); - - /** BackupVault state. */ - public state: (google.cloud.backupdr.v1.BackupVault.State|keyof typeof google.cloud.backupdr.v1.BackupVault.State); - - /** BackupVault effectiveTime. */ - public effectiveTime?: (google.protobuf.ITimestamp|null); - - /** BackupVault backupCount. */ - public backupCount: (number|Long|string); - - /** BackupVault serviceAccount. */ - public serviceAccount: string; - - /** BackupVault totalStoredBytes. */ - public totalStoredBytes: (number|Long|string); - - /** BackupVault uid. */ - public uid: string; - - /** BackupVault annotations. */ - public annotations: { [k: string]: string }; - - /** BackupVault accessRestriction. */ - public accessRestriction: (google.cloud.backupdr.v1.BackupVault.AccessRestriction|keyof typeof google.cloud.backupdr.v1.BackupVault.AccessRestriction); - - /** BackupVault encryptionConfig. */ - public encryptionConfig?: (google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null); - - /** - * Creates a new BackupVault instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupVault instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupVault): google.cloud.backupdr.v1.BackupVault; - - /** - * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. - * @param message BackupVault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. - * @param message BackupVault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupVault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupVault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupVault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupVault; - - /** - * Decodes a BackupVault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupVault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupVault; - - /** - * Verifies a BackupVault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupVault - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupVault; - - /** - * Creates a plain object from a BackupVault message. Also converts values to other types if specified. - * @param message BackupVault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupVault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupVault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupVault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupVault { - - /** BackupRetentionInheritance enum. */ - enum BackupRetentionInheritance { - BACKUP_RETENTION_INHERITANCE_UNSPECIFIED = 0, - INHERIT_VAULT_RETENTION = 1, - MATCH_BACKUP_EXPIRE_TIME = 2 - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3, - ERROR = 4, - UPDATING = 5 - } - - /** AccessRestriction enum. */ - enum AccessRestriction { - ACCESS_RESTRICTION_UNSPECIFIED = 0, - WITHIN_PROJECT = 1, - WITHIN_ORGANIZATION = 2, - UNRESTRICTED = 3, - WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA = 4 - } - - /** Properties of an EncryptionConfig. */ - interface IEncryptionConfig { - - /** EncryptionConfig kmsKeyName */ - kmsKeyName?: (string|null); - } - - /** Represents an EncryptionConfig. */ - class EncryptionConfig implements IEncryptionConfig { - - /** - * Constructs a new EncryptionConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.BackupVault.IEncryptionConfig); - - /** EncryptionConfig kmsKeyName. */ - public kmsKeyName?: (string|null); - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns EncryptionConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.BackupVault.IEncryptionConfig): google.cloud.backupdr.v1.BackupVault.EncryptionConfig; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.IEncryptionConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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 DataSource. */ - interface IDataSource { - - /** DataSource name */ - name?: (string|null); - - /** DataSource state */ - state?: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State|null); - - /** DataSource labels */ - labels?: ({ [k: string]: string }|null); - - /** DataSource createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DataSource updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** DataSource backupCount */ - backupCount?: (number|Long|string|null); - - /** DataSource etag */ - etag?: (string|null); - - /** DataSource totalStoredBytes */ - totalStoredBytes?: (number|Long|string|null); - - /** DataSource configState */ - configState?: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState|null); - - /** DataSource backupConfigInfo */ - backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); - - /** DataSource dataSourceGcpResource */ - dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); - - /** DataSource dataSourceBackupApplianceApplication */ - dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); - - /** DataSource backupBlockedByVaultAccessRestriction */ - backupBlockedByVaultAccessRestriction?: (boolean|null); - } - - /** Represents a DataSource. */ - class DataSource implements IDataSource { - - /** - * Constructs a new DataSource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDataSource); - - /** DataSource name. */ - public name: string; - - /** DataSource state. */ - public state: (google.cloud.backupdr.v1.DataSource.State|keyof typeof google.cloud.backupdr.v1.DataSource.State); - - /** DataSource labels. */ - public labels: { [k: string]: string }; - - /** DataSource createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DataSource updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** DataSource backupCount. */ - public backupCount?: (number|Long|string|null); - - /** DataSource etag. */ - public etag?: (string|null); - - /** DataSource totalStoredBytes. */ - public totalStoredBytes?: (number|Long|string|null); - - /** DataSource configState. */ - public configState: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState); - - /** DataSource backupConfigInfo. */ - public backupConfigInfo?: (google.cloud.backupdr.v1.IBackupConfigInfo|null); - - /** DataSource dataSourceGcpResource. */ - public dataSourceGcpResource?: (google.cloud.backupdr.v1.IDataSourceGcpResource|null); - - /** DataSource dataSourceBackupApplianceApplication. */ - public dataSourceBackupApplianceApplication?: (google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null); - - /** DataSource backupBlockedByVaultAccessRestriction. */ - public backupBlockedByVaultAccessRestriction: boolean; - - /** DataSource sourceResource. */ - public sourceResource?: ("dataSourceGcpResource"|"dataSourceBackupApplianceApplication"); - - /** - * Creates a new DataSource instance using the specified properties. - * @param [properties] Properties to set - * @returns DataSource instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDataSource): google.cloud.backupdr.v1.DataSource; - - /** - * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. - * @param message DataSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. - * @param message DataSource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataSource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSource; - - /** - * Decodes a DataSource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSource; - - /** - * Verifies a DataSource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataSource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataSource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSource; - - /** - * Creates a plain object from a DataSource message. Also converts values to other types if specified. - * @param message DataSource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DataSource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataSource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataSource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DataSource { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3, - ERROR = 4 - } - } - - /** Properties of a BackupConfigInfo. */ - interface IBackupConfigInfo { - - /** BackupConfigInfo lastBackupState */ - lastBackupState?: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null); - - /** BackupConfigInfo lastSuccessfulBackupConsistencyTime */ - lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); - - /** BackupConfigInfo lastBackupError */ - lastBackupError?: (google.rpc.IStatus|null); - - /** BackupConfigInfo gcpBackupConfig */ - gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); - - /** BackupConfigInfo backupApplianceBackupConfig */ - backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); - } - - /** Represents a BackupConfigInfo. */ - class BackupConfigInfo implements IBackupConfigInfo { - - /** - * Constructs a new BackupConfigInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupConfigInfo); - - /** BackupConfigInfo lastBackupState. */ - public lastBackupState: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState); - - /** BackupConfigInfo lastSuccessfulBackupConsistencyTime. */ - public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); - - /** BackupConfigInfo lastBackupError. */ - public lastBackupError?: (google.rpc.IStatus|null); - - /** BackupConfigInfo gcpBackupConfig. */ - public gcpBackupConfig?: (google.cloud.backupdr.v1.IGcpBackupConfig|null); - - /** BackupConfigInfo backupApplianceBackupConfig. */ - public backupApplianceBackupConfig?: (google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null); - - /** BackupConfigInfo backupConfig. */ - public backupConfig?: ("gcpBackupConfig"|"backupApplianceBackupConfig"); - - /** - * Creates a new BackupConfigInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupConfigInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupConfigInfo): google.cloud.backupdr.v1.BackupConfigInfo; - - /** - * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. - * @param message BackupConfigInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. - * @param message BackupConfigInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupConfigInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigInfo; - - /** - * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigInfo; - - /** - * Verifies a BackupConfigInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupConfigInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigInfo; - - /** - * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. - * @param message BackupConfigInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupConfigInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupConfigInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupConfigInfo { - - /** LastBackupState enum. */ - enum LastBackupState { - LAST_BACKUP_STATE_UNSPECIFIED = 0, - FIRST_BACKUP_PENDING = 1, - SUCCEEDED = 2, - FAILED = 3, - PERMISSION_DENIED = 4 - } - } - - /** Properties of a GcpBackupConfig. */ - interface IGcpBackupConfig { - - /** GcpBackupConfig backupPlan */ - backupPlan?: (string|null); - - /** GcpBackupConfig backupPlanDescription */ - backupPlanDescription?: (string|null); - - /** GcpBackupConfig backupPlanAssociation */ - backupPlanAssociation?: (string|null); - - /** GcpBackupConfig backupPlanRules */ - backupPlanRules?: (string[]|null); - - /** GcpBackupConfig backupPlanRevisionName */ - backupPlanRevisionName?: (string|null); - - /** GcpBackupConfig backupPlanRevisionId */ - backupPlanRevisionId?: (string|null); - } - - /** Represents a GcpBackupConfig. */ - class GcpBackupConfig implements IGcpBackupConfig { - - /** - * Constructs a new GcpBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGcpBackupConfig); - - /** GcpBackupConfig backupPlan. */ - public backupPlan: string; - - /** GcpBackupConfig backupPlanDescription. */ - public backupPlanDescription: string; - - /** GcpBackupConfig backupPlanAssociation. */ - public backupPlanAssociation: string; - - /** GcpBackupConfig backupPlanRules. */ - public backupPlanRules: string[]; - - /** GcpBackupConfig backupPlanRevisionName. */ - public backupPlanRevisionName: string; - - /** GcpBackupConfig backupPlanRevisionId. */ - public backupPlanRevisionId: string; - - /** - * Creates a new GcpBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns GcpBackupConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGcpBackupConfig): google.cloud.backupdr.v1.GcpBackupConfig; - - /** - * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. - * @param message GcpBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. - * @param message GcpBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcpBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcpBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpBackupConfig; - - /** - * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcpBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpBackupConfig; - - /** - * Verifies a GcpBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcpBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpBackupConfig; - - /** - * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. - * @param message GcpBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GcpBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcpBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcpBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupApplianceBackupConfig. */ - interface IBackupApplianceBackupConfig { - - /** BackupApplianceBackupConfig backupApplianceName */ - backupApplianceName?: (string|null); - - /** BackupApplianceBackupConfig backupApplianceId */ - backupApplianceId?: (number|Long|string|null); - - /** BackupApplianceBackupConfig slaId */ - slaId?: (number|Long|string|null); - - /** BackupApplianceBackupConfig applicationName */ - applicationName?: (string|null); - - /** BackupApplianceBackupConfig hostName */ - hostName?: (string|null); - - /** BackupApplianceBackupConfig sltName */ - sltName?: (string|null); - - /** BackupApplianceBackupConfig slpName */ - slpName?: (string|null); - } - - /** Represents a BackupApplianceBackupConfig. */ - class BackupApplianceBackupConfig implements IBackupApplianceBackupConfig { - - /** - * Constructs a new BackupApplianceBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig); - - /** BackupApplianceBackupConfig backupApplianceName. */ - public backupApplianceName: string; - - /** BackupApplianceBackupConfig backupApplianceId. */ - public backupApplianceId: (number|Long|string); - - /** BackupApplianceBackupConfig slaId. */ - public slaId: (number|Long|string); - - /** BackupApplianceBackupConfig applicationName. */ - public applicationName: string; - - /** BackupApplianceBackupConfig hostName. */ - public hostName: string; - - /** BackupApplianceBackupConfig sltName. */ - public sltName: string; - - /** BackupApplianceBackupConfig slpName. */ - public slpName: string; - - /** - * Creates a new BackupApplianceBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupApplianceBackupConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupConfig): google.cloud.backupdr.v1.BackupApplianceBackupConfig; - - /** - * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. - * @param message BackupApplianceBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. - * @param message BackupApplianceBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupApplianceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupConfig; - - /** - * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupApplianceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupConfig; - - /** - * Verifies a BackupApplianceBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupApplianceBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupConfig; - - /** - * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. - * @param message BackupApplianceBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupApplianceBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupApplianceBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataSourceGcpResource. */ - interface IDataSourceGcpResource { - - /** DataSourceGcpResource gcpResourcename */ - gcpResourcename?: (string|null); - - /** DataSourceGcpResource location */ - location?: (string|null); - - /** DataSourceGcpResource type */ - type?: (string|null); - - /** DataSourceGcpResource computeInstanceDatasourceProperties */ - computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); - - /** DataSourceGcpResource cloudSqlInstanceDatasourceProperties */ - cloudSqlInstanceDatasourceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null); - - /** DataSourceGcpResource diskDatasourceProperties */ - diskDatasourceProperties?: (google.cloud.backupdr.v1.IDiskDataSourceProperties|null); - } - - /** Represents a DataSourceGcpResource. */ - class DataSourceGcpResource implements IDataSourceGcpResource { - - /** - * Constructs a new DataSourceGcpResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource); - - /** DataSourceGcpResource gcpResourcename. */ - public gcpResourcename: string; - - /** DataSourceGcpResource location. */ - public location: string; - - /** DataSourceGcpResource type. */ - public type: string; - - /** DataSourceGcpResource computeInstanceDatasourceProperties. */ - public computeInstanceDatasourceProperties?: (google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null); - - /** DataSourceGcpResource cloudSqlInstanceDatasourceProperties. */ - public cloudSqlInstanceDatasourceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null); - - /** DataSourceGcpResource diskDatasourceProperties. */ - public diskDatasourceProperties?: (google.cloud.backupdr.v1.IDiskDataSourceProperties|null); - - /** DataSourceGcpResource gcpResourceProperties. */ - public gcpResourceProperties?: ("computeInstanceDatasourceProperties"|"cloudSqlInstanceDatasourceProperties"|"diskDatasourceProperties"); - - /** - * Creates a new DataSourceGcpResource instance using the specified properties. - * @param [properties] Properties to set - * @returns DataSourceGcpResource instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDataSourceGcpResource): google.cloud.backupdr.v1.DataSourceGcpResource; - - /** - * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. - * @param message DataSourceGcpResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. - * @param message DataSourceGcpResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataSourceGcpResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataSourceGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceGcpResource; - - /** - * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataSourceGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceGcpResource; - - /** - * Verifies a DataSourceGcpResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataSourceGcpResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceGcpResource; - - /** - * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. - * @param message DataSourceGcpResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DataSourceGcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataSourceGcpResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataSourceGcpResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataSourceBackupApplianceApplication. */ - interface IDataSourceBackupApplianceApplication { - - /** DataSourceBackupApplianceApplication applicationName */ - applicationName?: (string|null); - - /** DataSourceBackupApplianceApplication backupAppliance */ - backupAppliance?: (string|null); - - /** DataSourceBackupApplianceApplication applianceId */ - applianceId?: (number|Long|string|null); - - /** DataSourceBackupApplianceApplication type */ - type?: (string|null); - - /** DataSourceBackupApplianceApplication applicationId */ - applicationId?: (number|Long|string|null); - - /** DataSourceBackupApplianceApplication hostname */ - hostname?: (string|null); - - /** DataSourceBackupApplianceApplication hostId */ - hostId?: (number|Long|string|null); - } - - /** Represents a DataSourceBackupApplianceApplication. */ - class DataSourceBackupApplianceApplication implements IDataSourceBackupApplianceApplication { - - /** - * Constructs a new DataSourceBackupApplianceApplication. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication); - - /** DataSourceBackupApplianceApplication applicationName. */ - public applicationName: string; - - /** DataSourceBackupApplianceApplication backupAppliance. */ - public backupAppliance: string; - - /** DataSourceBackupApplianceApplication applianceId. */ - public applianceId: (number|Long|string); - - /** DataSourceBackupApplianceApplication type. */ - public type: string; - - /** DataSourceBackupApplianceApplication applicationId. */ - public applicationId: (number|Long|string); - - /** DataSourceBackupApplianceApplication hostname. */ - public hostname: string; - - /** DataSourceBackupApplianceApplication hostId. */ - public hostId: (number|Long|string); - - /** - * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. - * @param [properties] Properties to set - * @returns DataSourceBackupApplianceApplication instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; - - /** - * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. - * @param message DataSourceBackupApplianceApplication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. - * @param message DataSourceBackupApplianceApplication message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataSourceBackupApplianceApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; - - /** - * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataSourceBackupApplianceApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; - - /** - * Verifies a DataSourceBackupApplianceApplication message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataSourceBackupApplianceApplication - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceBackupApplianceApplication; - - /** - * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. - * @param message DataSourceBackupApplianceApplication - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DataSourceBackupApplianceApplication, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataSourceBackupApplianceApplication to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataSourceBackupApplianceApplication - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceLockInfo. */ - interface IServiceLockInfo { - - /** ServiceLockInfo operation */ - operation?: (string|null); - } - - /** Represents a ServiceLockInfo. */ - class ServiceLockInfo implements IServiceLockInfo { - - /** - * Constructs a new ServiceLockInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IServiceLockInfo); - - /** ServiceLockInfo operation. */ - public operation: string; - - /** - * Creates a new ServiceLockInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceLockInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.IServiceLockInfo): google.cloud.backupdr.v1.ServiceLockInfo; - - /** - * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. - * @param message ServiceLockInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. - * @param message ServiceLockInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceLockInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceLockInfo; - - /** - * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceLockInfo; - - /** - * Verifies a ServiceLockInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceLockInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceLockInfo; - - /** - * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. - * @param message ServiceLockInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ServiceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceLockInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceLockInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupApplianceLockInfo. */ - interface IBackupApplianceLockInfo { - - /** BackupApplianceLockInfo backupApplianceId */ - backupApplianceId?: (number|Long|string|null); - - /** BackupApplianceLockInfo backupApplianceName */ - backupApplianceName?: (string|null); - - /** BackupApplianceLockInfo lockReason */ - lockReason?: (string|null); - - /** BackupApplianceLockInfo jobName */ - jobName?: (string|null); - - /** BackupApplianceLockInfo backupImage */ - backupImage?: (string|null); - - /** BackupApplianceLockInfo slaId */ - slaId?: (number|Long|string|null); - } - - /** Represents a BackupApplianceLockInfo. */ - class BackupApplianceLockInfo implements IBackupApplianceLockInfo { - - /** - * Constructs a new BackupApplianceLockInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo); - - /** BackupApplianceLockInfo backupApplianceId. */ - public backupApplianceId: (number|Long|string); - - /** BackupApplianceLockInfo backupApplianceName. */ - public backupApplianceName: string; - - /** BackupApplianceLockInfo lockReason. */ - public lockReason: string; - - /** BackupApplianceLockInfo jobName. */ - public jobName?: (string|null); - - /** BackupApplianceLockInfo backupImage. */ - public backupImage?: (string|null); - - /** BackupApplianceLockInfo slaId. */ - public slaId?: (number|Long|string|null); - - /** BackupApplianceLockInfo lockSource. */ - public lockSource?: ("jobName"|"backupImage"|"slaId"); - - /** - * Creates a new BackupApplianceLockInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupApplianceLockInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceLockInfo): google.cloud.backupdr.v1.BackupApplianceLockInfo; - - /** - * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. - * @param message BackupApplianceLockInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. - * @param message BackupApplianceLockInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceLockInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupApplianceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceLockInfo; - - /** - * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupApplianceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceLockInfo; - - /** - * Verifies a BackupApplianceLockInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupApplianceLockInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceLockInfo; - - /** - * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. - * @param message BackupApplianceLockInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupApplianceLockInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupApplianceLockInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupApplianceLockInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupLock. */ - interface IBackupLock { - - /** BackupLock lockUntilTime */ - lockUntilTime?: (google.protobuf.ITimestamp|null); - - /** BackupLock backupApplianceLockInfo */ - backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); - - /** BackupLock serviceLockInfo */ - serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); - } - - /** Represents a BackupLock. */ - class BackupLock implements IBackupLock { - - /** - * Constructs a new BackupLock. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupLock); - - /** BackupLock lockUntilTime. */ - public lockUntilTime?: (google.protobuf.ITimestamp|null); - - /** BackupLock backupApplianceLockInfo. */ - public backupApplianceLockInfo?: (google.cloud.backupdr.v1.IBackupApplianceLockInfo|null); - - /** BackupLock serviceLockInfo. */ - public serviceLockInfo?: (google.cloud.backupdr.v1.IServiceLockInfo|null); - - /** BackupLock ClientLockInfo. */ - public ClientLockInfo?: ("backupApplianceLockInfo"|"serviceLockInfo"); - - /** - * Creates a new BackupLock instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupLock instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupLock): google.cloud.backupdr.v1.BackupLock; - - /** - * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. - * @param message BackupLock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. - * @param message BackupLock message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLock, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupLock message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupLock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLock; - - /** - * Decodes a BackupLock message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupLock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLock; - - /** - * Verifies a BackupLock message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupLock - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLock; - - /** - * Creates a plain object from a BackupLock message. Also converts values to other types if specified. - * @param message BackupLock - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupLock, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupLock to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupLock - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Backup. */ - interface IBackup { - - /** Backup name */ - name?: (string|null); - - /** Backup description */ - description?: (string|null); - - /** Backup createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime */ - updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels */ - labels?: ({ [k: string]: string }|null); - - /** Backup enforcedRetentionEndTime */ - enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); - - /** Backup backupRetentionInheritance */ - backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); - - /** Backup expireTime */ - expireTime?: (google.protobuf.ITimestamp|null); - - /** Backup consistencyTime */ - consistencyTime?: (google.protobuf.ITimestamp|null); - - /** Backup etag */ - etag?: (string|null); - - /** Backup state */ - state?: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State|null); - - /** Backup serviceLocks */ - serviceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); - - /** Backup backupApplianceLocks */ - backupApplianceLocks?: (google.cloud.backupdr.v1.IBackupLock[]|null); - - /** Backup computeInstanceBackupProperties */ - computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); - - /** Backup cloudSqlInstanceBackupProperties */ - cloudSqlInstanceBackupProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null); - - /** Backup backupApplianceBackupProperties */ - backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); - - /** Backup diskBackupProperties */ - diskBackupProperties?: (google.cloud.backupdr.v1.IDiskBackupProperties|null); - - /** Backup backupType */ - backupType?: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType|null); - - /** Backup gcpBackupPlanInfo */ - gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); - - /** Backup resourceSizeBytes */ - resourceSizeBytes?: (number|Long|string|null); - - /** Backup satisfiesPzs */ - satisfiesPzs?: (boolean|null); - - /** Backup satisfiesPzi */ - satisfiesPzi?: (boolean|null); - - /** Backup gcpResource */ - gcpResource?: (google.cloud.backupdr.v1.IBackupGcpResource|null); - - /** Backup kmsKeyVersions */ - kmsKeyVersions?: (string[]|null); - } - - /** Represents a Backup. */ - class Backup implements IBackup { - - /** - * Constructs a new Backup. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackup); - - /** Backup name. */ - public name: string; - - /** Backup description. */ - public description?: (string|null); - - /** Backup createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** Backup updateTime. */ - public updateTime?: (google.protobuf.ITimestamp|null); - - /** Backup labels. */ - public labels: { [k: string]: string }; - - /** Backup enforcedRetentionEndTime. */ - public enforcedRetentionEndTime?: (google.protobuf.ITimestamp|null); - - /** Backup backupRetentionInheritance. */ - public backupRetentionInheritance?: (google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|keyof typeof google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null); - - /** Backup expireTime. */ - public expireTime?: (google.protobuf.ITimestamp|null); - - /** Backup consistencyTime. */ - public consistencyTime?: (google.protobuf.ITimestamp|null); - - /** Backup etag. */ - public etag?: (string|null); - - /** Backup state. */ - public state: (google.cloud.backupdr.v1.Backup.State|keyof typeof google.cloud.backupdr.v1.Backup.State); - - /** Backup serviceLocks. */ - public serviceLocks: google.cloud.backupdr.v1.IBackupLock[]; - - /** Backup backupApplianceLocks. */ - public backupApplianceLocks: google.cloud.backupdr.v1.IBackupLock[]; - - /** Backup computeInstanceBackupProperties. */ - public computeInstanceBackupProperties?: (google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null); - - /** Backup cloudSqlInstanceBackupProperties. */ - public cloudSqlInstanceBackupProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null); - - /** Backup backupApplianceBackupProperties. */ - public backupApplianceBackupProperties?: (google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null); - - /** Backup diskBackupProperties. */ - public diskBackupProperties?: (google.cloud.backupdr.v1.IDiskBackupProperties|null); - - /** Backup backupType. */ - public backupType: (google.cloud.backupdr.v1.Backup.BackupType|keyof typeof google.cloud.backupdr.v1.Backup.BackupType); - - /** Backup gcpBackupPlanInfo. */ - public gcpBackupPlanInfo?: (google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null); - - /** Backup resourceSizeBytes. */ - public resourceSizeBytes: (number|Long|string); - - /** Backup satisfiesPzs. */ - public satisfiesPzs?: (boolean|null); - - /** Backup satisfiesPzi. */ - public satisfiesPzi?: (boolean|null); - - /** Backup gcpResource. */ - public gcpResource?: (google.cloud.backupdr.v1.IBackupGcpResource|null); - - /** Backup kmsKeyVersions. */ - public kmsKeyVersions: string[]; - - /** Backup backupProperties. */ - public backupProperties?: ("computeInstanceBackupProperties"|"cloudSqlInstanceBackupProperties"|"backupApplianceBackupProperties"|"diskBackupProperties"); - - /** Backup planInfo. */ - public planInfo?: "gcpBackupPlanInfo"; - - /** Backup sourceResource. */ - public sourceResource?: "gcpResource"; - - /** - * Creates a new Backup instance using the specified properties. - * @param [properties] Properties to set - * @returns Backup instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackup): google.cloud.backupdr.v1.Backup; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. - * @param message Backup message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackup, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup; - - /** - * Verifies a Backup message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Backup - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @param message Backup - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Backup, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Backup to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Backup - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Backup { - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - CREATING = 1, - ACTIVE = 2, - DELETING = 3, - ERROR = 4, - UPLOADING = 5 - } - - /** BackupType enum. */ - enum BackupType { - BACKUP_TYPE_UNSPECIFIED = 0, - SCHEDULED = 1, - ON_DEMAND = 2, - ON_DEMAND_OPERATIONAL = 3 - } - - /** Properties of a GCPBackupPlanInfo. */ - interface IGCPBackupPlanInfo { - - /** GCPBackupPlanInfo backupPlan */ - backupPlan?: (string|null); - - /** GCPBackupPlanInfo backupPlanRuleId */ - backupPlanRuleId?: (string|null); - - /** GCPBackupPlanInfo backupPlanRevisionName */ - backupPlanRevisionName?: (string|null); - - /** GCPBackupPlanInfo backupPlanRevisionId */ - backupPlanRevisionId?: (string|null); - } - - /** Represents a GCPBackupPlanInfo. */ - class GCPBackupPlanInfo implements IGCPBackupPlanInfo { - - /** - * Constructs a new GCPBackupPlanInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo); - - /** GCPBackupPlanInfo backupPlan. */ - public backupPlan: string; - - /** GCPBackupPlanInfo backupPlanRuleId. */ - public backupPlanRuleId: string; - - /** GCPBackupPlanInfo backupPlanRevisionName. */ - public backupPlanRevisionName: string; - - /** GCPBackupPlanInfo backupPlanRevisionId. */ - public backupPlanRevisionId: string; - - /** - * Creates a new GCPBackupPlanInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GCPBackupPlanInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; - - /** - * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. - * @param message GCPBackupPlanInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. - * @param message GCPBackupPlanInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GCPBackupPlanInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; - - /** - * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GCPBackupPlanInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; - - /** - * Verifies a GCPBackupPlanInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GCPBackupPlanInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo; - - /** - * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. - * @param message GCPBackupPlanInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GCPBackupPlanInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GCPBackupPlanInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of a CreateBackupVaultRequest. */ - interface ICreateBackupVaultRequest { - - /** CreateBackupVaultRequest parent */ - parent?: (string|null); - - /** CreateBackupVaultRequest backupVaultId */ - backupVaultId?: (string|null); - - /** CreateBackupVaultRequest backupVault */ - backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); - - /** CreateBackupVaultRequest requestId */ - requestId?: (string|null); - - /** CreateBackupVaultRequest validateOnly */ - validateOnly?: (boolean|null); - } - - /** Represents a CreateBackupVaultRequest. */ - class CreateBackupVaultRequest implements ICreateBackupVaultRequest { - - /** - * Constructs a new CreateBackupVaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest); - - /** CreateBackupVaultRequest parent. */ - public parent: string; - - /** CreateBackupVaultRequest backupVaultId. */ - public backupVaultId: string; - - /** CreateBackupVaultRequest backupVault. */ - public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); - - /** CreateBackupVaultRequest requestId. */ - public requestId: string; - - /** CreateBackupVaultRequest validateOnly. */ - public validateOnly: boolean; - - /** - * Creates a new CreateBackupVaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns CreateBackupVaultRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICreateBackupVaultRequest): google.cloud.backupdr.v1.CreateBackupVaultRequest; - - /** - * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. - * @param message CreateBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. - * @param message CreateBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICreateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CreateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CreateBackupVaultRequest; - - /** - * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CreateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CreateBackupVaultRequest; - - /** - * Verifies a CreateBackupVaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CreateBackupVaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CreateBackupVaultRequest; - - /** - * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. - * @param message CreateBackupVaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CreateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CreateBackupVaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CreateBackupVaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupVaultsRequest. */ - interface IListBackupVaultsRequest { - - /** ListBackupVaultsRequest parent */ - parent?: (string|null); - - /** ListBackupVaultsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupVaultsRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupVaultsRequest filter */ - filter?: (string|null); - - /** ListBackupVaultsRequest orderBy */ - orderBy?: (string|null); - - /** ListBackupVaultsRequest view */ - view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); - } - - /** Represents a ListBackupVaultsRequest. */ - class ListBackupVaultsRequest implements IListBackupVaultsRequest { - - /** - * Constructs a new ListBackupVaultsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest); - - /** ListBackupVaultsRequest parent. */ - public parent: string; - - /** ListBackupVaultsRequest pageSize. */ - public pageSize: number; - - /** ListBackupVaultsRequest pageToken. */ - public pageToken: string; - - /** ListBackupVaultsRequest filter. */ - public filter: string; - - /** ListBackupVaultsRequest orderBy. */ - public orderBy: string; - - /** ListBackupVaultsRequest view. */ - public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); - - /** - * Creates a new ListBackupVaultsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupVaultsRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsRequest): google.cloud.backupdr.v1.ListBackupVaultsRequest; - - /** - * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. - * @param message ListBackupVaultsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. - * @param message ListBackupVaultsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsRequest; - - /** - * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsRequest; - - /** - * Verifies a ListBackupVaultsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupVaultsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsRequest; - - /** - * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. - * @param message ListBackupVaultsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupVaultsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupVaultsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupVaultsResponse. */ - interface IListBackupVaultsResponse { - - /** ListBackupVaultsResponse backupVaults */ - backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); - - /** ListBackupVaultsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupVaultsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupVaultsResponse. */ - class ListBackupVaultsResponse implements IListBackupVaultsResponse { - - /** - * Constructs a new ListBackupVaultsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse); - - /** ListBackupVaultsResponse backupVaults. */ - public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; - - /** ListBackupVaultsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupVaultsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupVaultsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupVaultsResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupVaultsResponse): google.cloud.backupdr.v1.ListBackupVaultsResponse; - - /** - * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. - * @param message ListBackupVaultsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. - * @param message ListBackupVaultsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupVaultsResponse; - - /** - * Decodes a ListBackupVaultsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupVaultsResponse; - - /** - * Verifies a ListBackupVaultsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupVaultsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupVaultsResponse; - - /** - * Creates a plain object from a ListBackupVaultsResponse message. Also converts values to other types if specified. - * @param message ListBackupVaultsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupVaultsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupVaultsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchUsableBackupVaultsRequest. */ - interface IFetchUsableBackupVaultsRequest { - - /** FetchUsableBackupVaultsRequest parent */ - parent?: (string|null); - - /** FetchUsableBackupVaultsRequest pageSize */ - pageSize?: (number|null); - - /** FetchUsableBackupVaultsRequest pageToken */ - pageToken?: (string|null); - - /** FetchUsableBackupVaultsRequest filter */ - filter?: (string|null); - - /** FetchUsableBackupVaultsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a FetchUsableBackupVaultsRequest. */ - class FetchUsableBackupVaultsRequest implements IFetchUsableBackupVaultsRequest { - - /** - * Constructs a new FetchUsableBackupVaultsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest); - - /** FetchUsableBackupVaultsRequest parent. */ - public parent: string; - - /** FetchUsableBackupVaultsRequest pageSize. */ - public pageSize: number; - - /** FetchUsableBackupVaultsRequest pageToken. */ - public pageToken: string; - - /** FetchUsableBackupVaultsRequest filter. */ - public filter: string; - - /** FetchUsableBackupVaultsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchUsableBackupVaultsRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; - - /** - * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. - * @param message FetchUsableBackupVaultsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. - * @param message FetchUsableBackupVaultsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchUsableBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; - - /** - * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchUsableBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; - - /** - * Verifies a FetchUsableBackupVaultsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchUsableBackupVaultsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest; - - /** - * Creates a plain object from a FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. - * @param message FetchUsableBackupVaultsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchUsableBackupVaultsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchUsableBackupVaultsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchUsableBackupVaultsResponse. */ - interface IFetchUsableBackupVaultsResponse { - - /** FetchUsableBackupVaultsResponse backupVaults */ - backupVaults?: (google.cloud.backupdr.v1.IBackupVault[]|null); - - /** FetchUsableBackupVaultsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** FetchUsableBackupVaultsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a FetchUsableBackupVaultsResponse. */ - class FetchUsableBackupVaultsResponse implements IFetchUsableBackupVaultsResponse { - - /** - * Constructs a new FetchUsableBackupVaultsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse); - - /** FetchUsableBackupVaultsResponse backupVaults. */ - public backupVaults: google.cloud.backupdr.v1.IBackupVault[]; - - /** FetchUsableBackupVaultsResponse nextPageToken. */ - public nextPageToken: string; - - /** FetchUsableBackupVaultsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchUsableBackupVaultsResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; - - /** - * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. - * @param message FetchUsableBackupVaultsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. - * @param message FetchUsableBackupVaultsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchUsableBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; - - /** - * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchUsableBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; - - /** - * Verifies a FetchUsableBackupVaultsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchUsableBackupVaultsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse; - - /** - * Creates a plain object from a FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. - * @param message FetchUsableBackupVaultsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchUsableBackupVaultsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchUsableBackupVaultsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchBackupsForResourceTypeRequest. */ - interface IFetchBackupsForResourceTypeRequest { - - /** FetchBackupsForResourceTypeRequest parent */ - parent?: (string|null); - - /** FetchBackupsForResourceTypeRequest resourceType */ - resourceType?: (string|null); - - /** FetchBackupsForResourceTypeRequest pageSize */ - pageSize?: (number|null); - - /** FetchBackupsForResourceTypeRequest pageToken */ - pageToken?: (string|null); - - /** FetchBackupsForResourceTypeRequest filter */ - filter?: (string|null); - - /** FetchBackupsForResourceTypeRequest orderBy */ - orderBy?: (string|null); - - /** FetchBackupsForResourceTypeRequest view */ - view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); - } - - /** Represents a FetchBackupsForResourceTypeRequest. */ - class FetchBackupsForResourceTypeRequest implements IFetchBackupsForResourceTypeRequest { - - /** - * Constructs a new FetchBackupsForResourceTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest); - - /** FetchBackupsForResourceTypeRequest parent. */ - public parent: string; - - /** FetchBackupsForResourceTypeRequest resourceType. */ - public resourceType: string; - - /** FetchBackupsForResourceTypeRequest pageSize. */ - public pageSize: number; - - /** FetchBackupsForResourceTypeRequest pageToken. */ - public pageToken: string; - - /** FetchBackupsForResourceTypeRequest filter. */ - public filter: string; - - /** FetchBackupsForResourceTypeRequest orderBy. */ - public orderBy: string; - - /** FetchBackupsForResourceTypeRequest view. */ - public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); - - /** - * Creates a new FetchBackupsForResourceTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchBackupsForResourceTypeRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; - - /** - * Encodes the specified FetchBackupsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. - * @param message FetchBackupsForResourceTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchBackupsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. - * @param message FetchBackupsForResourceTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchBackupsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; - - /** - * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchBackupsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; - - /** - * Verifies a FetchBackupsForResourceTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchBackupsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchBackupsForResourceTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest; - - /** - * Creates a plain object from a FetchBackupsForResourceTypeRequest message. Also converts values to other types if specified. - * @param message FetchBackupsForResourceTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchBackupsForResourceTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchBackupsForResourceTypeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchBackupsForResourceTypeResponse. */ - interface IFetchBackupsForResourceTypeResponse { - - /** FetchBackupsForResourceTypeResponse backups */ - backups?: (google.cloud.backupdr.v1.IBackup[]|null); - - /** FetchBackupsForResourceTypeResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a FetchBackupsForResourceTypeResponse. */ - class FetchBackupsForResourceTypeResponse implements IFetchBackupsForResourceTypeResponse { - - /** - * Constructs a new FetchBackupsForResourceTypeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse); - - /** FetchBackupsForResourceTypeResponse backups. */ - public backups: google.cloud.backupdr.v1.IBackup[]; - - /** FetchBackupsForResourceTypeResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new FetchBackupsForResourceTypeResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchBackupsForResourceTypeResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; - - /** - * Encodes the specified FetchBackupsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. - * @param message FetchBackupsForResourceTypeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchBackupsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. - * @param message FetchBackupsForResourceTypeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchBackupsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; - - /** - * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchBackupsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; - - /** - * Verifies a FetchBackupsForResourceTypeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchBackupsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchBackupsForResourceTypeResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse; - - /** - * Creates a plain object from a FetchBackupsForResourceTypeResponse message. Also converts values to other types if specified. - * @param message FetchBackupsForResourceTypeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchBackupsForResourceTypeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchBackupsForResourceTypeResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupVaultRequest. */ - interface IGetBackupVaultRequest { - - /** GetBackupVaultRequest name */ - name?: (string|null); - - /** GetBackupVaultRequest view */ - view?: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView|null); - } - - /** Represents a GetBackupVaultRequest. */ - class GetBackupVaultRequest implements IGetBackupVaultRequest { - - /** - * Constructs a new GetBackupVaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest); - - /** GetBackupVaultRequest name. */ - public name: string; - - /** GetBackupVaultRequest view. */ - public view: (google.cloud.backupdr.v1.BackupVaultView|keyof typeof google.cloud.backupdr.v1.BackupVaultView); - - /** - * Creates a new GetBackupVaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupVaultRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetBackupVaultRequest): google.cloud.backupdr.v1.GetBackupVaultRequest; - - /** - * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. - * @param message GetBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. - * @param message GetBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupVaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupVaultRequest; - - /** - * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupVaultRequest; - - /** - * Verifies a GetBackupVaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupVaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupVaultRequest; - - /** - * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. - * @param message GetBackupVaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupVaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupVaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupVaultRequest. */ - interface IUpdateBackupVaultRequest { - - /** UpdateBackupVaultRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupVaultRequest backupVault */ - backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); - - /** UpdateBackupVaultRequest requestId */ - requestId?: (string|null); - - /** UpdateBackupVaultRequest validateOnly */ - validateOnly?: (boolean|null); - - /** UpdateBackupVaultRequest force */ - force?: (boolean|null); - - /** UpdateBackupVaultRequest forceUpdateAccessRestriction */ - forceUpdateAccessRestriction?: (boolean|null); - } - - /** Represents an UpdateBackupVaultRequest. */ - class UpdateBackupVaultRequest implements IUpdateBackupVaultRequest { - - /** - * Constructs a new UpdateBackupVaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest); - - /** UpdateBackupVaultRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupVaultRequest backupVault. */ - public backupVault?: (google.cloud.backupdr.v1.IBackupVault|null); - - /** UpdateBackupVaultRequest requestId. */ - public requestId: string; - - /** UpdateBackupVaultRequest validateOnly. */ - public validateOnly: boolean; - - /** UpdateBackupVaultRequest force. */ - public force: boolean; - - /** UpdateBackupVaultRequest forceUpdateAccessRestriction. */ - public forceUpdateAccessRestriction: boolean; - - /** - * Creates a new UpdateBackupVaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupVaultRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupVaultRequest): google.cloud.backupdr.v1.UpdateBackupVaultRequest; - - /** - * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. - * @param message UpdateBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. - * @param message UpdateBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupVaultRequest; - - /** - * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupVaultRequest; - - /** - * Verifies an UpdateBackupVaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupVaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupVaultRequest; - - /** - * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. - * @param message UpdateBackupVaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.UpdateBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupVaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupVaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupVaultRequest. */ - interface IDeleteBackupVaultRequest { - - /** DeleteBackupVaultRequest name */ - name?: (string|null); - - /** DeleteBackupVaultRequest requestId */ - requestId?: (string|null); - - /** DeleteBackupVaultRequest force */ - force?: (boolean|null); - - /** DeleteBackupVaultRequest etag */ - etag?: (string|null); - - /** DeleteBackupVaultRequest validateOnly */ - validateOnly?: (boolean|null); - - /** DeleteBackupVaultRequest allowMissing */ - allowMissing?: (boolean|null); - - /** DeleteBackupVaultRequest ignoreBackupPlanReferences */ - ignoreBackupPlanReferences?: (boolean|null); - } - - /** Represents a DeleteBackupVaultRequest. */ - class DeleteBackupVaultRequest implements IDeleteBackupVaultRequest { - - /** - * Constructs a new DeleteBackupVaultRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest); - - /** DeleteBackupVaultRequest name. */ - public name: string; - - /** DeleteBackupVaultRequest requestId. */ - public requestId: string; - - /** DeleteBackupVaultRequest force. */ - public force: boolean; - - /** DeleteBackupVaultRequest etag. */ - public etag: string; - - /** DeleteBackupVaultRequest validateOnly. */ - public validateOnly: boolean; - - /** DeleteBackupVaultRequest allowMissing. */ - public allowMissing: boolean; - - /** DeleteBackupVaultRequest ignoreBackupPlanReferences. */ - public ignoreBackupPlanReferences: boolean; - - /** - * Creates a new DeleteBackupVaultRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupVaultRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupVaultRequest): google.cloud.backupdr.v1.DeleteBackupVaultRequest; - - /** - * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. - * @param message DeleteBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. - * @param message DeleteBackupVaultRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupVaultRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupVaultRequest; - - /** - * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupVaultRequest; - - /** - * Verifies a DeleteBackupVaultRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupVaultRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupVaultRequest; - - /** - * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. - * @param message DeleteBackupVaultRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DeleteBackupVaultRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupVaultRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupVaultRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDataSourcesRequest. */ - interface IListDataSourcesRequest { - - /** ListDataSourcesRequest parent */ - parent?: (string|null); - - /** ListDataSourcesRequest pageSize */ - pageSize?: (number|null); - - /** ListDataSourcesRequest pageToken */ - pageToken?: (string|null); - - /** ListDataSourcesRequest filter */ - filter?: (string|null); - - /** ListDataSourcesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListDataSourcesRequest. */ - class ListDataSourcesRequest implements IListDataSourcesRequest { - - /** - * Constructs a new ListDataSourcesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest); - - /** ListDataSourcesRequest parent. */ - public parent: string; - - /** ListDataSourcesRequest pageSize. */ - public pageSize: number; - - /** ListDataSourcesRequest pageToken. */ - public pageToken: string; - - /** ListDataSourcesRequest filter. */ - public filter: string; - - /** ListDataSourcesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListDataSourcesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDataSourcesRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesRequest): google.cloud.backupdr.v1.ListDataSourcesRequest; - - /** - * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. - * @param message ListDataSourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. - * @param message ListDataSourcesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDataSourcesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDataSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesRequest; - - /** - * Decodes a ListDataSourcesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDataSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesRequest; - - /** - * Verifies a ListDataSourcesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDataSourcesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesRequest; - - /** - * Creates a plain object from a ListDataSourcesRequest message. Also converts values to other types if specified. - * @param message ListDataSourcesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDataSourcesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDataSourcesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDataSourcesResponse. */ - interface IListDataSourcesResponse { - - /** ListDataSourcesResponse dataSources */ - dataSources?: (google.cloud.backupdr.v1.IDataSource[]|null); - - /** ListDataSourcesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListDataSourcesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListDataSourcesResponse. */ - class ListDataSourcesResponse implements IListDataSourcesResponse { - - /** - * Constructs a new ListDataSourcesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse); - - /** ListDataSourcesResponse dataSources. */ - public dataSources: google.cloud.backupdr.v1.IDataSource[]; - - /** ListDataSourcesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListDataSourcesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListDataSourcesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDataSourcesResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListDataSourcesResponse): google.cloud.backupdr.v1.ListDataSourcesResponse; - - /** - * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. - * @param message ListDataSourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. - * @param message ListDataSourcesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourcesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDataSourcesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDataSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourcesResponse; - - /** - * Decodes a ListDataSourcesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDataSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourcesResponse; - - /** - * Verifies a ListDataSourcesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDataSourcesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourcesResponse; - - /** - * Creates a plain object from a ListDataSourcesResponse message. Also converts values to other types if specified. - * @param message ListDataSourcesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListDataSourcesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDataSourcesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDataSourcesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDataSourceRequest. */ - interface IGetDataSourceRequest { - - /** GetDataSourceRequest name */ - name?: (string|null); - } - - /** Represents a GetDataSourceRequest. */ - class GetDataSourceRequest implements IGetDataSourceRequest { - - /** - * Constructs a new GetDataSourceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest); - - /** GetDataSourceRequest name. */ - public name: string; - - /** - * Creates a new GetDataSourceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDataSourceRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetDataSourceRequest): google.cloud.backupdr.v1.GetDataSourceRequest; - - /** - * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. - * @param message GetDataSourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. - * @param message GetDataSourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDataSourceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetDataSourceRequest; - - /** - * Decodes a GetDataSourceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetDataSourceRequest; - - /** - * Verifies a GetDataSourceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDataSourceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetDataSourceRequest; - - /** - * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. - * @param message GetDataSourceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDataSourceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDataSourceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateDataSourceRequest. */ - interface IUpdateDataSourceRequest { - - /** UpdateDataSourceRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateDataSourceRequest dataSource */ - dataSource?: (google.cloud.backupdr.v1.IDataSource|null); - - /** UpdateDataSourceRequest requestId */ - requestId?: (string|null); - - /** UpdateDataSourceRequest allowMissing */ - allowMissing?: (boolean|null); - } - - /** Represents an UpdateDataSourceRequest. */ - class UpdateDataSourceRequest implements IUpdateDataSourceRequest { - - /** - * Constructs a new UpdateDataSourceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest); - - /** UpdateDataSourceRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateDataSourceRequest dataSource. */ - public dataSource?: (google.cloud.backupdr.v1.IDataSource|null); - - /** UpdateDataSourceRequest requestId. */ - public requestId: string; - - /** UpdateDataSourceRequest allowMissing. */ - public allowMissing: boolean; - - /** - * Creates a new UpdateDataSourceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateDataSourceRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IUpdateDataSourceRequest): google.cloud.backupdr.v1.UpdateDataSourceRequest; - - /** - * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. - * @param message UpdateDataSourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. - * @param message UpdateDataSourceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateDataSourceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateDataSourceRequest; - - /** - * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateDataSourceRequest; - - /** - * Verifies an UpdateDataSourceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateDataSourceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateDataSourceRequest; - - /** - * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. - * @param message UpdateDataSourceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.UpdateDataSourceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateDataSourceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateDataSourceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsRequest. */ - interface IListBackupsRequest { - - /** ListBackupsRequest parent */ - parent?: (string|null); - - /** ListBackupsRequest pageSize */ - pageSize?: (number|null); - - /** ListBackupsRequest pageToken */ - pageToken?: (string|null); - - /** ListBackupsRequest filter */ - filter?: (string|null); - - /** ListBackupsRequest orderBy */ - orderBy?: (string|null); - - /** ListBackupsRequest view */ - view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); - } - - /** Represents a ListBackupsRequest. */ - class ListBackupsRequest implements IListBackupsRequest { - - /** - * Constructs a new ListBackupsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupsRequest); - - /** ListBackupsRequest parent. */ - public parent: string; - - /** ListBackupsRequest pageSize. */ - public pageSize: number; - - /** ListBackupsRequest pageToken. */ - public pageToken: string; - - /** ListBackupsRequest filter. */ - public filter: string; - - /** ListBackupsRequest orderBy. */ - public orderBy: string; - - /** ListBackupsRequest view. */ - public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupsRequest): google.cloud.backupdr.v1.ListBackupsRequest; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. - * @param message ListBackupsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsRequest; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsRequest; - - /** - * Verifies a ListBackupsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupsRequest; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @param message ListBackupsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListBackupsResponse. */ - interface IListBackupsResponse { - - /** ListBackupsResponse backups */ - backups?: (google.cloud.backupdr.v1.IBackup[]|null); - - /** ListBackupsResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListBackupsResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListBackupsResponse. */ - class ListBackupsResponse implements IListBackupsResponse { - - /** - * Constructs a new ListBackupsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListBackupsResponse); - - /** ListBackupsResponse backups. */ - public backups: google.cloud.backupdr.v1.IBackup[]; - - /** ListBackupsResponse nextPageToken. */ - public nextPageToken: string; - - /** ListBackupsResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListBackupsResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListBackupsResponse): google.cloud.backupdr.v1.ListBackupsResponse; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. - * @param message ListBackupsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListBackupsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListBackupsResponse; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListBackupsResponse; - - /** - * Verifies a ListBackupsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListBackupsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListBackupsResponse; - - /** - * Creates a plain object from a ListBackupsResponse message. Also converts values to other types if specified. - * @param message ListBackupsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListBackupsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListBackupsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListBackupsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetBackupRequest. */ - interface IGetBackupRequest { - - /** GetBackupRequest name */ - name?: (string|null); - - /** GetBackupRequest view */ - view?: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView|null); - } - - /** Represents a GetBackupRequest. */ - class GetBackupRequest implements IGetBackupRequest { - - /** - * Constructs a new GetBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetBackupRequest); - - /** GetBackupRequest name. */ - public name: string; - - /** GetBackupRequest view. */ - public view: (google.cloud.backupdr.v1.BackupView|keyof typeof google.cloud.backupdr.v1.BackupView); - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetBackupRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetBackupRequest): google.cloud.backupdr.v1.GetBackupRequest; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. - * @param message GetBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetBackupRequest; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetBackupRequest; - - /** - * Verifies a GetBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetBackupRequest; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @param message GetBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an UpdateBackupRequest. */ - interface IUpdateBackupRequest { - - /** UpdateBackupRequest updateMask */ - updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup */ - backup?: (google.cloud.backupdr.v1.IBackup|null); - - /** UpdateBackupRequest requestId */ - requestId?: (string|null); - } - - /** Represents an UpdateBackupRequest. */ - class UpdateBackupRequest implements IUpdateBackupRequest { - - /** - * Constructs a new UpdateBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest); - - /** UpdateBackupRequest updateMask. */ - public updateMask?: (google.protobuf.IFieldMask|null); - - /** UpdateBackupRequest backup. */ - public backup?: (google.cloud.backupdr.v1.IBackup|null); - - /** UpdateBackupRequest requestId. */ - public requestId: string; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns UpdateBackupRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IUpdateBackupRequest): google.cloud.backupdr.v1.UpdateBackupRequest; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. - * @param message UpdateBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IUpdateBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.UpdateBackupRequest; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.UpdateBackupRequest; - - /** - * Verifies an UpdateBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UpdateBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.UpdateBackupRequest; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @param message UpdateBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.UpdateBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for UpdateBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DeleteBackupRequest. */ - interface IDeleteBackupRequest { - - /** DeleteBackupRequest name */ - name?: (string|null); - - /** DeleteBackupRequest requestId */ - requestId?: (string|null); - } - - /** Represents a DeleteBackupRequest. */ - class DeleteBackupRequest implements IDeleteBackupRequest { - - /** - * Constructs a new DeleteBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest); - - /** DeleteBackupRequest name. */ - public name: string; - - /** DeleteBackupRequest requestId. */ - public requestId: string; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns DeleteBackupRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDeleteBackupRequest): google.cloud.backupdr.v1.DeleteBackupRequest; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. - * @param message DeleteBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDeleteBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DeleteBackupRequest; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DeleteBackupRequest; - - /** - * Verifies a DeleteBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DeleteBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DeleteBackupRequest; - - /** - * Creates a plain object from a DeleteBackupRequest message. Also converts values to other types if specified. - * @param message DeleteBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DeleteBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DeleteBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DeleteBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreBackupRequest. */ - interface IRestoreBackupRequest { - - /** RestoreBackupRequest name */ - name?: (string|null); - - /** RestoreBackupRequest requestId */ - requestId?: (string|null); - - /** RestoreBackupRequest computeInstanceTargetEnvironment */ - computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); - - /** RestoreBackupRequest diskTargetEnvironment */ - diskTargetEnvironment?: (google.cloud.backupdr.v1.IDiskTargetEnvironment|null); - - /** RestoreBackupRequest regionDiskTargetEnvironment */ - regionDiskTargetEnvironment?: (google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null); - - /** RestoreBackupRequest computeInstanceRestoreProperties */ - computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); - - /** RestoreBackupRequest diskRestoreProperties */ - diskRestoreProperties?: (google.cloud.backupdr.v1.IDiskRestoreProperties|null); - - /** RestoreBackupRequest clearOverridesFieldMask */ - clearOverridesFieldMask?: (google.protobuf.IFieldMask|null); - } - - /** Represents a RestoreBackupRequest. */ - class RestoreBackupRequest implements IRestoreBackupRequest { - - /** - * Constructs a new RestoreBackupRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest); - - /** RestoreBackupRequest name. */ - public name: string; - - /** RestoreBackupRequest requestId. */ - public requestId: string; - - /** RestoreBackupRequest computeInstanceTargetEnvironment. */ - public computeInstanceTargetEnvironment?: (google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null); - - /** RestoreBackupRequest diskTargetEnvironment. */ - public diskTargetEnvironment?: (google.cloud.backupdr.v1.IDiskTargetEnvironment|null); - - /** RestoreBackupRequest regionDiskTargetEnvironment. */ - public regionDiskTargetEnvironment?: (google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null); - - /** RestoreBackupRequest computeInstanceRestoreProperties. */ - public computeInstanceRestoreProperties?: (google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null); - - /** RestoreBackupRequest diskRestoreProperties. */ - public diskRestoreProperties?: (google.cloud.backupdr.v1.IDiskRestoreProperties|null); - - /** RestoreBackupRequest clearOverridesFieldMask. */ - public clearOverridesFieldMask?: (google.protobuf.IFieldMask|null); - - /** RestoreBackupRequest targetEnvironment. */ - public targetEnvironment?: ("computeInstanceTargetEnvironment"|"diskTargetEnvironment"|"regionDiskTargetEnvironment"); - - /** RestoreBackupRequest instanceProperties. */ - public instanceProperties?: ("computeInstanceRestoreProperties"|"diskRestoreProperties"); - - /** - * Creates a new RestoreBackupRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreBackupRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupRequest): google.cloud.backupdr.v1.RestoreBackupRequest; - - /** - * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. - * @param message RestoreBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. - * @param message RestoreBackupRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreBackupRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupRequest; - - /** - * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupRequest; - - /** - * Verifies a RestoreBackupRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreBackupRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupRequest; - - /** - * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. - * @param message RestoreBackupRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.RestoreBackupRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreBackupRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreBackupRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RestoreBackupResponse. */ - interface IRestoreBackupResponse { - - /** RestoreBackupResponse targetResource */ - targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); - } - - /** Represents a RestoreBackupResponse. */ - class RestoreBackupResponse implements IRestoreBackupResponse { - - /** - * Constructs a new RestoreBackupResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse); - - /** RestoreBackupResponse targetResource. */ - public targetResource?: (google.cloud.backupdr.v1.ITargetResource|null); - - /** - * Creates a new RestoreBackupResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns RestoreBackupResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IRestoreBackupResponse): google.cloud.backupdr.v1.RestoreBackupResponse; - - /** - * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. - * @param message RestoreBackupResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. - * @param message RestoreBackupResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IRestoreBackupResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RestoreBackupResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RestoreBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RestoreBackupResponse; - - /** - * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RestoreBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RestoreBackupResponse; - - /** - * Verifies a RestoreBackupResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RestoreBackupResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RestoreBackupResponse; - - /** - * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. - * @param message RestoreBackupResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.RestoreBackupResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RestoreBackupResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RestoreBackupResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a TargetResource. */ - interface ITargetResource { - - /** TargetResource gcpResource */ - gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); - } - - /** Represents a TargetResource. */ - class TargetResource implements ITargetResource { - - /** - * Constructs a new TargetResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ITargetResource); - - /** TargetResource gcpResource. */ - public gcpResource?: (google.cloud.backupdr.v1.IGcpResource|null); - - /** TargetResource targetResourceInfo. */ - public targetResourceInfo?: "gcpResource"; - - /** - * Creates a new TargetResource instance using the specified properties. - * @param [properties] Properties to set - * @returns TargetResource instance - */ - public static create(properties?: google.cloud.backupdr.v1.ITargetResource): google.cloud.backupdr.v1.TargetResource; - - /** - * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. - * @param message TargetResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. - * @param message TargetResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ITargetResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a TargetResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns TargetResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.TargetResource; - - /** - * Decodes a TargetResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns TargetResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.TargetResource; - - /** - * Verifies a TargetResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns TargetResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.TargetResource; - - /** - * Creates a plain object from a TargetResource message. Also converts values to other types if specified. - * @param message TargetResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.TargetResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this TargetResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for TargetResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GcpResource. */ - interface IGcpResource { - - /** GcpResource gcpResourcename */ - gcpResourcename?: (string|null); - - /** GcpResource location */ - location?: (string|null); - - /** GcpResource type */ - type?: (string|null); - } - - /** Represents a GcpResource. */ - class GcpResource implements IGcpResource { - - /** - * Constructs a new GcpResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGcpResource); - - /** GcpResource gcpResourcename. */ - public gcpResourcename: string; - - /** GcpResource location. */ - public location: string; - - /** GcpResource type. */ - public type: string; - - /** - * Creates a new GcpResource instance using the specified properties. - * @param [properties] Properties to set - * @returns GcpResource instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGcpResource): google.cloud.backupdr.v1.GcpResource; - - /** - * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. - * @param message GcpResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. - * @param message GcpResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GcpResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GcpResource; - - /** - * Decodes a GcpResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GcpResource; - - /** - * Verifies a GcpResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GcpResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GcpResource; - - /** - * Creates a plain object from a GcpResource message. Also converts values to other types if specified. - * @param message GcpResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GcpResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GcpResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupGcpResource. */ - interface IBackupGcpResource { - - /** BackupGcpResource gcpResourcename */ - gcpResourcename?: (string|null); - - /** BackupGcpResource location */ - location?: (string|null); - - /** BackupGcpResource type */ - type?: (string|null); - } - - /** Represents a BackupGcpResource. */ - class BackupGcpResource implements IBackupGcpResource { - - /** - * Constructs a new BackupGcpResource. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupGcpResource); - - /** BackupGcpResource gcpResourcename. */ - public gcpResourcename: string; - - /** BackupGcpResource location. */ - public location: string; - - /** BackupGcpResource type. */ - public type: string; - - /** - * Creates a new BackupGcpResource instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupGcpResource instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupGcpResource): google.cloud.backupdr.v1.BackupGcpResource; - - /** - * Encodes the specified BackupGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. - * @param message BackupGcpResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. - * @param message BackupGcpResource message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupGcpResource, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupGcpResource message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupGcpResource; - - /** - * Decodes a BackupGcpResource message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupGcpResource; - - /** - * Verifies a BackupGcpResource message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupGcpResource message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupGcpResource - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupGcpResource; - - /** - * Creates a plain object from a BackupGcpResource message. Also converts values to other types if specified. - * @param message BackupGcpResource - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupGcpResource, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupGcpResource to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupGcpResource - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** BackupConfigState enum. */ - enum BackupConfigState { - BACKUP_CONFIG_STATE_UNSPECIFIED = 0, - ACTIVE = 1, - PASSIVE = 2 - } - - /** BackupView enum. */ - enum BackupView { - BACKUP_VIEW_UNSPECIFIED = 0, - BACKUP_VIEW_BASIC = 1, - BACKUP_VIEW_FULL = 2 - } - - /** BackupVaultView enum. */ - enum BackupVaultView { - BACKUP_VAULT_VIEW_UNSPECIFIED = 0, - BACKUP_VAULT_VIEW_BASIC = 1, - BACKUP_VAULT_VIEW_FULL = 2 - } - - /** Properties of a BackupApplianceBackupProperties. */ - interface IBackupApplianceBackupProperties { - - /** BackupApplianceBackupProperties generationId */ - generationId?: (number|null); - - /** BackupApplianceBackupProperties finalizeTime */ - finalizeTime?: (google.protobuf.ITimestamp|null); - - /** BackupApplianceBackupProperties recoveryRangeStartTime */ - recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); - - /** BackupApplianceBackupProperties recoveryRangeEndTime */ - recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupApplianceBackupProperties. */ - class BackupApplianceBackupProperties implements IBackupApplianceBackupProperties { - - /** - * Constructs a new BackupApplianceBackupProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties); - - /** BackupApplianceBackupProperties generationId. */ - public generationId?: (number|null); - - /** BackupApplianceBackupProperties finalizeTime. */ - public finalizeTime?: (google.protobuf.ITimestamp|null); - - /** BackupApplianceBackupProperties recoveryRangeStartTime. */ - public recoveryRangeStartTime?: (google.protobuf.ITimestamp|null); - - /** BackupApplianceBackupProperties recoveryRangeEndTime. */ - public recoveryRangeEndTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BackupApplianceBackupProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupApplianceBackupProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupApplianceBackupProperties): google.cloud.backupdr.v1.BackupApplianceBackupProperties; - - /** - * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. - * @param message BackupApplianceBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. - * @param message BackupApplianceBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupApplianceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupApplianceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupApplianceBackupProperties; - - /** - * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupApplianceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupApplianceBackupProperties; - - /** - * Verifies a BackupApplianceBackupProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupApplianceBackupProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupApplianceBackupProperties; - - /** - * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. - * @param message BackupApplianceBackupProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupApplianceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupApplianceBackupProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupApplianceBackupProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DiskTargetEnvironment. */ - interface IDiskTargetEnvironment { - - /** DiskTargetEnvironment project */ - project?: (string|null); - - /** DiskTargetEnvironment zone */ - zone?: (string|null); - } - - /** Represents a DiskTargetEnvironment. */ - class DiskTargetEnvironment implements IDiskTargetEnvironment { - - /** - * Constructs a new DiskTargetEnvironment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDiskTargetEnvironment); - - /** DiskTargetEnvironment project. */ - public project: string; - - /** DiskTargetEnvironment zone. */ - public zone: string; - - /** - * Creates a new DiskTargetEnvironment instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskTargetEnvironment instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDiskTargetEnvironment): google.cloud.backupdr.v1.DiskTargetEnvironment; - - /** - * Encodes the specified DiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. - * @param message DiskTargetEnvironment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. - * @param message DiskTargetEnvironment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskTargetEnvironment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskTargetEnvironment; - - /** - * Decodes a DiskTargetEnvironment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskTargetEnvironment; - - /** - * Verifies a DiskTargetEnvironment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskTargetEnvironment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskTargetEnvironment; - - /** - * Creates a plain object from a DiskTargetEnvironment message. Also converts values to other types if specified. - * @param message DiskTargetEnvironment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DiskTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskTargetEnvironment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskTargetEnvironment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RegionDiskTargetEnvironment. */ - interface IRegionDiskTargetEnvironment { - - /** RegionDiskTargetEnvironment project */ - project?: (string|null); - - /** RegionDiskTargetEnvironment region */ - region?: (string|null); - - /** RegionDiskTargetEnvironment replicaZones */ - replicaZones?: (string[]|null); - } - - /** Represents a RegionDiskTargetEnvironment. */ - class RegionDiskTargetEnvironment implements IRegionDiskTargetEnvironment { - - /** - * Constructs a new RegionDiskTargetEnvironment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment); - - /** RegionDiskTargetEnvironment project. */ - public project: string; - - /** RegionDiskTargetEnvironment region. */ - public region: string; - - /** RegionDiskTargetEnvironment replicaZones. */ - public replicaZones: string[]; - - /** - * Creates a new RegionDiskTargetEnvironment instance using the specified properties. - * @param [properties] Properties to set - * @returns RegionDiskTargetEnvironment instance - */ - public static create(properties?: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; - - /** - * Encodes the specified RegionDiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. - * @param message RegionDiskTargetEnvironment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RegionDiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. - * @param message RegionDiskTargetEnvironment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IRegionDiskTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RegionDiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; - - /** - * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RegionDiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; - - /** - * Verifies a RegionDiskTargetEnvironment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RegionDiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RegionDiskTargetEnvironment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.RegionDiskTargetEnvironment; - - /** - * Creates a plain object from a RegionDiskTargetEnvironment message. Also converts values to other types if specified. - * @param message RegionDiskTargetEnvironment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.RegionDiskTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RegionDiskTargetEnvironment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RegionDiskTargetEnvironment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DiskRestoreProperties. */ - interface IDiskRestoreProperties { - - /** DiskRestoreProperties name */ - name?: (string|null); - - /** DiskRestoreProperties description */ - description?: (string|null); - - /** DiskRestoreProperties sizeGb */ - sizeGb?: (number|Long|string|null); - - /** DiskRestoreProperties licenses */ - licenses?: (string[]|null); - - /** DiskRestoreProperties guestOsFeature */ - guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); - - /** DiskRestoreProperties diskEncryptionKey */ - diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); - - /** DiskRestoreProperties physicalBlockSizeBytes */ - physicalBlockSizeBytes?: (number|Long|string|null); - - /** DiskRestoreProperties provisionedIops */ - provisionedIops?: (number|Long|string|null); - - /** DiskRestoreProperties provisionedThroughput */ - provisionedThroughput?: (number|Long|string|null); - - /** DiskRestoreProperties enableConfidentialCompute */ - enableConfidentialCompute?: (boolean|null); - - /** DiskRestoreProperties storagePool */ - storagePool?: (string|null); - - /** DiskRestoreProperties accessMode */ - accessMode?: (google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null); - - /** DiskRestoreProperties architecture */ - architecture?: (google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null); - - /** DiskRestoreProperties resourcePolicy */ - resourcePolicy?: (string[]|null); - - /** DiskRestoreProperties type */ - type?: (string|null); - - /** DiskRestoreProperties labels */ - labels?: ({ [k: string]: string }|null); - - /** DiskRestoreProperties resourceManagerTags */ - resourceManagerTags?: ({ [k: string]: string }|null); - } - - /** Represents a DiskRestoreProperties. */ - class DiskRestoreProperties implements IDiskRestoreProperties { - - /** - * Constructs a new DiskRestoreProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDiskRestoreProperties); - - /** DiskRestoreProperties name. */ - public name?: (string|null); - - /** DiskRestoreProperties description. */ - public description?: (string|null); - - /** DiskRestoreProperties sizeGb. */ - public sizeGb?: (number|Long|string|null); - - /** DiskRestoreProperties licenses. */ - public licenses: string[]; - - /** DiskRestoreProperties guestOsFeature. */ - public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; - - /** DiskRestoreProperties diskEncryptionKey. */ - public diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); - - /** DiskRestoreProperties physicalBlockSizeBytes. */ - public physicalBlockSizeBytes?: (number|Long|string|null); - - /** DiskRestoreProperties provisionedIops. */ - public provisionedIops?: (number|Long|string|null); - - /** DiskRestoreProperties provisionedThroughput. */ - public provisionedThroughput?: (number|Long|string|null); - - /** DiskRestoreProperties enableConfidentialCompute. */ - public enableConfidentialCompute?: (boolean|null); - - /** DiskRestoreProperties storagePool. */ - public storagePool?: (string|null); - - /** DiskRestoreProperties accessMode. */ - public accessMode?: (google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null); - - /** DiskRestoreProperties architecture. */ - public architecture?: (google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null); - - /** DiskRestoreProperties resourcePolicy. */ - public resourcePolicy: string[]; - - /** DiskRestoreProperties type. */ - public type?: (string|null); - - /** DiskRestoreProperties labels. */ - public labels: { [k: string]: string }; - - /** DiskRestoreProperties resourceManagerTags. */ - public resourceManagerTags: { [k: string]: string }; - - /** - * Creates a new DiskRestoreProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskRestoreProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDiskRestoreProperties): google.cloud.backupdr.v1.DiskRestoreProperties; - - /** - * Encodes the specified DiskRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. - * @param message DiskRestoreProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDiskRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. - * @param message DiskRestoreProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskRestoreProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskRestoreProperties; - - /** - * Decodes a DiskRestoreProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskRestoreProperties; - - /** - * Verifies a DiskRestoreProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskRestoreProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskRestoreProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskRestoreProperties; - - /** - * Creates a plain object from a DiskRestoreProperties message. Also converts values to other types if specified. - * @param message DiskRestoreProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DiskRestoreProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskRestoreProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskRestoreProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DiskRestoreProperties { - - /** AccessMode enum. */ - enum AccessMode { - READ_WRITE_SINGLE = 0, - READ_WRITE_MANY = 1, - READ_ONLY_MANY = 2 - } - - /** Architecture enum. */ - enum Architecture { - ARCHITECTURE_UNSPECIFIED = 0, - X86_64 = 1, - ARM64 = 2 - } - } - - /** Properties of a DiskBackupProperties. */ - interface IDiskBackupProperties { - - /** DiskBackupProperties description */ - description?: (string|null); - - /** DiskBackupProperties licenses */ - licenses?: (string[]|null); - - /** DiskBackupProperties guestOsFeature */ - guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); - - /** DiskBackupProperties architecture */ - architecture?: (google.cloud.backupdr.v1.DiskBackupProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null); - - /** DiskBackupProperties type */ - type?: (string|null); - - /** DiskBackupProperties sizeGb */ - sizeGb?: (number|Long|string|null); - - /** DiskBackupProperties region */ - region?: (string|null); - - /** DiskBackupProperties zone */ - zone?: (string|null); - - /** DiskBackupProperties replicaZones */ - replicaZones?: (string[]|null); - - /** DiskBackupProperties sourceDisk */ - sourceDisk?: (string|null); - } - - /** Represents a DiskBackupProperties. */ - class DiskBackupProperties implements IDiskBackupProperties { - - /** - * Constructs a new DiskBackupProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDiskBackupProperties); - - /** DiskBackupProperties description. */ - public description?: (string|null); - - /** DiskBackupProperties licenses. */ - public licenses: string[]; - - /** DiskBackupProperties guestOsFeature. */ - public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; - - /** DiskBackupProperties architecture. */ - public architecture?: (google.cloud.backupdr.v1.DiskBackupProperties.Architecture|keyof typeof google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null); - - /** DiskBackupProperties type. */ - public type?: (string|null); - - /** DiskBackupProperties sizeGb. */ - public sizeGb?: (number|Long|string|null); - - /** DiskBackupProperties region. */ - public region?: (string|null); - - /** DiskBackupProperties zone. */ - public zone?: (string|null); - - /** DiskBackupProperties replicaZones. */ - public replicaZones: string[]; - - /** DiskBackupProperties sourceDisk. */ - public sourceDisk?: (string|null); - - /** - * Creates a new DiskBackupProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskBackupProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDiskBackupProperties): google.cloud.backupdr.v1.DiskBackupProperties; - - /** - * Encodes the specified DiskBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. - * @param message DiskBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDiskBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. - * @param message DiskBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskBackupProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskBackupProperties; - - /** - * Decodes a DiskBackupProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskBackupProperties; - - /** - * Verifies a DiskBackupProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskBackupProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskBackupProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskBackupProperties; - - /** - * Creates a plain object from a DiskBackupProperties message. Also converts values to other types if specified. - * @param message DiskBackupProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DiskBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskBackupProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskBackupProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DiskBackupProperties { - - /** Architecture enum. */ - enum Architecture { - ARCHITECTURE_UNSPECIFIED = 0, - X86_64 = 1, - ARM64 = 2 - } - } - - /** Properties of a DiskDataSourceProperties. */ - interface IDiskDataSourceProperties { - - /** DiskDataSourceProperties name */ - name?: (string|null); - - /** DiskDataSourceProperties description */ - description?: (string|null); - - /** DiskDataSourceProperties type */ - type?: (string|null); - - /** DiskDataSourceProperties sizeGb */ - sizeGb?: (number|Long|string|null); - } - - /** Represents a DiskDataSourceProperties. */ - class DiskDataSourceProperties implements IDiskDataSourceProperties { - - /** - * Constructs a new DiskDataSourceProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDiskDataSourceProperties); - - /** DiskDataSourceProperties name. */ - public name: string; - - /** DiskDataSourceProperties description. */ - public description: string; - - /** DiskDataSourceProperties type. */ - public type: string; - - /** DiskDataSourceProperties sizeGb. */ - public sizeGb: (number|Long|string); - - /** - * Creates a new DiskDataSourceProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns DiskDataSourceProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDiskDataSourceProperties): google.cloud.backupdr.v1.DiskDataSourceProperties; - - /** - * Encodes the specified DiskDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. - * @param message DiskDataSourceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDiskDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DiskDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. - * @param message DiskDataSourceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDiskDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DiskDataSourceProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DiskDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DiskDataSourceProperties; - - /** - * Decodes a DiskDataSourceProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DiskDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DiskDataSourceProperties; - - /** - * Verifies a DiskDataSourceProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DiskDataSourceProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DiskDataSourceProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DiskDataSourceProperties; - - /** - * Creates a plain object from a DiskDataSourceProperties message. Also converts values to other types if specified. - * @param message DiskDataSourceProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DiskDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DiskDataSourceProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DiskDataSourceProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeInstanceBackupProperties. */ - interface IComputeInstanceBackupProperties { - - /** ComputeInstanceBackupProperties description */ - description?: (string|null); - - /** ComputeInstanceBackupProperties tags */ - tags?: (google.cloud.backupdr.v1.ITags|null); - - /** ComputeInstanceBackupProperties machineType */ - machineType?: (string|null); - - /** ComputeInstanceBackupProperties canIpForward */ - canIpForward?: (boolean|null); - - /** ComputeInstanceBackupProperties networkInterface */ - networkInterface?: (google.cloud.backupdr.v1.INetworkInterface[]|null); - - /** ComputeInstanceBackupProperties disk */ - disk?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); - - /** ComputeInstanceBackupProperties metadata */ - metadata?: (google.cloud.backupdr.v1.IMetadata|null); - - /** ComputeInstanceBackupProperties serviceAccount */ - serviceAccount?: (google.cloud.backupdr.v1.IServiceAccount[]|null); - - /** ComputeInstanceBackupProperties scheduling */ - scheduling?: (google.cloud.backupdr.v1.IScheduling|null); - - /** ComputeInstanceBackupProperties guestAccelerator */ - guestAccelerator?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); - - /** ComputeInstanceBackupProperties minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** ComputeInstanceBackupProperties keyRevocationActionType */ - keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); - - /** ComputeInstanceBackupProperties sourceInstance */ - sourceInstance?: (string|null); - - /** ComputeInstanceBackupProperties labels */ - labels?: ({ [k: string]: string }|null); - } - - /** Represents a ComputeInstanceBackupProperties. */ - class ComputeInstanceBackupProperties implements IComputeInstanceBackupProperties { - - /** - * Constructs a new ComputeInstanceBackupProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties); - - /** ComputeInstanceBackupProperties description. */ - public description?: (string|null); - - /** ComputeInstanceBackupProperties tags. */ - public tags?: (google.cloud.backupdr.v1.ITags|null); - - /** ComputeInstanceBackupProperties machineType. */ - public machineType?: (string|null); - - /** ComputeInstanceBackupProperties canIpForward. */ - public canIpForward?: (boolean|null); - - /** ComputeInstanceBackupProperties networkInterface. */ - public networkInterface: google.cloud.backupdr.v1.INetworkInterface[]; - - /** ComputeInstanceBackupProperties disk. */ - public disk: google.cloud.backupdr.v1.IAttachedDisk[]; - - /** ComputeInstanceBackupProperties metadata. */ - public metadata?: (google.cloud.backupdr.v1.IMetadata|null); - - /** ComputeInstanceBackupProperties serviceAccount. */ - public serviceAccount: google.cloud.backupdr.v1.IServiceAccount[]; - - /** ComputeInstanceBackupProperties scheduling. */ - public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); - - /** ComputeInstanceBackupProperties guestAccelerator. */ - public guestAccelerator: google.cloud.backupdr.v1.IAcceleratorConfig[]; - - /** ComputeInstanceBackupProperties minCpuPlatform. */ - public minCpuPlatform?: (string|null); - - /** ComputeInstanceBackupProperties keyRevocationActionType. */ - public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); - - /** ComputeInstanceBackupProperties sourceInstance. */ - public sourceInstance?: (string|null); - - /** ComputeInstanceBackupProperties labels. */ - public labels: { [k: string]: string }; - - /** - * Creates a new ComputeInstanceBackupProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeInstanceBackupProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceBackupProperties): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; - - /** - * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. - * @param message ComputeInstanceBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. - * @param message ComputeInstanceBackupProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceBackupProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; - - /** - * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; - - /** - * Verifies a ComputeInstanceBackupProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeInstanceBackupProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceBackupProperties; - - /** - * Creates a plain object from a ComputeInstanceBackupProperties message. Also converts values to other types if specified. - * @param message ComputeInstanceBackupProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceBackupProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeInstanceBackupProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeInstanceBackupProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeInstanceRestoreProperties. */ - interface IComputeInstanceRestoreProperties { - - /** ComputeInstanceRestoreProperties name */ - name?: (string|null); - - /** ComputeInstanceRestoreProperties advancedMachineFeatures */ - advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); - - /** ComputeInstanceRestoreProperties canIpForward */ - canIpForward?: (boolean|null); - - /** ComputeInstanceRestoreProperties confidentialInstanceConfig */ - confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); - - /** ComputeInstanceRestoreProperties deletionProtection */ - deletionProtection?: (boolean|null); - - /** ComputeInstanceRestoreProperties description */ - description?: (string|null); - - /** ComputeInstanceRestoreProperties disks */ - disks?: (google.cloud.backupdr.v1.IAttachedDisk[]|null); - - /** ComputeInstanceRestoreProperties displayDevice */ - displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); - - /** ComputeInstanceRestoreProperties guestAccelerators */ - guestAccelerators?: (google.cloud.backupdr.v1.IAcceleratorConfig[]|null); - - /** ComputeInstanceRestoreProperties hostname */ - hostname?: (string|null); - - /** ComputeInstanceRestoreProperties instanceEncryptionKey */ - instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); - - /** ComputeInstanceRestoreProperties keyRevocationActionType */ - keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); - - /** ComputeInstanceRestoreProperties labels */ - labels?: ({ [k: string]: string }|null); - - /** ComputeInstanceRestoreProperties machineType */ - machineType?: (string|null); - - /** ComputeInstanceRestoreProperties metadata */ - metadata?: (google.cloud.backupdr.v1.IMetadata|null); - - /** ComputeInstanceRestoreProperties minCpuPlatform */ - minCpuPlatform?: (string|null); - - /** ComputeInstanceRestoreProperties networkInterfaces */ - networkInterfaces?: (google.cloud.backupdr.v1.INetworkInterface[]|null); - - /** ComputeInstanceRestoreProperties networkPerformanceConfig */ - networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); - - /** ComputeInstanceRestoreProperties params */ - params?: (google.cloud.backupdr.v1.IInstanceParams|null); - - /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess */ - privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); - - /** ComputeInstanceRestoreProperties allocationAffinity */ - allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); - - /** ComputeInstanceRestoreProperties resourcePolicies */ - resourcePolicies?: (string[]|null); - - /** ComputeInstanceRestoreProperties scheduling */ - scheduling?: (google.cloud.backupdr.v1.IScheduling|null); - - /** ComputeInstanceRestoreProperties serviceAccounts */ - serviceAccounts?: (google.cloud.backupdr.v1.IServiceAccount[]|null); - - /** ComputeInstanceRestoreProperties tags */ - tags?: (google.cloud.backupdr.v1.ITags|null); - } - - /** Represents a ComputeInstanceRestoreProperties. */ - class ComputeInstanceRestoreProperties implements IComputeInstanceRestoreProperties { - - /** - * Constructs a new ComputeInstanceRestoreProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties); - - /** ComputeInstanceRestoreProperties name. */ - public name?: (string|null); - - /** ComputeInstanceRestoreProperties advancedMachineFeatures. */ - public advancedMachineFeatures?: (google.cloud.backupdr.v1.IAdvancedMachineFeatures|null); - - /** ComputeInstanceRestoreProperties canIpForward. */ - public canIpForward?: (boolean|null); - - /** ComputeInstanceRestoreProperties confidentialInstanceConfig. */ - public confidentialInstanceConfig?: (google.cloud.backupdr.v1.IConfidentialInstanceConfig|null); - - /** ComputeInstanceRestoreProperties deletionProtection. */ - public deletionProtection?: (boolean|null); - - /** ComputeInstanceRestoreProperties description. */ - public description?: (string|null); - - /** ComputeInstanceRestoreProperties disks. */ - public disks: google.cloud.backupdr.v1.IAttachedDisk[]; - - /** ComputeInstanceRestoreProperties displayDevice. */ - public displayDevice?: (google.cloud.backupdr.v1.IDisplayDevice|null); - - /** ComputeInstanceRestoreProperties guestAccelerators. */ - public guestAccelerators: google.cloud.backupdr.v1.IAcceleratorConfig[]; - - /** ComputeInstanceRestoreProperties hostname. */ - public hostname?: (string|null); - - /** ComputeInstanceRestoreProperties instanceEncryptionKey. */ - public instanceEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); - - /** ComputeInstanceRestoreProperties keyRevocationActionType. */ - public keyRevocationActionType?: (google.cloud.backupdr.v1.KeyRevocationActionType|keyof typeof google.cloud.backupdr.v1.KeyRevocationActionType|null); - - /** ComputeInstanceRestoreProperties labels. */ - public labels: { [k: string]: string }; - - /** ComputeInstanceRestoreProperties machineType. */ - public machineType?: (string|null); - - /** ComputeInstanceRestoreProperties metadata. */ - public metadata?: (google.cloud.backupdr.v1.IMetadata|null); - - /** ComputeInstanceRestoreProperties minCpuPlatform. */ - public minCpuPlatform?: (string|null); - - /** ComputeInstanceRestoreProperties networkInterfaces. */ - public networkInterfaces: google.cloud.backupdr.v1.INetworkInterface[]; - - /** ComputeInstanceRestoreProperties networkPerformanceConfig. */ - public networkPerformanceConfig?: (google.cloud.backupdr.v1.INetworkPerformanceConfig|null); - - /** ComputeInstanceRestoreProperties params. */ - public params?: (google.cloud.backupdr.v1.IInstanceParams|null); - - /** ComputeInstanceRestoreProperties privateIpv6GoogleAccess. */ - public privateIpv6GoogleAccess?: (google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|keyof typeof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null); - - /** ComputeInstanceRestoreProperties allocationAffinity. */ - public allocationAffinity?: (google.cloud.backupdr.v1.IAllocationAffinity|null); - - /** ComputeInstanceRestoreProperties resourcePolicies. */ - public resourcePolicies: string[]; - - /** ComputeInstanceRestoreProperties scheduling. */ - public scheduling?: (google.cloud.backupdr.v1.IScheduling|null); - - /** ComputeInstanceRestoreProperties serviceAccounts. */ - public serviceAccounts: google.cloud.backupdr.v1.IServiceAccount[]; - - /** ComputeInstanceRestoreProperties tags. */ - public tags?: (google.cloud.backupdr.v1.ITags|null); - - /** - * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeInstanceRestoreProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; - - /** - * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. - * @param message ComputeInstanceRestoreProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. - * @param message ComputeInstanceRestoreProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceRestoreProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeInstanceRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; - - /** - * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeInstanceRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; - - /** - * Verifies a ComputeInstanceRestoreProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeInstanceRestoreProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceRestoreProperties; - - /** - * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. - * @param message ComputeInstanceRestoreProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceRestoreProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeInstanceRestoreProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeInstanceRestoreProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ComputeInstanceRestoreProperties { - - /** InstancePrivateIpv6GoogleAccess enum. */ - enum InstancePrivateIpv6GoogleAccess { - INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED = 0, - INHERIT_FROM_SUBNETWORK = 1, - ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE = 2, - ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE = 3 - } - } - - /** Properties of a ComputeInstanceTargetEnvironment. */ - interface IComputeInstanceTargetEnvironment { - - /** ComputeInstanceTargetEnvironment project */ - project?: (string|null); - - /** ComputeInstanceTargetEnvironment zone */ - zone?: (string|null); - } - - /** Represents a ComputeInstanceTargetEnvironment. */ - class ComputeInstanceTargetEnvironment implements IComputeInstanceTargetEnvironment { - - /** - * Constructs a new ComputeInstanceTargetEnvironment. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment); - - /** ComputeInstanceTargetEnvironment project. */ - public project: string; - - /** ComputeInstanceTargetEnvironment zone. */ - public zone: string; - - /** - * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeInstanceTargetEnvironment instance - */ - public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; - - /** - * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. - * @param message ComputeInstanceTargetEnvironment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. - * @param message ComputeInstanceTargetEnvironment message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeInstanceTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; - - /** - * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeInstanceTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; - - /** - * Verifies a ComputeInstanceTargetEnvironment message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeInstanceTargetEnvironment - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment; - - /** - * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. - * @param message ComputeInstanceTargetEnvironment - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeInstanceTargetEnvironment to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeInstanceTargetEnvironment - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ComputeInstanceDataSourceProperties. */ - interface IComputeInstanceDataSourceProperties { - - /** ComputeInstanceDataSourceProperties name */ - name?: (string|null); - - /** ComputeInstanceDataSourceProperties description */ - description?: (string|null); - - /** ComputeInstanceDataSourceProperties machineType */ - machineType?: (string|null); - - /** ComputeInstanceDataSourceProperties totalDiskCount */ - totalDiskCount?: (number|Long|string|null); - - /** ComputeInstanceDataSourceProperties totalDiskSizeGb */ - totalDiskSizeGb?: (number|Long|string|null); - } - - /** Represents a ComputeInstanceDataSourceProperties. */ - class ComputeInstanceDataSourceProperties implements IComputeInstanceDataSourceProperties { - - /** - * Constructs a new ComputeInstanceDataSourceProperties. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties); - - /** ComputeInstanceDataSourceProperties name. */ - public name: string; - - /** ComputeInstanceDataSourceProperties description. */ - public description: string; - - /** ComputeInstanceDataSourceProperties machineType. */ - public machineType: string; - - /** ComputeInstanceDataSourceProperties totalDiskCount. */ - public totalDiskCount: (number|Long|string); - - /** ComputeInstanceDataSourceProperties totalDiskSizeGb. */ - public totalDiskSizeGb: (number|Long|string); - - /** - * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. - * @param [properties] Properties to set - * @returns ComputeInstanceDataSourceProperties instance - */ - public static create(properties?: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; - - /** - * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. - * @param message ComputeInstanceDataSourceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. - * @param message ComputeInstanceDataSourceProperties message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ComputeInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; - - /** - * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ComputeInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; - - /** - * Verifies a ComputeInstanceDataSourceProperties message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ComputeInstanceDataSourceProperties - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties; - - /** - * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. - * @param message ComputeInstanceDataSourceProperties - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ComputeInstanceDataSourceProperties to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ComputeInstanceDataSourceProperties - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AdvancedMachineFeatures. */ - interface IAdvancedMachineFeatures { - - /** AdvancedMachineFeatures enableNestedVirtualization */ - enableNestedVirtualization?: (boolean|null); - - /** AdvancedMachineFeatures threadsPerCore */ - threadsPerCore?: (number|null); - - /** AdvancedMachineFeatures visibleCoreCount */ - visibleCoreCount?: (number|null); - - /** AdvancedMachineFeatures enableUefiNetworking */ - enableUefiNetworking?: (boolean|null); - } - - /** Represents an AdvancedMachineFeatures. */ - class AdvancedMachineFeatures implements IAdvancedMachineFeatures { - - /** - * Constructs a new AdvancedMachineFeatures. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures); - - /** AdvancedMachineFeatures enableNestedVirtualization. */ - public enableNestedVirtualization?: (boolean|null); - - /** AdvancedMachineFeatures threadsPerCore. */ - public threadsPerCore?: (number|null); - - /** AdvancedMachineFeatures visibleCoreCount. */ - public visibleCoreCount?: (number|null); - - /** AdvancedMachineFeatures enableUefiNetworking. */ - public enableUefiNetworking?: (boolean|null); - - /** - * Creates a new AdvancedMachineFeatures instance using the specified properties. - * @param [properties] Properties to set - * @returns AdvancedMachineFeatures instance - */ - public static create(properties?: google.cloud.backupdr.v1.IAdvancedMachineFeatures): google.cloud.backupdr.v1.AdvancedMachineFeatures; - - /** - * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. - * @param message AdvancedMachineFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. - * @param message AdvancedMachineFeatures message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IAdvancedMachineFeatures, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AdvancedMachineFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AdvancedMachineFeatures; - - /** - * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AdvancedMachineFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AdvancedMachineFeatures; - - /** - * Verifies an AdvancedMachineFeatures message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AdvancedMachineFeatures - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AdvancedMachineFeatures; - - /** - * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. - * @param message AdvancedMachineFeatures - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.AdvancedMachineFeatures, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AdvancedMachineFeatures to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AdvancedMachineFeatures - * @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.backupdr.v1.IConfidentialInstanceConfig); - - /** ConfidentialInstanceConfig enableConfidentialCompute. */ - public enableConfidentialCompute?: (boolean|null); - - /** - * Creates a new ConfidentialInstanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ConfidentialInstanceConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IConfidentialInstanceConfig): google.cloud.backupdr.v1.ConfidentialInstanceConfig; - - /** - * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.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.backupdr.v1.IConfidentialInstanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ConfidentialInstanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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 a DisplayDevice. */ - interface IDisplayDevice { - - /** DisplayDevice enableDisplay */ - enableDisplay?: (boolean|null); - } - - /** Represents a DisplayDevice. */ - class DisplayDevice implements IDisplayDevice { - - /** - * Constructs a new DisplayDevice. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDisplayDevice); - - /** DisplayDevice enableDisplay. */ - public enableDisplay?: (boolean|null); - - /** - * Creates a new DisplayDevice instance using the specified properties. - * @param [properties] Properties to set - * @returns DisplayDevice instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDisplayDevice): google.cloud.backupdr.v1.DisplayDevice; - - /** - * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. - * @param message DisplayDevice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. - * @param message DisplayDevice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDisplayDevice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DisplayDevice message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DisplayDevice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DisplayDevice; - - /** - * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DisplayDevice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DisplayDevice; - - /** - * Verifies a DisplayDevice message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DisplayDevice - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DisplayDevice; - - /** - * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. - * @param message DisplayDevice - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DisplayDevice, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DisplayDevice to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DisplayDevice - * @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 acceleratorType */ - acceleratorType?: (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.backupdr.v1.IAcceleratorConfig); - - /** AcceleratorConfig acceleratorType. */ - public acceleratorType?: (string|null); - - /** AcceleratorConfig acceleratorCount. */ - public acceleratorCount?: (number|null); - - /** - * Creates a new AcceleratorConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AcceleratorConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IAcceleratorConfig): google.cloud.backupdr.v1.AcceleratorConfig; - - /** - * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.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.backupdr.v1.IAcceleratorConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AcceleratorConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.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 CustomerEncryptionKey. */ - interface ICustomerEncryptionKey { - - /** CustomerEncryptionKey rawKey */ - rawKey?: (string|null); - - /** CustomerEncryptionKey rsaEncryptedKey */ - rsaEncryptedKey?: (string|null); - - /** CustomerEncryptionKey kmsKeyName */ - kmsKeyName?: (string|null); - - /** CustomerEncryptionKey kmsKeyServiceAccount */ - kmsKeyServiceAccount?: (string|null); - } - - /** Represents a CustomerEncryptionKey. */ - class CustomerEncryptionKey implements ICustomerEncryptionKey { - - /** - * Constructs a new CustomerEncryptionKey. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey); - - /** CustomerEncryptionKey rawKey. */ - public rawKey?: (string|null); - - /** CustomerEncryptionKey rsaEncryptedKey. */ - public rsaEncryptedKey?: (string|null); - - /** CustomerEncryptionKey kmsKeyName. */ - public kmsKeyName?: (string|null); - - /** CustomerEncryptionKey kmsKeyServiceAccount. */ - public kmsKeyServiceAccount?: (string|null); - - /** CustomerEncryptionKey key. */ - public key?: ("rawKey"|"rsaEncryptedKey"|"kmsKeyName"); - - /** - * Creates a new CustomerEncryptionKey instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomerEncryptionKey instance - */ - public static create(properties?: google.cloud.backupdr.v1.ICustomerEncryptionKey): google.cloud.backupdr.v1.CustomerEncryptionKey; - - /** - * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. - * @param message CustomerEncryptionKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. - * @param message CustomerEncryptionKey message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ICustomerEncryptionKey, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomerEncryptionKey message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomerEncryptionKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.CustomerEncryptionKey; - - /** - * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomerEncryptionKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.CustomerEncryptionKey; - - /** - * Verifies a CustomerEncryptionKey message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomerEncryptionKey - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.CustomerEncryptionKey; - - /** - * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. - * @param message CustomerEncryptionKey - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.CustomerEncryptionKey, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomerEncryptionKey to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomerEncryptionKey - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an Entry. */ - interface IEntry { - - /** Entry key */ - key?: (string|null); - - /** Entry value */ - value?: (string|null); - } - - /** Represents an Entry. */ - class Entry implements IEntry { - - /** - * Constructs a new Entry. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IEntry); - - /** Entry key. */ - public key?: (string|null); - - /** Entry value. */ - public value?: (string|null); - - /** - * Creates a new Entry instance using the specified properties. - * @param [properties] Properties to set - * @returns Entry instance - */ - public static create(properties?: google.cloud.backupdr.v1.IEntry): google.cloud.backupdr.v1.Entry; - - /** - * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. - * @param message Entry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. - * @param message Entry message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IEntry, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Entry message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Entry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Entry; - - /** - * Decodes an Entry message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Entry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Entry; - - /** - * Verifies an Entry message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Entry message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Entry - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Entry; - - /** - * Creates a plain object from an Entry message. Also converts values to other types if specified. - * @param message Entry - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Entry, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Entry to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Entry - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Metadata. */ - interface IMetadata { - - /** Metadata items */ - items?: (google.cloud.backupdr.v1.IEntry[]|null); - } - - /** Represents a Metadata. */ - class Metadata implements IMetadata { - - /** - * Constructs a new Metadata. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IMetadata); - - /** Metadata items. */ - public items: google.cloud.backupdr.v1.IEntry[]; - - /** - * Creates a new Metadata instance using the specified properties. - * @param [properties] Properties to set - * @returns Metadata instance - */ - public static create(properties?: google.cloud.backupdr.v1.IMetadata): google.cloud.backupdr.v1.Metadata; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. - * @param message Metadata message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IMetadata, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Metadata; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Metadata; - - /** - * Verifies a Metadata message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Metadata - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Metadata; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @param message Metadata - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Metadata, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Metadata to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Metadata - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NetworkInterface. */ - interface INetworkInterface { - - /** NetworkInterface network */ - network?: (string|null); - - /** NetworkInterface subnetwork */ - subnetwork?: (string|null); - - /** NetworkInterface ipAddress */ - ipAddress?: (string|null); - - /** NetworkInterface ipv6Address */ - ipv6Address?: (string|null); - - /** NetworkInterface internalIpv6PrefixLength */ - internalIpv6PrefixLength?: (number|null); - - /** NetworkInterface name */ - name?: (string|null); - - /** NetworkInterface accessConfigs */ - accessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); - - /** NetworkInterface ipv6AccessConfigs */ - ipv6AccessConfigs?: (google.cloud.backupdr.v1.IAccessConfig[]|null); - - /** NetworkInterface aliasIpRanges */ - aliasIpRanges?: (google.cloud.backupdr.v1.IAliasIpRange[]|null); - - /** NetworkInterface stackType */ - stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); - - /** NetworkInterface ipv6AccessType */ - ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); - - /** NetworkInterface queueCount */ - queueCount?: (number|null); - - /** NetworkInterface nicType */ - nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); - - /** NetworkInterface networkAttachment */ - networkAttachment?: (string|null); - } - - /** Represents a NetworkInterface. */ - class NetworkInterface implements INetworkInterface { - - /** - * Constructs a new NetworkInterface. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.INetworkInterface); - - /** NetworkInterface network. */ - public network?: (string|null); - - /** NetworkInterface subnetwork. */ - public subnetwork?: (string|null); - - /** NetworkInterface ipAddress. */ - public ipAddress?: (string|null); - - /** NetworkInterface ipv6Address. */ - public ipv6Address?: (string|null); - - /** NetworkInterface internalIpv6PrefixLength. */ - public internalIpv6PrefixLength?: (number|null); - - /** NetworkInterface name. */ - public name?: (string|null); - - /** NetworkInterface accessConfigs. */ - public accessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; - - /** NetworkInterface ipv6AccessConfigs. */ - public ipv6AccessConfigs: google.cloud.backupdr.v1.IAccessConfig[]; - - /** NetworkInterface aliasIpRanges. */ - public aliasIpRanges: google.cloud.backupdr.v1.IAliasIpRange[]; - - /** NetworkInterface stackType. */ - public stackType?: (google.cloud.backupdr.v1.NetworkInterface.StackType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.StackType|null); - - /** NetworkInterface ipv6AccessType. */ - public ipv6AccessType?: (google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null); - - /** NetworkInterface queueCount. */ - public queueCount?: (number|null); - - /** NetworkInterface nicType. */ - public nicType?: (google.cloud.backupdr.v1.NetworkInterface.NicType|keyof typeof google.cloud.backupdr.v1.NetworkInterface.NicType|null); - - /** NetworkInterface networkAttachment. */ - public networkAttachment?: (string|null); - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkInterface instance - */ - public static create(properties?: google.cloud.backupdr.v1.INetworkInterface): google.cloud.backupdr.v1.NetworkInterface; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. - * @param message NetworkInterface message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkInterface, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkInterface; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkInterface; - - /** - * Verifies a NetworkInterface message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkInterface - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkInterface; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @param message NetworkInterface - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.NetworkInterface, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkInterface to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkInterface - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace NetworkInterface { - - /** StackType enum. */ - enum StackType { - STACK_TYPE_UNSPECIFIED = 0, - IPV4_ONLY = 1, - IPV4_IPV6 = 2 - } - - /** Ipv6AccessType enum. */ - enum Ipv6AccessType { - UNSPECIFIED_IPV6_ACCESS_TYPE = 0, - INTERNAL = 1, - EXTERNAL = 2 - } - - /** NicType enum. */ - enum NicType { - NIC_TYPE_UNSPECIFIED = 0, - VIRTIO_NET = 1, - GVNIC = 2 - } - } - - /** Properties of a NetworkPerformanceConfig. */ - interface INetworkPerformanceConfig { - - /** NetworkPerformanceConfig totalEgressBandwidthTier */ - totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); - } - - /** Represents a NetworkPerformanceConfig. */ - class NetworkPerformanceConfig implements INetworkPerformanceConfig { - - /** - * Constructs a new NetworkPerformanceConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig); - - /** NetworkPerformanceConfig totalEgressBandwidthTier. */ - public totalEgressBandwidthTier?: (google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|keyof typeof google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null); - - /** - * Creates a new NetworkPerformanceConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkPerformanceConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.INetworkPerformanceConfig): google.cloud.backupdr.v1.NetworkPerformanceConfig; - - /** - * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. - * @param message NetworkPerformanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. - * @param message NetworkPerformanceConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.INetworkPerformanceConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkPerformanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.NetworkPerformanceConfig; - - /** - * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkPerformanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.NetworkPerformanceConfig; - - /** - * Verifies a NetworkPerformanceConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkPerformanceConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.NetworkPerformanceConfig; - - /** - * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. - * @param message NetworkPerformanceConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.NetworkPerformanceConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkPerformanceConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NetworkPerformanceConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace NetworkPerformanceConfig { - - /** Tier enum. */ - enum Tier { - TIER_UNSPECIFIED = 0, - DEFAULT = 1, - TIER_1 = 2 - } - } - - /** Properties of an AccessConfig. */ - interface IAccessConfig { - - /** AccessConfig type */ - type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); - - /** AccessConfig name */ - name?: (string|null); - - /** AccessConfig externalIp */ - externalIp?: (string|null); - - /** AccessConfig externalIpv6 */ - externalIpv6?: (string|null); - - /** AccessConfig externalIpv6PrefixLength */ - externalIpv6PrefixLength?: (number|null); - - /** AccessConfig setPublicPtr */ - setPublicPtr?: (boolean|null); - - /** AccessConfig publicPtrDomainName */ - publicPtrDomainName?: (string|null); - - /** AccessConfig networkTier */ - networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); - } - - /** Represents an AccessConfig. */ - class AccessConfig implements IAccessConfig { - - /** - * Constructs a new AccessConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IAccessConfig); - - /** AccessConfig type. */ - public type?: (google.cloud.backupdr.v1.AccessConfig.AccessType|keyof typeof google.cloud.backupdr.v1.AccessConfig.AccessType|null); - - /** AccessConfig name. */ - public name?: (string|null); - - /** AccessConfig externalIp. */ - public externalIp?: (string|null); - - /** AccessConfig externalIpv6. */ - public externalIpv6?: (string|null); - - /** AccessConfig externalIpv6PrefixLength. */ - public externalIpv6PrefixLength?: (number|null); - - /** AccessConfig setPublicPtr. */ - public setPublicPtr?: (boolean|null); - - /** AccessConfig publicPtrDomainName. */ - public publicPtrDomainName?: (string|null); - - /** AccessConfig networkTier. */ - public networkTier?: (google.cloud.backupdr.v1.AccessConfig.NetworkTier|keyof typeof google.cloud.backupdr.v1.AccessConfig.NetworkTier|null); - - /** - * Creates a new AccessConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns AccessConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IAccessConfig): google.cloud.backupdr.v1.AccessConfig; - - /** - * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. - * @param message AccessConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. - * @param message AccessConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IAccessConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AccessConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AccessConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AccessConfig; - - /** - * Decodes an AccessConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AccessConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AccessConfig; - - /** - * Verifies an AccessConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AccessConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AccessConfig; - - /** - * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. - * @param message AccessConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.AccessConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AccessConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AccessConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AccessConfig { - - /** AccessType enum. */ - enum AccessType { - ACCESS_TYPE_UNSPECIFIED = 0, - ONE_TO_ONE_NAT = 1, - DIRECT_IPV6 = 2 - } - - /** NetworkTier enum. */ - enum NetworkTier { - NETWORK_TIER_UNSPECIFIED = 0, - PREMIUM = 1, - STANDARD = 2 - } - } - - /** Properties of an AliasIpRange. */ - interface IAliasIpRange { - - /** AliasIpRange ipCidrRange */ - ipCidrRange?: (string|null); - - /** AliasIpRange subnetworkRangeName */ - subnetworkRangeName?: (string|null); - } - - /** Represents an AliasIpRange. */ - class AliasIpRange implements IAliasIpRange { - - /** - * Constructs a new AliasIpRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IAliasIpRange); - - /** AliasIpRange ipCidrRange. */ - public ipCidrRange?: (string|null); - - /** AliasIpRange subnetworkRangeName. */ - public subnetworkRangeName?: (string|null); - - /** - * Creates a new AliasIpRange instance using the specified properties. - * @param [properties] Properties to set - * @returns AliasIpRange instance - */ - public static create(properties?: google.cloud.backupdr.v1.IAliasIpRange): google.cloud.backupdr.v1.AliasIpRange; - - /** - * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. - * @param message AliasIpRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. - * @param message AliasIpRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IAliasIpRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AliasIpRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AliasIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AliasIpRange; - - /** - * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AliasIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AliasIpRange; - - /** - * Verifies an AliasIpRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AliasIpRange - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AliasIpRange; - - /** - * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. - * @param message AliasIpRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.AliasIpRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AliasIpRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AliasIpRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an InstanceParams. */ - interface IInstanceParams { - - /** InstanceParams resourceManagerTags */ - resourceManagerTags?: ({ [k: string]: string }|null); - } - - /** Represents an InstanceParams. */ - class InstanceParams implements IInstanceParams { - - /** - * Constructs a new InstanceParams. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IInstanceParams); - - /** InstanceParams resourceManagerTags. */ - public resourceManagerTags: { [k: string]: string }; - - /** - * Creates a new InstanceParams instance using the specified properties. - * @param [properties] Properties to set - * @returns InstanceParams instance - */ - public static create(properties?: google.cloud.backupdr.v1.IInstanceParams): google.cloud.backupdr.v1.InstanceParams; - - /** - * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. - * @param message InstanceParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. - * @param message InstanceParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IInstanceParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InstanceParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InstanceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.InstanceParams; - - /** - * Decodes an InstanceParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InstanceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.InstanceParams; - - /** - * Verifies an InstanceParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InstanceParams - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.InstanceParams; - - /** - * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. - * @param message InstanceParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.InstanceParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InstanceParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InstanceParams - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AllocationAffinity. */ - interface IAllocationAffinity { - - /** AllocationAffinity consumeAllocationType */ - consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); - - /** AllocationAffinity key */ - key?: (string|null); - - /** AllocationAffinity values */ - values?: (string[]|null); - } - - /** Represents an AllocationAffinity. */ - class AllocationAffinity implements IAllocationAffinity { - - /** - * Constructs a new AllocationAffinity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IAllocationAffinity); - - /** AllocationAffinity consumeAllocationType. */ - public consumeAllocationType?: (google.cloud.backupdr.v1.AllocationAffinity.Type|keyof typeof google.cloud.backupdr.v1.AllocationAffinity.Type|null); - - /** AllocationAffinity key. */ - public key?: (string|null); - - /** AllocationAffinity values. */ - public values: string[]; - - /** - * Creates a new AllocationAffinity instance using the specified properties. - * @param [properties] Properties to set - * @returns AllocationAffinity instance - */ - public static create(properties?: google.cloud.backupdr.v1.IAllocationAffinity): google.cloud.backupdr.v1.AllocationAffinity; - - /** - * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. - * @param message AllocationAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. - * @param message AllocationAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IAllocationAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AllocationAffinity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AllocationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AllocationAffinity; - - /** - * Decodes an AllocationAffinity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AllocationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AllocationAffinity; - - /** - * Verifies an AllocationAffinity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AllocationAffinity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AllocationAffinity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AllocationAffinity; - - /** - * Creates a plain object from an AllocationAffinity message. Also converts values to other types if specified. - * @param message AllocationAffinity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.AllocationAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AllocationAffinity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AllocationAffinity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AllocationAffinity { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - NO_RESERVATION = 1, - ANY_RESERVATION = 2, - SPECIFIC_RESERVATION = 3 - } - } - - /** Properties of a Scheduling. */ - interface IScheduling { - - /** Scheduling onHostMaintenance */ - onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); - - /** Scheduling automaticRestart */ - automaticRestart?: (boolean|null); - - /** Scheduling preemptible */ - preemptible?: (boolean|null); - - /** Scheduling nodeAffinities */ - nodeAffinities?: (google.cloud.backupdr.v1.Scheduling.INodeAffinity[]|null); - - /** Scheduling minNodeCpus */ - minNodeCpus?: (number|null); - - /** Scheduling provisioningModel */ - provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); - - /** Scheduling instanceTerminationAction */ - instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); - - /** Scheduling localSsdRecoveryTimeout */ - localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); - } - - /** Represents a Scheduling. */ - class Scheduling implements IScheduling { - - /** - * Constructs a new Scheduling. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IScheduling); - - /** Scheduling onHostMaintenance. */ - public onHostMaintenance?: (google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|keyof typeof google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null); - - /** Scheduling automaticRestart. */ - public automaticRestart?: (boolean|null); - - /** Scheduling preemptible. */ - public preemptible?: (boolean|null); - - /** Scheduling nodeAffinities. */ - public nodeAffinities: google.cloud.backupdr.v1.Scheduling.INodeAffinity[]; - - /** Scheduling minNodeCpus. */ - public minNodeCpus?: (number|null); - - /** Scheduling provisioningModel. */ - public provisioningModel?: (google.cloud.backupdr.v1.Scheduling.ProvisioningModel|keyof typeof google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null); - - /** Scheduling instanceTerminationAction. */ - public instanceTerminationAction?: (google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|keyof typeof google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null); - - /** Scheduling localSsdRecoveryTimeout. */ - public localSsdRecoveryTimeout?: (google.cloud.backupdr.v1.ISchedulingDuration|null); - - /** - * Creates a new Scheduling instance using the specified properties. - * @param [properties] Properties to set - * @returns Scheduling instance - */ - public static create(properties?: google.cloud.backupdr.v1.IScheduling): google.cloud.backupdr.v1.Scheduling; - - /** - * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. - * @param message Scheduling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. - * @param message Scheduling message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IScheduling, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Scheduling message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Scheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling; - - /** - * Decodes a Scheduling message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Scheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling; - - /** - * Verifies a Scheduling message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Scheduling - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling; - - /** - * Creates a plain object from a Scheduling message. Also converts values to other types if specified. - * @param message Scheduling - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Scheduling, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Scheduling to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Scheduling - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace Scheduling { - - /** OnHostMaintenance enum. */ - enum OnHostMaintenance { - ON_HOST_MAINTENANCE_UNSPECIFIED = 0, - TERMINATE = 1, - MIGRATE = 1000 - } - - /** Properties of a NodeAffinity. */ - interface INodeAffinity { - - /** NodeAffinity key */ - key?: (string|null); - - /** NodeAffinity operator */ - operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); - - /** NodeAffinity values */ - values?: (string[]|null); - } - - /** Represents a NodeAffinity. */ - class NodeAffinity implements INodeAffinity { - - /** - * Constructs a new NodeAffinity. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity); - - /** NodeAffinity key. */ - public key?: (string|null); - - /** NodeAffinity operator. */ - public operator?: (google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|keyof typeof google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null); - - /** NodeAffinity values. */ - public values: string[]; - - /** - * Creates a new NodeAffinity instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeAffinity instance - */ - public static create(properties?: google.cloud.backupdr.v1.Scheduling.INodeAffinity): google.cloud.backupdr.v1.Scheduling.NodeAffinity; - - /** - * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. - * @param message NodeAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. - * @param message NodeAffinity message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.Scheduling.INodeAffinity, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeAffinity message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Scheduling.NodeAffinity; - - /** - * Decodes a NodeAffinity message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Scheduling.NodeAffinity; - - /** - * Verifies a NodeAffinity message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeAffinity message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeAffinity - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Scheduling.NodeAffinity; - - /** - * Creates a plain object from a NodeAffinity message. Also converts values to other types if specified. - * @param message NodeAffinity - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Scheduling.NodeAffinity, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeAffinity to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeAffinity - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace NodeAffinity { - - /** Operator enum. */ - enum Operator { - OPERATOR_UNSPECIFIED = 0, - IN = 1, - NOT_IN = 2 - } - } - - /** ProvisioningModel enum. */ - enum ProvisioningModel { - PROVISIONING_MODEL_UNSPECIFIED = 0, - STANDARD = 1, - SPOT = 2 - } - - /** InstanceTerminationAction enum. */ - enum InstanceTerminationAction { - INSTANCE_TERMINATION_ACTION_UNSPECIFIED = 0, - DELETE = 1, - STOP = 2 - } - } - - /** Properties of a SchedulingDuration. */ - interface ISchedulingDuration { - - /** SchedulingDuration seconds */ - seconds?: (number|Long|string|null); - - /** SchedulingDuration nanos */ - nanos?: (number|null); - } - - /** Represents a SchedulingDuration. */ - class SchedulingDuration implements ISchedulingDuration { - - /** - * Constructs a new SchedulingDuration. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ISchedulingDuration); - - /** SchedulingDuration seconds. */ - public seconds?: (number|Long|string|null); - - /** SchedulingDuration nanos. */ - public nanos?: (number|null); - - /** - * Creates a new SchedulingDuration instance using the specified properties. - * @param [properties] Properties to set - * @returns SchedulingDuration instance - */ - public static create(properties?: google.cloud.backupdr.v1.ISchedulingDuration): google.cloud.backupdr.v1.SchedulingDuration; - - /** - * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. - * @param message SchedulingDuration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. - * @param message SchedulingDuration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ISchedulingDuration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SchedulingDuration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SchedulingDuration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.SchedulingDuration; - - /** - * Decodes a SchedulingDuration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SchedulingDuration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.SchedulingDuration; - - /** - * Verifies a SchedulingDuration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SchedulingDuration - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.SchedulingDuration; - - /** - * Creates a plain object from a SchedulingDuration message. Also converts values to other types if specified. - * @param message SchedulingDuration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.SchedulingDuration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SchedulingDuration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for SchedulingDuration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceAccount. */ - interface IServiceAccount { - - /** ServiceAccount email */ - email?: (string|null); - - /** ServiceAccount scopes */ - scopes?: (string[]|null); - } - - /** Represents a ServiceAccount. */ - class ServiceAccount implements IServiceAccount { - - /** - * Constructs a new ServiceAccount. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IServiceAccount); - - /** ServiceAccount email. */ - public email?: (string|null); - - /** ServiceAccount scopes. */ - public scopes: string[]; - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceAccount instance - */ - public static create(properties?: google.cloud.backupdr.v1.IServiceAccount): google.cloud.backupdr.v1.ServiceAccount; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. - * @param message ServiceAccount message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IServiceAccount, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ServiceAccount; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ServiceAccount; - - /** - * Verifies a ServiceAccount message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceAccount - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ServiceAccount; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @param message ServiceAccount - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ServiceAccount, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceAccount to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceAccount - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Tags. */ - interface ITags { - - /** Tags items */ - items?: (string[]|null); - } - - /** Represents a Tags. */ - class Tags implements ITags { - - /** - * Constructs a new Tags. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.ITags); - - /** Tags items. */ - public items: string[]; - - /** - * Creates a new Tags instance using the specified properties. - * @param [properties] Properties to set - * @returns Tags instance - */ - public static create(properties?: google.cloud.backupdr.v1.ITags): google.cloud.backupdr.v1.Tags; - - /** - * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. - * @param message Tags message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. - * @param message Tags message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.ITags, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tags message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tags - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.Tags; - - /** - * Decodes a Tags message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tags - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.Tags; - - /** - * Verifies a Tags message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tags message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tags - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.Tags; - - /** - * Creates a plain object from a Tags message. Also converts values to other types if specified. - * @param message Tags - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.Tags, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tags to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Tags - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an AttachedDisk. */ - interface IAttachedDisk { - - /** AttachedDisk initializeParams */ - initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); - - /** AttachedDisk deviceName */ - deviceName?: (string|null); - - /** AttachedDisk kind */ - kind?: (string|null); - - /** AttachedDisk diskTypeDeprecated */ - diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); - - /** AttachedDisk mode */ - mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); - - /** AttachedDisk source */ - source?: (string|null); - - /** AttachedDisk index */ - index?: (number|Long|string|null); - - /** AttachedDisk boot */ - boot?: (boolean|null); - - /** AttachedDisk autoDelete */ - autoDelete?: (boolean|null); - - /** AttachedDisk license */ - license?: (string[]|null); - - /** AttachedDisk diskInterface */ - diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); - - /** AttachedDisk guestOsFeature */ - guestOsFeature?: (google.cloud.backupdr.v1.IGuestOsFeature[]|null); - - /** AttachedDisk diskEncryptionKey */ - diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); - - /** AttachedDisk diskSizeGb */ - diskSizeGb?: (number|Long|string|null); - - /** AttachedDisk savedState */ - savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); - - /** AttachedDisk diskType */ - diskType?: (string|null); - - /** AttachedDisk type */ - type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); - } - - /** Represents an AttachedDisk. */ - class AttachedDisk implements IAttachedDisk { - - /** - * Constructs a new AttachedDisk. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IAttachedDisk); - - /** AttachedDisk initializeParams. */ - public initializeParams?: (google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null); - - /** AttachedDisk deviceName. */ - public deviceName?: (string|null); - - /** AttachedDisk kind. */ - public kind?: (string|null); - - /** AttachedDisk diskTypeDeprecated. */ - public diskTypeDeprecated?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); - - /** AttachedDisk mode. */ - public mode?: (google.cloud.backupdr.v1.AttachedDisk.DiskMode|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskMode|null); - - /** AttachedDisk source. */ - public source?: (string|null); - - /** AttachedDisk index. */ - public index?: (number|Long|string|null); - - /** AttachedDisk boot. */ - public boot?: (boolean|null); - - /** AttachedDisk autoDelete. */ - public autoDelete?: (boolean|null); - - /** AttachedDisk license. */ - public license: string[]; - - /** AttachedDisk diskInterface. */ - public diskInterface?: (google.cloud.backupdr.v1.AttachedDisk.DiskInterface|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null); - - /** AttachedDisk guestOsFeature. */ - public guestOsFeature: google.cloud.backupdr.v1.IGuestOsFeature[]; - - /** AttachedDisk diskEncryptionKey. */ - public diskEncryptionKey?: (google.cloud.backupdr.v1.ICustomerEncryptionKey|null); - - /** AttachedDisk diskSizeGb. */ - public diskSizeGb?: (number|Long|string|null); - - /** AttachedDisk savedState. */ - public savedState?: (google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null); - - /** AttachedDisk diskType. */ - public diskType?: (string|null); - - /** AttachedDisk type. */ - public type?: (google.cloud.backupdr.v1.AttachedDisk.DiskType|keyof typeof google.cloud.backupdr.v1.AttachedDisk.DiskType|null); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @param [properties] Properties to set - * @returns AttachedDisk instance - */ - public static create(properties?: google.cloud.backupdr.v1.IAttachedDisk): google.cloud.backupdr.v1.AttachedDisk; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. - * @param message AttachedDisk message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IAttachedDisk, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk; - - /** - * Verifies an AttachedDisk message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttachedDisk - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @param message AttachedDisk - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.AttachedDisk, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttachedDisk to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for AttachedDisk - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace AttachedDisk { - - /** Properties of an InitializeParams. */ - interface IInitializeParams { - - /** InitializeParams diskName */ - diskName?: (string|null); - - /** InitializeParams replicaZones */ - replicaZones?: (string[]|null); - } - - /** Represents an InitializeParams. */ - class InitializeParams implements IInitializeParams { - - /** - * Constructs a new InitializeParams. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams); - - /** InitializeParams diskName. */ - public diskName?: (string|null); - - /** InitializeParams replicaZones. */ - public replicaZones: string[]; - - /** - * Creates a new InitializeParams instance using the specified properties. - * @param [properties] Properties to set - * @returns InitializeParams instance - */ - public static create(properties?: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; - - /** - * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. - * @param message InitializeParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. - * @param message InitializeParams message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.AttachedDisk.IInitializeParams, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an InitializeParams message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns InitializeParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; - - /** - * Decodes an InitializeParams message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns InitializeParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; - - /** - * Verifies an InitializeParams message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns InitializeParams - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.AttachedDisk.InitializeParams; - - /** - * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. - * @param message InitializeParams - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.AttachedDisk.InitializeParams, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this InitializeParams to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for InitializeParams - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** DiskType enum. */ - enum DiskType { - DISK_TYPE_UNSPECIFIED = 0, - SCRATCH = 1, - PERSISTENT = 2 - } - - /** DiskMode enum. */ - enum DiskMode { - DISK_MODE_UNSPECIFIED = 0, - READ_WRITE = 1, - READ_ONLY = 2, - LOCKED = 3 - } - - /** DiskInterface enum. */ - enum DiskInterface { - DISK_INTERFACE_UNSPECIFIED = 0, - SCSI = 1, - NVME = 2, - NVDIMM = 3, - ISCSI = 4 - } - - /** DiskSavedState enum. */ - enum DiskSavedState { - DISK_SAVED_STATE_UNSPECIFIED = 0, - PRESERVED = 1 - } - } - - /** Properties of a GuestOsFeature. */ - interface IGuestOsFeature { - - /** GuestOsFeature type */ - type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); - } - - /** Represents a GuestOsFeature. */ - class GuestOsFeature implements IGuestOsFeature { - - /** - * Constructs a new GuestOsFeature. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGuestOsFeature); - - /** GuestOsFeature type. */ - public type?: (google.cloud.backupdr.v1.GuestOsFeature.FeatureType|keyof typeof google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null); - - /** - * Creates a new GuestOsFeature instance using the specified properties. - * @param [properties] Properties to set - * @returns GuestOsFeature instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGuestOsFeature): google.cloud.backupdr.v1.GuestOsFeature; - - /** - * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. - * @param message GuestOsFeature message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. - * @param message GuestOsFeature message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGuestOsFeature, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GuestOsFeature message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GuestOsFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GuestOsFeature; - - /** - * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GuestOsFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GuestOsFeature; - - /** - * Verifies a GuestOsFeature message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GuestOsFeature - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GuestOsFeature; - - /** - * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. - * @param message GuestOsFeature - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GuestOsFeature, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GuestOsFeature to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GuestOsFeature - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace GuestOsFeature { - - /** FeatureType enum. */ - enum FeatureType { - FEATURE_TYPE_UNSPECIFIED = 0, - VIRTIO_SCSI_MULTIQUEUE = 1, - WINDOWS = 2, - MULTI_IP_SUBNET = 3, - UEFI_COMPATIBLE = 4, - SECURE_BOOT = 5, - GVNIC = 6, - SEV_CAPABLE = 7, - BARE_METAL_LINUX_COMPATIBLE = 8, - SUSPEND_RESUME_COMPATIBLE = 9, - SEV_LIVE_MIGRATABLE = 10, - SEV_SNP_CAPABLE = 11, - TDX_CAPABLE = 12, - IDPF = 13, - SEV_LIVE_MIGRATABLE_V2 = 14 - } - } - - /** KeyRevocationActionType enum. */ - enum KeyRevocationActionType { - KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED = 0, - NONE = 1, - STOP = 2 - } - - /** Properties of a DataSourceReference. */ - interface IDataSourceReference { - - /** DataSourceReference name */ - name?: (string|null); - - /** DataSourceReference dataSource */ - dataSource?: (string|null); - - /** DataSourceReference createTime */ - createTime?: (google.protobuf.ITimestamp|null); - - /** DataSourceReference dataSourceBackupConfigState */ - dataSourceBackupConfigState?: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState|null); - - /** DataSourceReference dataSourceBackupCount */ - dataSourceBackupCount?: (number|Long|string|null); - - /** DataSourceReference dataSourceBackupConfigInfo */ - dataSourceBackupConfigInfo?: (google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null); - - /** DataSourceReference dataSourceGcpResourceInfo */ - dataSourceGcpResourceInfo?: (google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null); - - /** DataSourceReference totalStoredBytes */ - totalStoredBytes?: (number|Long|string|null); - } - - /** Represents a DataSourceReference. */ - class DataSourceReference implements IDataSourceReference { - - /** - * Constructs a new DataSourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDataSourceReference); - - /** DataSourceReference name. */ - public name: string; - - /** DataSourceReference dataSource. */ - public dataSource: string; - - /** DataSourceReference createTime. */ - public createTime?: (google.protobuf.ITimestamp|null); - - /** DataSourceReference dataSourceBackupConfigState. */ - public dataSourceBackupConfigState: (google.cloud.backupdr.v1.BackupConfigState|keyof typeof google.cloud.backupdr.v1.BackupConfigState); - - /** DataSourceReference dataSourceBackupCount. */ - public dataSourceBackupCount: (number|Long|string); - - /** DataSourceReference dataSourceBackupConfigInfo. */ - public dataSourceBackupConfigInfo?: (google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null); - - /** DataSourceReference dataSourceGcpResourceInfo. */ - public dataSourceGcpResourceInfo?: (google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null); - - /** DataSourceReference totalStoredBytes. */ - public totalStoredBytes?: (number|Long|string|null); - - /** - * Creates a new DataSourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns DataSourceReference instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDataSourceReference): google.cloud.backupdr.v1.DataSourceReference; - - /** - * Encodes the specified DataSourceReference message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. - * @param message DataSourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDataSourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataSourceReference message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. - * @param message DataSourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataSourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataSourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceReference; - - /** - * Decodes a DataSourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataSourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceReference; - - /** - * Verifies a DataSourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataSourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataSourceReference - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceReference; - - /** - * Creates a plain object from a DataSourceReference message. Also converts values to other types if specified. - * @param message DataSourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DataSourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataSourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataSourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataSourceBackupConfigInfo. */ - interface IDataSourceBackupConfigInfo { - - /** DataSourceBackupConfigInfo lastBackupState */ - lastBackupState?: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null); - - /** DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime */ - lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a DataSourceBackupConfigInfo. */ - class DataSourceBackupConfigInfo implements IDataSourceBackupConfigInfo { - - /** - * Constructs a new DataSourceBackupConfigInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo); - - /** DataSourceBackupConfigInfo lastBackupState. */ - public lastBackupState: (google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|keyof typeof google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState); - - /** DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime. */ - public lastSuccessfulBackupConsistencyTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new DataSourceBackupConfigInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DataSourceBackupConfigInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; - - /** - * Encodes the specified DataSourceBackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. - * @param message DataSourceBackupConfigInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataSourceBackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. - * @param message DataSourceBackupConfigInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceBackupConfigInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataSourceBackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; - - /** - * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataSourceBackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; - - /** - * Verifies a DataSourceBackupConfigInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataSourceBackupConfigInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataSourceBackupConfigInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceBackupConfigInfo; - - /** - * Creates a plain object from a DataSourceBackupConfigInfo message. Also converts values to other types if specified. - * @param message DataSourceBackupConfigInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DataSourceBackupConfigInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataSourceBackupConfigInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataSourceBackupConfigInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DataSourceGcpResourceInfo. */ - interface IDataSourceGcpResourceInfo { - - /** DataSourceGcpResourceInfo gcpResourcename */ - gcpResourcename?: (string|null); - - /** DataSourceGcpResourceInfo type */ - type?: (string|null); - - /** DataSourceGcpResourceInfo location */ - location?: (string|null); - - /** DataSourceGcpResourceInfo cloudSqlInstanceProperties */ - cloudSqlInstanceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null); - } - - /** Represents a DataSourceGcpResourceInfo. */ - class DataSourceGcpResourceInfo implements IDataSourceGcpResourceInfo { - - /** - * Constructs a new DataSourceGcpResourceInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo); - - /** DataSourceGcpResourceInfo gcpResourcename. */ - public gcpResourcename: string; - - /** DataSourceGcpResourceInfo type. */ - public type: string; - - /** DataSourceGcpResourceInfo location. */ - public location: string; - - /** DataSourceGcpResourceInfo cloudSqlInstanceProperties. */ - public cloudSqlInstanceProperties?: (google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null); - - /** DataSourceGcpResourceInfo resourceProperties. */ - public resourceProperties?: "cloudSqlInstanceProperties"; - - /** - * Creates a new DataSourceGcpResourceInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns DataSourceGcpResourceInfo instance - */ - public static create(properties?: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; - - /** - * Encodes the specified DataSourceGcpResourceInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. - * @param message DataSourceGcpResourceInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DataSourceGcpResourceInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. - * @param message DataSourceGcpResourceInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IDataSourceGcpResourceInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DataSourceGcpResourceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; - - /** - * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DataSourceGcpResourceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; - - /** - * Verifies a DataSourceGcpResourceInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DataSourceGcpResourceInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DataSourceGcpResourceInfo - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.DataSourceGcpResourceInfo; - - /** - * Creates a plain object from a DataSourceGcpResourceInfo message. Also converts values to other types if specified. - * @param message DataSourceGcpResourceInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.DataSourceGcpResourceInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DataSourceGcpResourceInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DataSourceGcpResourceInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GetDataSourceReferenceRequest. */ - interface IGetDataSourceReferenceRequest { - - /** GetDataSourceReferenceRequest name */ - name?: (string|null); - } - - /** Represents a GetDataSourceReferenceRequest. */ - class GetDataSourceReferenceRequest implements IGetDataSourceReferenceRequest { - - /** - * Constructs a new GetDataSourceReferenceRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest); - - /** GetDataSourceReferenceRequest name. */ - public name: string; - - /** - * Creates a new GetDataSourceReferenceRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns GetDataSourceReferenceRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; - - /** - * Encodes the specified GetDataSourceReferenceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. - * @param message GetDataSourceReferenceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GetDataSourceReferenceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. - * @param message GetDataSourceReferenceRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GetDataSourceReferenceRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GetDataSourceReferenceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; - - /** - * Decodes a GetDataSourceReferenceRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GetDataSourceReferenceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; - - /** - * Verifies a GetDataSourceReferenceRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GetDataSourceReferenceRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GetDataSourceReferenceRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.GetDataSourceReferenceRequest; - - /** - * Creates a plain object from a GetDataSourceReferenceRequest message. Also converts values to other types if specified. - * @param message GetDataSourceReferenceRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.GetDataSourceReferenceRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GetDataSourceReferenceRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GetDataSourceReferenceRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDataSourceReferencesRequest. */ - interface IListDataSourceReferencesRequest { - - /** ListDataSourceReferencesRequest parent */ - parent?: (string|null); - - /** ListDataSourceReferencesRequest pageSize */ - pageSize?: (number|null); - - /** ListDataSourceReferencesRequest pageToken */ - pageToken?: (string|null); - - /** ListDataSourceReferencesRequest filter */ - filter?: (string|null); - - /** ListDataSourceReferencesRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListDataSourceReferencesRequest. */ - class ListDataSourceReferencesRequest implements IListDataSourceReferencesRequest { - - /** - * Constructs a new ListDataSourceReferencesRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesRequest); - - /** ListDataSourceReferencesRequest parent. */ - public parent: string; - - /** ListDataSourceReferencesRequest pageSize. */ - public pageSize: number; - - /** ListDataSourceReferencesRequest pageToken. */ - public pageToken: string; - - /** ListDataSourceReferencesRequest filter. */ - public filter: string; - - /** ListDataSourceReferencesRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListDataSourceReferencesRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDataSourceReferencesRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesRequest): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; - - /** - * Encodes the specified ListDataSourceReferencesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. - * @param message ListDataSourceReferencesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListDataSourceReferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDataSourceReferencesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. - * @param message ListDataSourceReferencesRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourceReferencesRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDataSourceReferencesRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDataSourceReferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; - - /** - * Decodes a ListDataSourceReferencesRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDataSourceReferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; - - /** - * Verifies a ListDataSourceReferencesRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDataSourceReferencesRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDataSourceReferencesRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourceReferencesRequest; - - /** - * Creates a plain object from a ListDataSourceReferencesRequest message. Also converts values to other types if specified. - * @param message ListDataSourceReferencesRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListDataSourceReferencesRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDataSourceReferencesRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDataSourceReferencesRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListDataSourceReferencesResponse. */ - interface IListDataSourceReferencesResponse { - - /** ListDataSourceReferencesResponse dataSourceReferences */ - dataSourceReferences?: (google.cloud.backupdr.v1.IDataSourceReference[]|null); - - /** ListDataSourceReferencesResponse nextPageToken */ - nextPageToken?: (string|null); - - /** ListDataSourceReferencesResponse unreachable */ - unreachable?: (string[]|null); - } - - /** Represents a ListDataSourceReferencesResponse. */ - class ListDataSourceReferencesResponse implements IListDataSourceReferencesResponse { - - /** - * Constructs a new ListDataSourceReferencesResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesResponse); - - /** ListDataSourceReferencesResponse dataSourceReferences. */ - public dataSourceReferences: google.cloud.backupdr.v1.IDataSourceReference[]; - - /** ListDataSourceReferencesResponse nextPageToken. */ - public nextPageToken: string; - - /** ListDataSourceReferencesResponse unreachable. */ - public unreachable: string[]; - - /** - * Creates a new ListDataSourceReferencesResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListDataSourceReferencesResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListDataSourceReferencesResponse): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; - - /** - * Encodes the specified ListDataSourceReferencesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. - * @param message ListDataSourceReferencesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListDataSourceReferencesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListDataSourceReferencesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. - * @param message ListDataSourceReferencesResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListDataSourceReferencesResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListDataSourceReferencesResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListDataSourceReferencesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; - - /** - * Decodes a ListDataSourceReferencesResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListDataSourceReferencesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; - - /** - * Verifies a ListDataSourceReferencesResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListDataSourceReferencesResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListDataSourceReferencesResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListDataSourceReferencesResponse; - - /** - * Creates a plain object from a ListDataSourceReferencesResponse message. Also converts values to other types if specified. - * @param message ListDataSourceReferencesResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListDataSourceReferencesResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListDataSourceReferencesResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListDataSourceReferencesResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchDataSourceReferencesForResourceTypeRequest. */ - interface IFetchDataSourceReferencesForResourceTypeRequest { - - /** FetchDataSourceReferencesForResourceTypeRequest parent */ - parent?: (string|null); - - /** FetchDataSourceReferencesForResourceTypeRequest resourceType */ - resourceType?: (string|null); - - /** FetchDataSourceReferencesForResourceTypeRequest pageSize */ - pageSize?: (number|null); - - /** FetchDataSourceReferencesForResourceTypeRequest pageToken */ - pageToken?: (string|null); - - /** FetchDataSourceReferencesForResourceTypeRequest filter */ - filter?: (string|null); - - /** FetchDataSourceReferencesForResourceTypeRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a FetchDataSourceReferencesForResourceTypeRequest. */ - class FetchDataSourceReferencesForResourceTypeRequest implements IFetchDataSourceReferencesForResourceTypeRequest { - - /** - * Constructs a new FetchDataSourceReferencesForResourceTypeRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest); - - /** FetchDataSourceReferencesForResourceTypeRequest parent. */ - public parent: string; - - /** FetchDataSourceReferencesForResourceTypeRequest resourceType. */ - public resourceType: string; - - /** FetchDataSourceReferencesForResourceTypeRequest pageSize. */ - public pageSize: number; - - /** FetchDataSourceReferencesForResourceTypeRequest pageToken. */ - public pageToken: string; - - /** FetchDataSourceReferencesForResourceTypeRequest filter. */ - public filter: string; - - /** FetchDataSourceReferencesForResourceTypeRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new FetchDataSourceReferencesForResourceTypeRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchDataSourceReferencesForResourceTypeRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. - * @param message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. - * @param message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchDataSourceReferencesForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchDataSourceReferencesForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; - - /** - * Verifies a FetchDataSourceReferencesForResourceTypeRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchDataSourceReferencesForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchDataSourceReferencesForResourceTypeRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest; - - /** - * Creates a plain object from a FetchDataSourceReferencesForResourceTypeRequest message. Also converts values to other types if specified. - * @param message FetchDataSourceReferencesForResourceTypeRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchDataSourceReferencesForResourceTypeRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchDataSourceReferencesForResourceTypeRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FetchDataSourceReferencesForResourceTypeResponse. */ - interface IFetchDataSourceReferencesForResourceTypeResponse { - - /** FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences */ - dataSourceReferences?: (google.cloud.backupdr.v1.IDataSourceReference[]|null); - - /** FetchDataSourceReferencesForResourceTypeResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a FetchDataSourceReferencesForResourceTypeResponse. */ - class FetchDataSourceReferencesForResourceTypeResponse implements IFetchDataSourceReferencesForResourceTypeResponse { - - /** - * Constructs a new FetchDataSourceReferencesForResourceTypeResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse); - - /** FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences. */ - public dataSourceReferences: google.cloud.backupdr.v1.IDataSourceReference[]; - - /** FetchDataSourceReferencesForResourceTypeResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new FetchDataSourceReferencesForResourceTypeResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns FetchDataSourceReferencesForResourceTypeResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. - * @param message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. - * @param message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FetchDataSourceReferencesForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FetchDataSourceReferencesForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; - - /** - * Verifies a FetchDataSourceReferencesForResourceTypeResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FetchDataSourceReferencesForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FetchDataSourceReferencesForResourceTypeResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse; - - /** - * Creates a plain object from a FetchDataSourceReferencesForResourceTypeResponse message. Also converts values to other types if specified. - * @param message FetchDataSourceReferencesForResourceTypeResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FetchDataSourceReferencesForResourceTypeResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FetchDataSourceReferencesForResourceTypeResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Represents a BackupDrProtectionSummary */ - class BackupDrProtectionSummary extends $protobuf.rpc.Service { - - /** - * Constructs a new BackupDrProtectionSummary 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 BackupDrProtectionSummary 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): BackupDrProtectionSummary; - - /** - * Calls ListResourceBackupConfigs. - * @param request ListResourceBackupConfigsRequest message or plain object - * @param callback Node-style callback called with the error, if any, and ListResourceBackupConfigsResponse - */ - public listResourceBackupConfigs(request: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, callback: google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigsCallback): void; - - /** - * Calls ListResourceBackupConfigs. - * @param request ListResourceBackupConfigsRequest message or plain object - * @returns Promise - */ - public listResourceBackupConfigs(request: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest): Promise; - } - - namespace BackupDrProtectionSummary { - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDrProtectionSummary|listResourceBackupConfigs}. - * @param error Error, if any - * @param [response] ListResourceBackupConfigsResponse - */ - type ListResourceBackupConfigsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListResourceBackupConfigsResponse) => void; - } - - /** Properties of a ListResourceBackupConfigsRequest. */ - interface IListResourceBackupConfigsRequest { - - /** ListResourceBackupConfigsRequest parent */ - parent?: (string|null); - - /** ListResourceBackupConfigsRequest pageSize */ - pageSize?: (number|null); - - /** ListResourceBackupConfigsRequest pageToken */ - pageToken?: (string|null); - - /** ListResourceBackupConfigsRequest filter */ - filter?: (string|null); - - /** ListResourceBackupConfigsRequest orderBy */ - orderBy?: (string|null); - } - - /** Represents a ListResourceBackupConfigsRequest. */ - class ListResourceBackupConfigsRequest implements IListResourceBackupConfigsRequest { - - /** - * Constructs a new ListResourceBackupConfigsRequest. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest); - - /** ListResourceBackupConfigsRequest parent. */ - public parent: string; - - /** ListResourceBackupConfigsRequest pageSize. */ - public pageSize: number; - - /** ListResourceBackupConfigsRequest pageToken. */ - public pageToken: string; - - /** ListResourceBackupConfigsRequest filter. */ - public filter: string; - - /** ListResourceBackupConfigsRequest orderBy. */ - public orderBy: string; - - /** - * Creates a new ListResourceBackupConfigsRequest instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceBackupConfigsRequest instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; - - /** - * Encodes the specified ListResourceBackupConfigsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. - * @param message ListResourceBackupConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceBackupConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. - * @param message ListResourceBackupConfigsRequest message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceBackupConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; - - /** - * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceBackupConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; - - /** - * Verifies a ListResourceBackupConfigsRequest message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceBackupConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceBackupConfigsRequest - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; - - /** - * Creates a plain object from a ListResourceBackupConfigsRequest message. Also converts values to other types if specified. - * @param message ListResourceBackupConfigsRequest - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListResourceBackupConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceBackupConfigsRequest to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceBackupConfigsRequest - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ListResourceBackupConfigsResponse. */ - interface IListResourceBackupConfigsResponse { - - /** ListResourceBackupConfigsResponse resourceBackupConfigs */ - resourceBackupConfigs?: (google.cloud.backupdr.v1.IResourceBackupConfig[]|null); - - /** ListResourceBackupConfigsResponse nextPageToken */ - nextPageToken?: (string|null); - } - - /** Represents a ListResourceBackupConfigsResponse. */ - class ListResourceBackupConfigsResponse implements IListResourceBackupConfigsResponse { - - /** - * Constructs a new ListResourceBackupConfigsResponse. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse); - - /** ListResourceBackupConfigsResponse resourceBackupConfigs. */ - public resourceBackupConfigs: google.cloud.backupdr.v1.IResourceBackupConfig[]; - - /** ListResourceBackupConfigsResponse nextPageToken. */ - public nextPageToken: string; - - /** - * Creates a new ListResourceBackupConfigsResponse instance using the specified properties. - * @param [properties] Properties to set - * @returns ListResourceBackupConfigsResponse instance - */ - public static create(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; - - /** - * Encodes the specified ListResourceBackupConfigsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. - * @param message ListResourceBackupConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ListResourceBackupConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. - * @param message ListResourceBackupConfigsResponse message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ListResourceBackupConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; - - /** - * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ListResourceBackupConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; - - /** - * Verifies a ListResourceBackupConfigsResponse message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ListResourceBackupConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ListResourceBackupConfigsResponse - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; - - /** - * Creates a plain object from a ListResourceBackupConfigsResponse message. Also converts values to other types if specified. - * @param message ListResourceBackupConfigsResponse - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ListResourceBackupConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ListResourceBackupConfigsResponse to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ListResourceBackupConfigsResponse - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ResourceBackupConfig. */ - interface IResourceBackupConfig { - - /** ResourceBackupConfig name */ - name?: (string|null); - - /** ResourceBackupConfig uid */ - uid?: (string|null); - - /** ResourceBackupConfig targetResource */ - targetResource?: (string|null); - - /** ResourceBackupConfig targetResourceDisplayName */ - targetResourceDisplayName?: (string|null); - - /** ResourceBackupConfig targetResourceType */ - targetResourceType?: (google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|keyof typeof google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|null); - - /** ResourceBackupConfig targetResourceLabels */ - targetResourceLabels?: ({ [k: string]: string }|null); - - /** ResourceBackupConfig backupConfigsDetails */ - backupConfigsDetails?: (google.cloud.backupdr.v1.IBackupConfigDetails[]|null); - - /** ResourceBackupConfig backupConfigured */ - backupConfigured?: (boolean|null); - - /** ResourceBackupConfig vaulted */ - vaulted?: (boolean|null); - } - - /** Represents a ResourceBackupConfig. */ - class ResourceBackupConfig implements IResourceBackupConfig { - - /** - * Constructs a new ResourceBackupConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IResourceBackupConfig); - - /** ResourceBackupConfig name. */ - public name: string; - - /** ResourceBackupConfig uid. */ - public uid: string; - - /** ResourceBackupConfig targetResource. */ - public targetResource: string; - - /** ResourceBackupConfig targetResourceDisplayName. */ - public targetResourceDisplayName: string; - - /** ResourceBackupConfig targetResourceType. */ - public targetResourceType: (google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|keyof typeof google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType); - - /** ResourceBackupConfig targetResourceLabels. */ - public targetResourceLabels: { [k: string]: string }; - - /** ResourceBackupConfig backupConfigsDetails. */ - public backupConfigsDetails: google.cloud.backupdr.v1.IBackupConfigDetails[]; - - /** ResourceBackupConfig backupConfigured. */ - public backupConfigured: boolean; - - /** ResourceBackupConfig vaulted. */ - public vaulted: boolean; - - /** - * Creates a new ResourceBackupConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceBackupConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IResourceBackupConfig): google.cloud.backupdr.v1.ResourceBackupConfig; - - /** - * Encodes the specified ResourceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. - * @param message ResourceBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IResourceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. - * @param message ResourceBackupConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IResourceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceBackupConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ResourceBackupConfig; - - /** - * Decodes a ResourceBackupConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ResourceBackupConfig; - - /** - * Verifies a ResourceBackupConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceBackupConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceBackupConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ResourceBackupConfig; - - /** - * Creates a plain object from a ResourceBackupConfig message. Also converts values to other types if specified. - * @param message ResourceBackupConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.ResourceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceBackupConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceBackupConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceBackupConfig { - - /** ResourceType enum. */ - enum ResourceType { - RESOURCE_TYPE_UNSPECIFIED = 0, - CLOUD_SQL_INSTANCE = 1, - COMPUTE_ENGINE_VM = 2, - COMPUTE_ENGINE_DISK = 3, - COMPUTE_ENGINE_REGIONAL_DISK = 4 - } - } - - /** Properties of a BackupConfigDetails. */ - interface IBackupConfigDetails { - - /** BackupConfigDetails backupConfigSource */ - backupConfigSource?: (string|null); - - /** BackupConfigDetails backupConfigSourceDisplayName */ - backupConfigSourceDisplayName?: (string|null); - - /** BackupConfigDetails type */ - type?: (google.cloud.backupdr.v1.BackupConfigDetails.Type|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.Type|null); - - /** BackupConfigDetails state */ - state?: (google.cloud.backupdr.v1.BackupConfigDetails.State|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.State|null); - - /** BackupConfigDetails pitrSettings */ - pitrSettings?: (google.cloud.backupdr.v1.IPitrSettings|null); - - /** BackupConfigDetails latestSuccessfulBackupTime */ - latestSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); - - /** BackupConfigDetails applicableResource */ - applicableResource?: (string|null); - - /** BackupConfigDetails backupVault */ - backupVault?: (string|null); - - /** BackupConfigDetails backupLocations */ - backupLocations?: (google.cloud.backupdr.v1.IBackupLocation[]|null); - - /** BackupConfigDetails backupDrPlanConfig */ - backupDrPlanConfig?: (google.cloud.backupdr.v1.IBackupDrPlanConfig|null); - - /** BackupConfigDetails backupDrTemplateConfig */ - backupDrTemplateConfig?: (google.cloud.backupdr.v1.IBackupDrTemplateConfig|null); - } - - /** Represents a BackupConfigDetails. */ - class BackupConfigDetails implements IBackupConfigDetails { - - /** - * Constructs a new BackupConfigDetails. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupConfigDetails); - - /** BackupConfigDetails backupConfigSource. */ - public backupConfigSource: string; - - /** BackupConfigDetails backupConfigSourceDisplayName. */ - public backupConfigSourceDisplayName: string; - - /** BackupConfigDetails type. */ - public type: (google.cloud.backupdr.v1.BackupConfigDetails.Type|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.Type); - - /** BackupConfigDetails state. */ - public state: (google.cloud.backupdr.v1.BackupConfigDetails.State|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.State); - - /** BackupConfigDetails pitrSettings. */ - public pitrSettings?: (google.cloud.backupdr.v1.IPitrSettings|null); - - /** BackupConfigDetails latestSuccessfulBackupTime. */ - public latestSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); - - /** BackupConfigDetails applicableResource. */ - public applicableResource: string; - - /** BackupConfigDetails backupVault. */ - public backupVault: string; - - /** BackupConfigDetails backupLocations. */ - public backupLocations: google.cloud.backupdr.v1.IBackupLocation[]; - - /** BackupConfigDetails backupDrPlanConfig. */ - public backupDrPlanConfig?: (google.cloud.backupdr.v1.IBackupDrPlanConfig|null); - - /** BackupConfigDetails backupDrTemplateConfig. */ - public backupDrTemplateConfig?: (google.cloud.backupdr.v1.IBackupDrTemplateConfig|null); - - /** BackupConfigDetails planSpecificConfig. */ - public planSpecificConfig?: ("backupDrPlanConfig"|"backupDrTemplateConfig"); - - /** - * Creates a new BackupConfigDetails instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupConfigDetails instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupConfigDetails): google.cloud.backupdr.v1.BackupConfigDetails; - - /** - * Encodes the specified BackupConfigDetails message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. - * @param message BackupConfigDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupConfigDetails message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. - * @param message BackupConfigDetails message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupConfigDetails message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupConfigDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigDetails; - - /** - * Decodes a BackupConfigDetails message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupConfigDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigDetails; - - /** - * Verifies a BackupConfigDetails message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupConfigDetails message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupConfigDetails - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigDetails; - - /** - * Creates a plain object from a BackupConfigDetails message. Also converts values to other types if specified. - * @param message BackupConfigDetails - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupConfigDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupConfigDetails to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupConfigDetails - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupConfigDetails { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - CLOUD_SQL_INSTANCE_BACKUP_CONFIG = 1, - COMPUTE_ENGINE_RESOURCE_POLICY = 2, - BACKUPDR_BACKUP_PLAN = 3, - BACKUPDR_TEMPLATE = 4 - } - - /** State enum. */ - enum State { - STATE_UNSPECIFIED = 0, - ACTIVE = 1, - INACTIVE = 2, - ERROR = 3 - } - } - - /** Properties of a PitrSettings. */ - interface IPitrSettings { - - /** PitrSettings retentionDays */ - retentionDays?: (number|null); - } - - /** Represents a PitrSettings. */ - class PitrSettings implements IPitrSettings { - - /** - * Constructs a new PitrSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IPitrSettings); - - /** PitrSettings retentionDays. */ - public retentionDays: number; - - /** - * Creates a new PitrSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PitrSettings instance - */ - public static create(properties?: google.cloud.backupdr.v1.IPitrSettings): google.cloud.backupdr.v1.PitrSettings; - - /** - * Encodes the specified PitrSettings message. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. - * @param message PitrSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IPitrSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PitrSettings message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. - * @param message PitrSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IPitrSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PitrSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PitrSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.PitrSettings; - - /** - * Decodes a PitrSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PitrSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.PitrSettings; - - /** - * Verifies a PitrSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PitrSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PitrSettings - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.PitrSettings; - - /** - * Creates a plain object from a PitrSettings message. Also converts values to other types if specified. - * @param message PitrSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.PitrSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PitrSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PitrSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupDrTemplateConfig. */ - interface IBackupDrTemplateConfig { - - /** BackupDrTemplateConfig firstPartyManagementUri */ - firstPartyManagementUri?: (string|null); - - /** BackupDrTemplateConfig thirdPartyManagementUri */ - thirdPartyManagementUri?: (string|null); - } - - /** Represents a BackupDrTemplateConfig. */ - class BackupDrTemplateConfig implements IBackupDrTemplateConfig { - - /** - * Constructs a new BackupDrTemplateConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupDrTemplateConfig); - - /** BackupDrTemplateConfig firstPartyManagementUri. */ - public firstPartyManagementUri: string; - - /** BackupDrTemplateConfig thirdPartyManagementUri. */ - public thirdPartyManagementUri: string; - - /** - * Creates a new BackupDrTemplateConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupDrTemplateConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupDrTemplateConfig): google.cloud.backupdr.v1.BackupDrTemplateConfig; - - /** - * Encodes the specified BackupDrTemplateConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. - * @param message BackupDrTemplateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupDrTemplateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupDrTemplateConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. - * @param message BackupDrTemplateConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrTemplateConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupDrTemplateConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupDrTemplateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrTemplateConfig; - - /** - * Decodes a BackupDrTemplateConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupDrTemplateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrTemplateConfig; - - /** - * Verifies a BackupDrTemplateConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupDrTemplateConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupDrTemplateConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrTemplateConfig; - - /** - * Creates a plain object from a BackupDrTemplateConfig message. Also converts values to other types if specified. - * @param message BackupDrTemplateConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupDrTemplateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupDrTemplateConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupDrTemplateConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupDrPlanConfig. */ - interface IBackupDrPlanConfig { - - /** BackupDrPlanConfig backupDrPlanRules */ - backupDrPlanRules?: (google.cloud.backupdr.v1.IBackupDrPlanRule[]|null); - } - - /** Represents a BackupDrPlanConfig. */ - class BackupDrPlanConfig implements IBackupDrPlanConfig { - - /** - * Constructs a new BackupDrPlanConfig. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupDrPlanConfig); - - /** BackupDrPlanConfig backupDrPlanRules. */ - public backupDrPlanRules: google.cloud.backupdr.v1.IBackupDrPlanRule[]; - - /** - * Creates a new BackupDrPlanConfig instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupDrPlanConfig instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupDrPlanConfig): google.cloud.backupdr.v1.BackupDrPlanConfig; - - /** - * Encodes the specified BackupDrPlanConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. - * @param message BackupDrPlanConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupDrPlanConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupDrPlanConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. - * @param message BackupDrPlanConfig message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrPlanConfig, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupDrPlanConfig message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupDrPlanConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrPlanConfig; - - /** - * Decodes a BackupDrPlanConfig message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupDrPlanConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrPlanConfig; - - /** - * Verifies a BackupDrPlanConfig message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupDrPlanConfig message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupDrPlanConfig - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrPlanConfig; - - /** - * Creates a plain object from a BackupDrPlanConfig message. Also converts values to other types if specified. - * @param message BackupDrPlanConfig - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupDrPlanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupDrPlanConfig to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupDrPlanConfig - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupDrPlanRule. */ - interface IBackupDrPlanRule { - - /** BackupDrPlanRule ruleId */ - ruleId?: (string|null); - - /** BackupDrPlanRule lastSuccessfulBackupTime */ - lastSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); - } - - /** Represents a BackupDrPlanRule. */ - class BackupDrPlanRule implements IBackupDrPlanRule { - - /** - * Constructs a new BackupDrPlanRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupDrPlanRule); - - /** BackupDrPlanRule ruleId. */ - public ruleId: string; - - /** BackupDrPlanRule lastSuccessfulBackupTime. */ - public lastSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); - - /** - * Creates a new BackupDrPlanRule instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupDrPlanRule instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupDrPlanRule): google.cloud.backupdr.v1.BackupDrPlanRule; - - /** - * Encodes the specified BackupDrPlanRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. - * @param message BackupDrPlanRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupDrPlanRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupDrPlanRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. - * @param message BackupDrPlanRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrPlanRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupDrPlanRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupDrPlanRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrPlanRule; - - /** - * Decodes a BackupDrPlanRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupDrPlanRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrPlanRule; - - /** - * Verifies a BackupDrPlanRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupDrPlanRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupDrPlanRule - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrPlanRule; - - /** - * Creates a plain object from a BackupDrPlanRule message. Also converts values to other types if specified. - * @param message BackupDrPlanRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupDrPlanRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupDrPlanRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupDrPlanRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a BackupLocation. */ - interface IBackupLocation { - - /** BackupLocation type */ - type?: (google.cloud.backupdr.v1.BackupLocation.Type|keyof typeof google.cloud.backupdr.v1.BackupLocation.Type|null); - - /** BackupLocation locationId */ - locationId?: (string|null); - } - - /** Represents a BackupLocation. */ - class BackupLocation implements IBackupLocation { - - /** - * Constructs a new BackupLocation. - * @param [properties] Properties to set - */ - constructor(properties?: google.cloud.backupdr.v1.IBackupLocation); - - /** BackupLocation type. */ - public type: (google.cloud.backupdr.v1.BackupLocation.Type|keyof typeof google.cloud.backupdr.v1.BackupLocation.Type); - - /** BackupLocation locationId. */ - public locationId: string; - - /** - * Creates a new BackupLocation instance using the specified properties. - * @param [properties] Properties to set - * @returns BackupLocation instance - */ - public static create(properties?: google.cloud.backupdr.v1.IBackupLocation): google.cloud.backupdr.v1.BackupLocation; - - /** - * Encodes the specified BackupLocation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. - * @param message BackupLocation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.cloud.backupdr.v1.IBackupLocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified BackupLocation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. - * @param message BackupLocation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a BackupLocation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns BackupLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLocation; - - /** - * Decodes a BackupLocation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns BackupLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLocation; - - /** - * Verifies a BackupLocation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a BackupLocation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns BackupLocation - */ - public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLocation; - - /** - * Creates a plain object from a BackupLocation message. Also converts values to other types if specified. - * @param message BackupLocation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.cloud.backupdr.v1.BackupLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this BackupLocation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for BackupLocation - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace BackupLocation { - - /** Type enum. */ - enum Type { - TYPE_UNSPECIFIED = 0, - ZONAL = 1, - REGIONAL = 2, - MULTI_REGIONAL = 3 - } - } - } - } - } - - /** Namespace api. */ - namespace api { - - /** Properties of a Http. */ - interface IHttp { - - /** Http rules */ - rules?: (google.api.IHttpRule[]|null); - - /** Http fullyDecodeReservedExpansion */ - fullyDecodeReservedExpansion?: (boolean|null); - } - - /** Represents a Http. */ - class Http implements IHttp { - - /** - * Constructs a new Http. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttp); - - /** Http rules. */ - public rules: google.api.IHttpRule[]; - - /** Http fullyDecodeReservedExpansion. */ - public fullyDecodeReservedExpansion: boolean; - - /** - * Creates a new Http instance using the specified properties. - * @param [properties] Properties to set - * @returns Http instance - */ - public static create(properties?: google.api.IHttp): google.api.Http; - - /** - * Encodes the specified Http message. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Http message, length delimited. Does not implicitly {@link google.api.Http.verify|verify} messages. - * @param message Http message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttp, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Http message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Http; - - /** - * Decodes a Http message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Http - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Http; - - /** - * Verifies a Http message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Http message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Http - */ - public static fromObject(object: { [k: string]: any }): google.api.Http; - - /** - * Creates a plain object from a Http message. Also converts values to other types if specified. - * @param message Http - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Http, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Http to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Http - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a HttpRule. */ - interface IHttpRule { - - /** HttpRule selector */ - selector?: (string|null); - - /** HttpRule get */ - get?: (string|null); - - /** HttpRule put */ - put?: (string|null); - - /** HttpRule post */ - post?: (string|null); - - /** HttpRule delete */ - "delete"?: (string|null); - - /** HttpRule patch */ - patch?: (string|null); - - /** HttpRule custom */ - custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body */ - body?: (string|null); - - /** HttpRule responseBody */ - responseBody?: (string|null); - - /** HttpRule additionalBindings */ - additionalBindings?: (google.api.IHttpRule[]|null); - } - - /** Represents a HttpRule. */ - class HttpRule implements IHttpRule { - - /** - * Constructs a new HttpRule. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IHttpRule); - - /** HttpRule selector. */ - public selector: string; - - /** HttpRule get. */ - public get?: (string|null); - - /** HttpRule put. */ - public put?: (string|null); - - /** HttpRule post. */ - public post?: (string|null); - - /** HttpRule delete. */ - public delete?: (string|null); - - /** HttpRule patch. */ - public patch?: (string|null); - - /** HttpRule custom. */ - public custom?: (google.api.ICustomHttpPattern|null); - - /** HttpRule body. */ - public body: string; - - /** HttpRule responseBody. */ - public responseBody: string; - - /** HttpRule additionalBindings. */ - public additionalBindings: google.api.IHttpRule[]; - - /** HttpRule pattern. */ - public pattern?: ("get"|"put"|"post"|"delete"|"patch"|"custom"); - - /** - * Creates a new HttpRule instance using the specified properties. - * @param [properties] Properties to set - * @returns HttpRule instance - */ - public static create(properties?: google.api.IHttpRule): google.api.HttpRule; - - /** - * Encodes the specified HttpRule message. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified HttpRule message, length delimited. Does not implicitly {@link google.api.HttpRule.verify|verify} messages. - * @param message HttpRule message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IHttpRule, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a HttpRule message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.HttpRule; - - /** - * Decodes a HttpRule message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns HttpRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.HttpRule; - - /** - * Verifies a HttpRule message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a HttpRule message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns HttpRule - */ - public static fromObject(object: { [k: string]: any }): google.api.HttpRule; - - /** - * Creates a plain object from a HttpRule message. Also converts values to other types if specified. - * @param message HttpRule - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.HttpRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this HttpRule to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for HttpRule - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CustomHttpPattern. */ - interface ICustomHttpPattern { - - /** CustomHttpPattern kind */ - kind?: (string|null); - - /** CustomHttpPattern path */ - path?: (string|null); - } - - /** Represents a CustomHttpPattern. */ - class CustomHttpPattern implements ICustomHttpPattern { - - /** - * Constructs a new CustomHttpPattern. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICustomHttpPattern); - - /** CustomHttpPattern kind. */ - public kind: string; - - /** CustomHttpPattern path. */ - public path: string; - - /** - * Creates a new CustomHttpPattern instance using the specified properties. - * @param [properties] Properties to set - * @returns CustomHttpPattern instance - */ - public static create(properties?: google.api.ICustomHttpPattern): google.api.CustomHttpPattern; - - /** - * Encodes the specified CustomHttpPattern message. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CustomHttpPattern message, length delimited. Does not implicitly {@link google.api.CustomHttpPattern.verify|verify} messages. - * @param message CustomHttpPattern message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICustomHttpPattern, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CustomHttpPattern; - - /** - * Decodes a CustomHttpPattern message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CustomHttpPattern - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CustomHttpPattern; - - /** - * Verifies a CustomHttpPattern message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CustomHttpPattern message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CustomHttpPattern - */ - public static fromObject(object: { [k: string]: any }): google.api.CustomHttpPattern; - - /** - * Creates a plain object from a CustomHttpPattern message. Also converts values to other types if specified. - * @param message CustomHttpPattern - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CustomHttpPattern, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CustomHttpPattern to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CustomHttpPattern - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CommonLanguageSettings. */ - interface ICommonLanguageSettings { - - /** CommonLanguageSettings referenceDocsUri */ - referenceDocsUri?: (string|null); - - /** CommonLanguageSettings destinations */ - destinations?: (google.api.ClientLibraryDestination[]|null); - } - - /** Represents a CommonLanguageSettings. */ - class CommonLanguageSettings implements ICommonLanguageSettings { - - /** - * Constructs a new CommonLanguageSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICommonLanguageSettings); - - /** CommonLanguageSettings referenceDocsUri. */ - public referenceDocsUri: string; - - /** CommonLanguageSettings destinations. */ - public destinations: google.api.ClientLibraryDestination[]; - - /** - * Creates a new CommonLanguageSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CommonLanguageSettings instance - */ - public static create(properties?: google.api.ICommonLanguageSettings): google.api.CommonLanguageSettings; - - /** - * Encodes the specified CommonLanguageSettings message. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CommonLanguageSettings message, length delimited. Does not implicitly {@link google.api.CommonLanguageSettings.verify|verify} messages. - * @param message CommonLanguageSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICommonLanguageSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CommonLanguageSettings; - - /** - * Decodes a CommonLanguageSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CommonLanguageSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CommonLanguageSettings; - - /** - * Verifies a CommonLanguageSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CommonLanguageSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CommonLanguageSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CommonLanguageSettings; - - /** - * Creates a plain object from a CommonLanguageSettings message. Also converts values to other types if specified. - * @param message CommonLanguageSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CommonLanguageSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CommonLanguageSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CommonLanguageSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ClientLibrarySettings. */ - interface IClientLibrarySettings { - - /** ClientLibrarySettings version */ - version?: (string|null); - - /** ClientLibrarySettings launchStage */ - launchStage?: (google.api.LaunchStage|keyof typeof google.api.LaunchStage|null); - - /** ClientLibrarySettings restNumericEnums */ - restNumericEnums?: (boolean|null); - - /** ClientLibrarySettings javaSettings */ - javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings */ - cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings */ - phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings */ - pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings */ - nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings */ - dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings */ - rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings */ - goSettings?: (google.api.IGoSettings|null); - } - - /** Represents a ClientLibrarySettings. */ - class ClientLibrarySettings implements IClientLibrarySettings { - - /** - * Constructs a new ClientLibrarySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IClientLibrarySettings); - - /** ClientLibrarySettings version. */ - public version: string; - - /** ClientLibrarySettings launchStage. */ - public launchStage: (google.api.LaunchStage|keyof typeof google.api.LaunchStage); - - /** ClientLibrarySettings restNumericEnums. */ - public restNumericEnums: boolean; - - /** ClientLibrarySettings javaSettings. */ - public javaSettings?: (google.api.IJavaSettings|null); - - /** ClientLibrarySettings cppSettings. */ - public cppSettings?: (google.api.ICppSettings|null); - - /** ClientLibrarySettings phpSettings. */ - public phpSettings?: (google.api.IPhpSettings|null); - - /** ClientLibrarySettings pythonSettings. */ - public pythonSettings?: (google.api.IPythonSettings|null); - - /** ClientLibrarySettings nodeSettings. */ - public nodeSettings?: (google.api.INodeSettings|null); - - /** ClientLibrarySettings dotnetSettings. */ - public dotnetSettings?: (google.api.IDotnetSettings|null); - - /** ClientLibrarySettings rubySettings. */ - public rubySettings?: (google.api.IRubySettings|null); - - /** ClientLibrarySettings goSettings. */ - public goSettings?: (google.api.IGoSettings|null); - - /** - * Creates a new ClientLibrarySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns ClientLibrarySettings instance - */ - public static create(properties?: google.api.IClientLibrarySettings): google.api.ClientLibrarySettings; - - /** - * Encodes the specified ClientLibrarySettings message. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ClientLibrarySettings message, length delimited. Does not implicitly {@link google.api.ClientLibrarySettings.verify|verify} messages. - * @param message ClientLibrarySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IClientLibrarySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ClientLibrarySettings; - - /** - * Decodes a ClientLibrarySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ClientLibrarySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ClientLibrarySettings; - - /** - * Verifies a ClientLibrarySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ClientLibrarySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ClientLibrarySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.ClientLibrarySettings; - - /** - * Creates a plain object from a ClientLibrarySettings message. Also converts values to other types if specified. - * @param message ClientLibrarySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ClientLibrarySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ClientLibrarySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ClientLibrarySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a Publishing. */ - interface IPublishing { - - /** Publishing methodSettings */ - methodSettings?: (google.api.IMethodSettings[]|null); - - /** Publishing newIssueUri */ - newIssueUri?: (string|null); - - /** Publishing documentationUri */ - documentationUri?: (string|null); - - /** Publishing apiShortName */ - apiShortName?: (string|null); - - /** Publishing githubLabel */ - githubLabel?: (string|null); - - /** Publishing codeownerGithubTeams */ - codeownerGithubTeams?: (string[]|null); - - /** Publishing docTagPrefix */ - docTagPrefix?: (string|null); - - /** Publishing organization */ - organization?: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization|null); - - /** Publishing librarySettings */ - librarySettings?: (google.api.IClientLibrarySettings[]|null); - - /** Publishing protoReferenceDocumentationUri */ - protoReferenceDocumentationUri?: (string|null); - - /** Publishing restReferenceDocumentationUri */ - restReferenceDocumentationUri?: (string|null); - } - - /** Represents a Publishing. */ - class Publishing implements IPublishing { - - /** - * Constructs a new Publishing. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPublishing); - - /** Publishing methodSettings. */ - public methodSettings: google.api.IMethodSettings[]; - - /** Publishing newIssueUri. */ - public newIssueUri: string; - - /** Publishing documentationUri. */ - public documentationUri: string; - - /** Publishing apiShortName. */ - public apiShortName: string; - - /** Publishing githubLabel. */ - public githubLabel: string; - - /** Publishing codeownerGithubTeams. */ - public codeownerGithubTeams: string[]; - - /** Publishing docTagPrefix. */ - public docTagPrefix: string; - - /** Publishing organization. */ - public organization: (google.api.ClientLibraryOrganization|keyof typeof google.api.ClientLibraryOrganization); - - /** Publishing librarySettings. */ - public librarySettings: google.api.IClientLibrarySettings[]; - - /** Publishing protoReferenceDocumentationUri. */ - public protoReferenceDocumentationUri: string; - - /** Publishing restReferenceDocumentationUri. */ - public restReferenceDocumentationUri: string; - - /** - * Creates a new Publishing instance using the specified properties. - * @param [properties] Properties to set - * @returns Publishing instance - */ - public static create(properties?: google.api.IPublishing): google.api.Publishing; - - /** - * Encodes the specified Publishing message. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Publishing message, length delimited. Does not implicitly {@link google.api.Publishing.verify|verify} messages. - * @param message Publishing message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPublishing, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Publishing message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.Publishing; - - /** - * Decodes a Publishing message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Publishing - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.Publishing; - - /** - * Verifies a Publishing message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Publishing message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Publishing - */ - public static fromObject(object: { [k: string]: any }): google.api.Publishing; - - /** - * Creates a plain object from a Publishing message. Also converts values to other types if specified. - * @param message Publishing - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.Publishing, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Publishing to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Publishing - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a JavaSettings. */ - interface IJavaSettings { - - /** JavaSettings libraryPackage */ - libraryPackage?: (string|null); - - /** JavaSettings serviceClassNames */ - serviceClassNames?: ({ [k: string]: string }|null); - - /** JavaSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a JavaSettings. */ - class JavaSettings implements IJavaSettings { - - /** - * Constructs a new JavaSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IJavaSettings); - - /** JavaSettings libraryPackage. */ - public libraryPackage: string; - - /** JavaSettings serviceClassNames. */ - public serviceClassNames: { [k: string]: string }; - - /** JavaSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new JavaSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns JavaSettings instance - */ - public static create(properties?: google.api.IJavaSettings): google.api.JavaSettings; - - /** - * Encodes the specified JavaSettings message. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified JavaSettings message, length delimited. Does not implicitly {@link google.api.JavaSettings.verify|verify} messages. - * @param message JavaSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IJavaSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a JavaSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.JavaSettings; - - /** - * Decodes a JavaSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns JavaSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.JavaSettings; - - /** - * Verifies a JavaSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a JavaSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns JavaSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.JavaSettings; - - /** - * Creates a plain object from a JavaSettings message. Also converts values to other types if specified. - * @param message JavaSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.JavaSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this JavaSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for JavaSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a CppSettings. */ - interface ICppSettings { - - /** CppSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a CppSettings. */ - class CppSettings implements ICppSettings { - - /** - * Constructs a new CppSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.ICppSettings); - - /** CppSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new CppSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns CppSettings instance - */ - public static create(properties?: google.api.ICppSettings): google.api.CppSettings; - - /** - * Encodes the specified CppSettings message. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified CppSettings message, length delimited. Does not implicitly {@link google.api.CppSettings.verify|verify} messages. - * @param message CppSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.ICppSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a CppSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.CppSettings; - - /** - * Decodes a CppSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns CppSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.CppSettings; - - /** - * Verifies a CppSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a CppSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns CppSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.CppSettings; - - /** - * Creates a plain object from a CppSettings message. Also converts values to other types if specified. - * @param message CppSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.CppSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this CppSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for CppSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PhpSettings. */ - interface IPhpSettings { - - /** PhpSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PhpSettings. */ - class PhpSettings implements IPhpSettings { - - /** - * Constructs a new PhpSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPhpSettings); - - /** PhpSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PhpSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PhpSettings instance - */ - public static create(properties?: google.api.IPhpSettings): google.api.PhpSettings; - - /** - * Encodes the specified PhpSettings message. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PhpSettings message, length delimited. Does not implicitly {@link google.api.PhpSettings.verify|verify} messages. - * @param message PhpSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPhpSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PhpSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PhpSettings; - - /** - * Decodes a PhpSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PhpSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PhpSettings; - - /** - * Verifies a PhpSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PhpSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PhpSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PhpSettings; - - /** - * Creates a plain object from a PhpSettings message. Also converts values to other types if specified. - * @param message PhpSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PhpSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PhpSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PhpSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a PythonSettings. */ - interface IPythonSettings { - - /** PythonSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a PythonSettings. */ - class PythonSettings implements IPythonSettings { - - /** - * Constructs a new PythonSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IPythonSettings); - - /** PythonSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new PythonSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns PythonSettings instance - */ - public static create(properties?: google.api.IPythonSettings): google.api.PythonSettings; - - /** - * Encodes the specified PythonSettings message. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PythonSettings message, length delimited. Does not implicitly {@link google.api.PythonSettings.verify|verify} messages. - * @param message PythonSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IPythonSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PythonSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.PythonSettings; - - /** - * Decodes a PythonSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PythonSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.PythonSettings; - - /** - * Verifies a PythonSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PythonSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PythonSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.PythonSettings; - - /** - * Creates a plain object from a PythonSettings message. Also converts values to other types if specified. - * @param message PythonSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.PythonSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PythonSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for PythonSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a NodeSettings. */ - interface INodeSettings { - - /** NodeSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a NodeSettings. */ - class NodeSettings implements INodeSettings { - - /** - * Constructs a new NodeSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.INodeSettings); - - /** NodeSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new NodeSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns NodeSettings instance - */ - public static create(properties?: google.api.INodeSettings): google.api.NodeSettings; - - /** - * Encodes the specified NodeSettings message. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NodeSettings message, length delimited. Does not implicitly {@link google.api.NodeSettings.verify|verify} messages. - * @param message NodeSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.INodeSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NodeSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.NodeSettings; - - /** - * Decodes a NodeSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NodeSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.NodeSettings; - - /** - * Verifies a NodeSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NodeSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NodeSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.NodeSettings; - - /** - * Creates a plain object from a NodeSettings message. Also converts values to other types if specified. - * @param message NodeSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.NodeSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NodeSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for NodeSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DotnetSettings. */ - interface IDotnetSettings { - - /** DotnetSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices */ - renamedServices?: ({ [k: string]: string }|null); - - /** DotnetSettings renamedResources */ - renamedResources?: ({ [k: string]: string }|null); - - /** DotnetSettings ignoredResources */ - ignoredResources?: (string[]|null); - - /** DotnetSettings forcedNamespaceAliases */ - forcedNamespaceAliases?: (string[]|null); - - /** DotnetSettings handwrittenSignatures */ - handwrittenSignatures?: (string[]|null); - } - - /** Represents a DotnetSettings. */ - class DotnetSettings implements IDotnetSettings { - - /** - * Constructs a new DotnetSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IDotnetSettings); - - /** DotnetSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** DotnetSettings renamedServices. */ - public renamedServices: { [k: string]: string }; - - /** DotnetSettings renamedResources. */ - public renamedResources: { [k: string]: string }; - - /** DotnetSettings ignoredResources. */ - public ignoredResources: string[]; - - /** DotnetSettings forcedNamespaceAliases. */ - public forcedNamespaceAliases: string[]; - - /** DotnetSettings handwrittenSignatures. */ - public handwrittenSignatures: string[]; - - /** - * Creates a new DotnetSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns DotnetSettings instance - */ - public static create(properties?: google.api.IDotnetSettings): google.api.DotnetSettings; - - /** - * Encodes the specified DotnetSettings message. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DotnetSettings message, length delimited. Does not implicitly {@link google.api.DotnetSettings.verify|verify} messages. - * @param message DotnetSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IDotnetSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.DotnetSettings; - - /** - * Decodes a DotnetSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DotnetSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.DotnetSettings; - - /** - * Verifies a DotnetSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DotnetSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DotnetSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.DotnetSettings; - - /** - * Creates a plain object from a DotnetSettings message. Also converts values to other types if specified. - * @param message DotnetSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.DotnetSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DotnetSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DotnetSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a RubySettings. */ - interface IRubySettings { - - /** RubySettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a RubySettings. */ - class RubySettings implements IRubySettings { - - /** - * Constructs a new RubySettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IRubySettings); - - /** RubySettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new RubySettings instance using the specified properties. - * @param [properties] Properties to set - * @returns RubySettings instance - */ - public static create(properties?: google.api.IRubySettings): google.api.RubySettings; - - /** - * Encodes the specified RubySettings message. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified RubySettings message, length delimited. Does not implicitly {@link google.api.RubySettings.verify|verify} messages. - * @param message RubySettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IRubySettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a RubySettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.RubySettings; - - /** - * Decodes a RubySettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns RubySettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.RubySettings; - - /** - * Verifies a RubySettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a RubySettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns RubySettings - */ - public static fromObject(object: { [k: string]: any }): google.api.RubySettings; - - /** - * Creates a plain object from a RubySettings message. Also converts values to other types if specified. - * @param message RubySettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.RubySettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this RubySettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for RubySettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a GoSettings. */ - interface IGoSettings { - - /** GoSettings common */ - common?: (google.api.ICommonLanguageSettings|null); - } - - /** Represents a GoSettings. */ - class GoSettings implements IGoSettings { - - /** - * Constructs a new GoSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IGoSettings); - - /** GoSettings common. */ - public common?: (google.api.ICommonLanguageSettings|null); - - /** - * Creates a new GoSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns GoSettings instance - */ - public static create(properties?: google.api.IGoSettings): google.api.GoSettings; - - /** - * Encodes the specified GoSettings message. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GoSettings message, length delimited. Does not implicitly {@link google.api.GoSettings.verify|verify} messages. - * @param message GoSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IGoSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GoSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.GoSettings; - - /** - * Decodes a GoSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GoSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.GoSettings; - - /** - * Verifies a GoSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GoSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GoSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.GoSettings; - - /** - * Creates a plain object from a GoSettings message. Also converts values to other types if specified. - * @param message GoSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.GoSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GoSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for GoSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodSettings. */ - interface IMethodSettings { - - /** MethodSettings selector */ - selector?: (string|null); - - /** MethodSettings longRunning */ - longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields */ - autoPopulatedFields?: (string[]|null); - } - - /** Represents a MethodSettings. */ - class MethodSettings implements IMethodSettings { - - /** - * Constructs a new MethodSettings. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IMethodSettings); - - /** MethodSettings selector. */ - public selector: string; - - /** MethodSettings longRunning. */ - public longRunning?: (google.api.MethodSettings.ILongRunning|null); - - /** MethodSettings autoPopulatedFields. */ - public autoPopulatedFields: string[]; - - /** - * Creates a new MethodSettings instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodSettings instance - */ - public static create(properties?: google.api.IMethodSettings): google.api.MethodSettings; - - /** - * Encodes the specified MethodSettings message. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodSettings message, length delimited. Does not implicitly {@link google.api.MethodSettings.verify|verify} messages. - * @param message MethodSettings message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IMethodSettings, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodSettings message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings; - - /** - * Decodes a MethodSettings message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings; - - /** - * Verifies a MethodSettings message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodSettings message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodSettings - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings; - - /** - * Creates a plain object from a MethodSettings message. Also converts values to other types if specified. - * @param message MethodSettings - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodSettings to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodSettings - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodSettings { - - /** Properties of a LongRunning. */ - interface ILongRunning { - - /** LongRunning initialPollDelay */ - initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier */ - pollDelayMultiplier?: (number|null); - - /** LongRunning maxPollDelay */ - maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout */ - totalPollTimeout?: (google.protobuf.IDuration|null); - } - - /** Represents a LongRunning. */ - class LongRunning implements ILongRunning { - - /** - * Constructs a new LongRunning. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.MethodSettings.ILongRunning); - - /** LongRunning initialPollDelay. */ - public initialPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning pollDelayMultiplier. */ - public pollDelayMultiplier: number; - - /** LongRunning maxPollDelay. */ - public maxPollDelay?: (google.protobuf.IDuration|null); - - /** LongRunning totalPollTimeout. */ - public totalPollTimeout?: (google.protobuf.IDuration|null); - - /** - * Creates a new LongRunning instance using the specified properties. - * @param [properties] Properties to set - * @returns LongRunning instance - */ - public static create(properties?: google.api.MethodSettings.ILongRunning): google.api.MethodSettings.LongRunning; - - /** - * Encodes the specified LongRunning message. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified LongRunning message, length delimited. Does not implicitly {@link google.api.MethodSettings.LongRunning.verify|verify} messages. - * @param message LongRunning message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.MethodSettings.ILongRunning, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a LongRunning message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.MethodSettings.LongRunning; - - /** - * Decodes a LongRunning message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns LongRunning - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.MethodSettings.LongRunning; - - /** - * Verifies a LongRunning message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a LongRunning message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns LongRunning - */ - public static fromObject(object: { [k: string]: any }): google.api.MethodSettings.LongRunning; - - /** - * Creates a plain object from a LongRunning message. Also converts values to other types if specified. - * @param message LongRunning - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.MethodSettings.LongRunning, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this LongRunning to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for LongRunning - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** ClientLibraryOrganization enum. */ - enum ClientLibraryOrganization { - CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED = 0, - CLOUD = 1, - ADS = 2, - PHOTOS = 3, - STREET_VIEW = 4, - SHOPPING = 5, - GEO = 6, - GENERATIVE_AI = 7 - } - - /** ClientLibraryDestination enum. */ - enum ClientLibraryDestination { - CLIENT_LIBRARY_DESTINATION_UNSPECIFIED = 0, - GITHUB = 10, - PACKAGE_MANAGER = 20 - } - - /** LaunchStage enum. */ - enum LaunchStage { - LAUNCH_STAGE_UNSPECIFIED = 0, - UNIMPLEMENTED = 6, - PRELAUNCH = 7, - EARLY_ACCESS = 1, - ALPHA = 2, - BETA = 3, - GA = 4, - DEPRECATED = 5 - } - - /** FieldBehavior enum. */ - enum FieldBehavior { - FIELD_BEHAVIOR_UNSPECIFIED = 0, - OPTIONAL = 1, - REQUIRED = 2, - OUTPUT_ONLY = 3, - INPUT_ONLY = 4, - IMMUTABLE = 5, - UNORDERED_LIST = 6, - NON_EMPTY_DEFAULT = 7, - IDENTIFIER = 8 - } - - /** Properties of a FieldInfo. */ - interface IFieldInfo { - - /** FieldInfo format */ - format?: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format|null); - } - - /** Represents a FieldInfo. */ - class FieldInfo implements IFieldInfo { - - /** - * Constructs a new FieldInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IFieldInfo); - - /** FieldInfo format. */ - public format: (google.api.FieldInfo.Format|keyof typeof google.api.FieldInfo.Format); - - /** - * Creates a new FieldInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldInfo instance - */ - public static create(properties?: google.api.IFieldInfo): google.api.FieldInfo; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @param message FieldInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IFieldInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.FieldInfo; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.FieldInfo; - - /** - * Verifies a FieldInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldInfo - */ - public static fromObject(object: { [k: string]: any }): google.api.FieldInfo; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @param message FieldInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.FieldInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldInfo - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldInfo { - - /** Format enum. */ - enum Format { - FORMAT_UNSPECIFIED = 0, - UUID4 = 1, - IPV4 = 2, - IPV6 = 3, - IPV4_OR_IPV6 = 4 - } - } - - /** Properties of a ResourceDescriptor. */ - interface IResourceDescriptor { - - /** ResourceDescriptor type */ - type?: (string|null); - - /** ResourceDescriptor pattern */ - pattern?: (string[]|null); - - /** ResourceDescriptor nameField */ - nameField?: (string|null); - - /** ResourceDescriptor history */ - history?: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History|null); - - /** ResourceDescriptor plural */ - plural?: (string|null); - - /** ResourceDescriptor singular */ - singular?: (string|null); - - /** ResourceDescriptor style */ - style?: (google.api.ResourceDescriptor.Style[]|null); - } - - /** Represents a ResourceDescriptor. */ - class ResourceDescriptor implements IResourceDescriptor { - - /** - * Constructs a new ResourceDescriptor. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceDescriptor); - - /** ResourceDescriptor type. */ - public type: string; - - /** ResourceDescriptor pattern. */ - public pattern: string[]; - - /** ResourceDescriptor nameField. */ - public nameField: string; - - /** ResourceDescriptor history. */ - public history: (google.api.ResourceDescriptor.History|keyof typeof google.api.ResourceDescriptor.History); - - /** ResourceDescriptor plural. */ - public plural: string; - - /** ResourceDescriptor singular. */ - public singular: string; - - /** ResourceDescriptor style. */ - public style: google.api.ResourceDescriptor.Style[]; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceDescriptor instance - */ - public static create(properties?: google.api.IResourceDescriptor): google.api.ResourceDescriptor; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @param message ResourceDescriptor message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceDescriptor, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceDescriptor; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceDescriptor; - - /** - * Verifies a ResourceDescriptor message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceDescriptor message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceDescriptor - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceDescriptor; - - /** - * Creates a plain object from a ResourceDescriptor message. Also converts values to other types if specified. - * @param message ResourceDescriptor - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceDescriptor, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceDescriptor to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceDescriptor - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ResourceDescriptor { - - /** History enum. */ - enum History { - HISTORY_UNSPECIFIED = 0, - ORIGINALLY_SINGLE_PATTERN = 1, - FUTURE_MULTI_PATTERN = 2 - } - - /** Style enum. */ - enum Style { - STYLE_UNSPECIFIED = 0, - DECLARATIVE_FRIENDLY = 1 - } - } - - /** Properties of a ResourceReference. */ - interface IResourceReference { - - /** ResourceReference type */ - type?: (string|null); - - /** ResourceReference childType */ - childType?: (string|null); - } - - /** Represents a ResourceReference. */ - class ResourceReference implements IResourceReference { - - /** - * Constructs a new ResourceReference. - * @param [properties] Properties to set - */ - constructor(properties?: google.api.IResourceReference); - - /** ResourceReference type. */ - public type: string; - - /** ResourceReference childType. */ - public childType: string; - - /** - * Creates a new ResourceReference instance using the specified properties. - * @param [properties] Properties to set - * @returns ResourceReference instance - */ - public static create(properties?: google.api.IResourceReference): google.api.ResourceReference; - - /** - * Encodes the specified ResourceReference message. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ResourceReference message, length delimited. Does not implicitly {@link google.api.ResourceReference.verify|verify} messages. - * @param message ResourceReference message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.api.IResourceReference, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ResourceReference message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.api.ResourceReference; - - /** - * Decodes a ResourceReference message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ResourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.api.ResourceReference; - - /** - * Verifies a ResourceReference message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ResourceReference message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ResourceReference - */ - public static fromObject(object: { [k: string]: any }): google.api.ResourceReference; - - /** - * Creates a plain object from a ResourceReference message. Also converts values to other types if specified. - * @param message ResourceReference - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.api.ResourceReference, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ResourceReference to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ResourceReference - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorSet - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Edition enum. */ - enum Edition { - EDITION_UNKNOWN = 0, - EDITION_PROTO2 = 998, - EDITION_PROTO3 = 999, - EDITION_2023 = 1000, - EDITION_2024 = 1001, - EDITION_1_TEST_ONLY = 1, - EDITION_2_TEST_ONLY = 2, - EDITION_99997_TEST_ONLY = 99997, - EDITION_99998_TEST_ONLY = 99998, - EDITION_99999_TEST_ONLY = 99999, - EDITION_MAX = 2147483647 - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - - /** FileDescriptorProto edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** FileDescriptorProto edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for DescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ExtensionRangeOptions declaration */ - declaration?: (google.protobuf.ExtensionRangeOptions.IDeclaration[]|null); - - /** ExtensionRangeOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification */ - verification?: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** ExtensionRangeOptions declaration. */ - public declaration: google.protobuf.ExtensionRangeOptions.IDeclaration[]; - - /** ExtensionRangeOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ExtensionRangeOptions verification. */ - public verification: (google.protobuf.ExtensionRangeOptions.VerificationState|keyof typeof google.protobuf.ExtensionRangeOptions.VerificationState); - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ExtensionRangeOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace ExtensionRangeOptions { - - /** Properties of a Declaration. */ - interface IDeclaration { - - /** Declaration number */ - number?: (number|null); - - /** Declaration fullName */ - fullName?: (string|null); - - /** Declaration type */ - type?: (string|null); - - /** Declaration reserved */ - reserved?: (boolean|null); - - /** Declaration repeated */ - repeated?: (boolean|null); - } - - /** Represents a Declaration. */ - class Declaration implements IDeclaration { - - /** - * Constructs a new Declaration. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration); - - /** Declaration number. */ - public number: number; - - /** Declaration fullName. */ - public fullName: string; - - /** Declaration type. */ - public type: string; - - /** Declaration reserved. */ - public reserved: boolean; - - /** Declaration repeated. */ - public repeated: boolean; - - /** - * Creates a new Declaration instance using the specified properties. - * @param [properties] Properties to set - * @returns Declaration instance - */ - public static create(properties?: google.protobuf.ExtensionRangeOptions.IDeclaration): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Encodes the specified Declaration message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Declaration message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.Declaration.verify|verify} messages. - * @param message Declaration message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ExtensionRangeOptions.IDeclaration, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Declaration message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Decodes a Declaration message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Declaration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Verifies a Declaration message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Declaration message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Declaration - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions.Declaration; - - /** - * Creates a plain object from a Declaration message. Also converts values to other types if specified. - * @param message Declaration - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions.Declaration, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Declaration to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for Declaration - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** VerificationState enum. */ - enum VerificationState { - DECLARATION = 0, - UNVERIFIED = 1 - } - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: (google.protobuf.FieldDescriptorProto.Label|keyof typeof google.protobuf.FieldDescriptorProto.Label); - - /** FieldDescriptorProto type. */ - public type: (google.protobuf.FieldDescriptorProto.Type|keyof typeof google.protobuf.FieldDescriptorProto.Type); - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REPEATED = 3, - LABEL_REQUIRED = 2 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumReservedRange - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodDescriptorProto - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .google.api.resourceDefinition */ - ".google.api.resourceDefinition"?: (google.api.IResourceDescriptor[]|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: (google.protobuf.FileOptions.OptimizeMode|keyof typeof google.protobuf.FileOptions.OptimizeMode); - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FileOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** MessageOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .google.api.resource */ - ".google.api.resource"?: (google.api.IResourceDescriptor|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** MessageOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MessageOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions unverifiedLazy */ - unverifiedLazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions debugRedact */ - debugRedact?: (boolean|null); - - /** FieldOptions retention */ - retention?: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention|null); - - /** FieldOptions targets */ - targets?: (google.protobuf.FieldOptions.OptionTargetType[]|null); - - /** FieldOptions editionDefaults */ - editionDefaults?: (google.protobuf.FieldOptions.IEditionDefault[]|null); - - /** FieldOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .google.api.fieldBehavior */ - ".google.api.fieldBehavior"?: (google.api.FieldBehavior[]|null); - - /** FieldOptions .google.api.fieldInfo */ - ".google.api.fieldInfo"?: (google.api.IFieldInfo|null); - - /** FieldOptions .google.api.resourceReference */ - ".google.api.resourceReference"?: (google.api.IResourceReference|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: (google.protobuf.FieldOptions.CType|keyof typeof google.protobuf.FieldOptions.CType); - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: (google.protobuf.FieldOptions.JSType|keyof typeof google.protobuf.FieldOptions.JSType); - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions unverifiedLazy. */ - public unverifiedLazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions debugRedact. */ - public debugRedact: boolean; - - /** FieldOptions retention. */ - public retention: (google.protobuf.FieldOptions.OptionRetention|keyof typeof google.protobuf.FieldOptions.OptionRetention); - - /** FieldOptions targets. */ - public targets: google.protobuf.FieldOptions.OptionTargetType[]; - - /** FieldOptions editionDefaults. */ - public editionDefaults: google.protobuf.FieldOptions.IEditionDefault[]; - - /** FieldOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for FieldOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - - /** OptionRetention enum. */ - enum OptionRetention { - RETENTION_UNKNOWN = 0, - RETENTION_RUNTIME = 1, - RETENTION_SOURCE = 2 - } - - /** OptionTargetType enum. */ - enum OptionTargetType { - TARGET_TYPE_UNKNOWN = 0, - TARGET_TYPE_FILE = 1, - TARGET_TYPE_EXTENSION_RANGE = 2, - TARGET_TYPE_MESSAGE = 3, - TARGET_TYPE_FIELD = 4, - TARGET_TYPE_ONEOF = 5, - TARGET_TYPE_ENUM = 6, - TARGET_TYPE_ENUM_ENTRY = 7, - TARGET_TYPE_SERVICE = 8, - TARGET_TYPE_METHOD = 9 - } - - /** Properties of an EditionDefault. */ - interface IEditionDefault { - - /** EditionDefault edition */ - edition?: (google.protobuf.Edition|keyof typeof google.protobuf.Edition|null); - - /** EditionDefault value */ - value?: (string|null); - } - - /** Represents an EditionDefault. */ - class EditionDefault implements IEditionDefault { - - /** - * Constructs a new EditionDefault. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.FieldOptions.IEditionDefault); - - /** EditionDefault edition. */ - public edition: (google.protobuf.Edition|keyof typeof google.protobuf.Edition); - - /** EditionDefault value. */ - public value: string; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @param [properties] Properties to set - * @returns EditionDefault instance - */ - public static create(properties?: google.protobuf.FieldOptions.IEditionDefault): google.protobuf.FieldOptions.EditionDefault; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @param message EditionDefault message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.FieldOptions.IEditionDefault, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions.EditionDefault; - - /** - * Decodes an EditionDefault message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions.EditionDefault; - - /** - * Verifies an EditionDefault message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EditionDefault message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EditionDefault - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions.EditionDefault; - - /** - * Creates a plain object from an EditionDefault message. Also converts values to other types if specified. - * @param message EditionDefault - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions.EditionDefault, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EditionDefault to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EditionDefault - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for OneofOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions deprecatedLegacyJsonFieldConflicts */ - deprecatedLegacyJsonFieldConflicts?: (boolean|null); - - /** EnumOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions deprecatedLegacyJsonFieldConflicts. */ - public deprecatedLegacyJsonFieldConflicts: boolean; - - /** EnumOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact */ - debugRedact?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** EnumValueOptions debugRedact. */ - public debugRedact: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for EnumValueOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** ServiceOptions .google.api.defaultHost */ - ".google.api.defaultHost"?: (string|null); - - /** ServiceOptions .google.api.oauthScopes */ - ".google.api.oauthScopes"?: (string|null); - - /** ServiceOptions .google.api.apiVersion */ - ".google.api.apiVersion"?: (string|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for ServiceOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions features */ - features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MethodOptions .google.api.http */ - ".google.api.http"?: (google.api.IHttpRule|null); - - /** MethodOptions .google.api.methodSignature */ - ".google.api.methodSignature"?: (string[]|null); - - /** MethodOptions .google.longrunning.operationInfo */ - ".google.longrunning.operationInfo"?: (google.longrunning.IOperationInfo|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: (google.protobuf.MethodOptions.IdempotencyLevel|keyof typeof google.protobuf.MethodOptions.IdempotencyLevel); - - /** MethodOptions features. */ - public features?: (google.protobuf.IFeatureSet|null); - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - - /** - * Gets the default type url for MethodOptions - * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns The default type url - */ - public static getTypeUrl(typeUrlPrefix?: string): string; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|string|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|string|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|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 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 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 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 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 type. */ - namespace type { - - /** DayOfWeek enum. */ - enum DayOfWeek { - DAY_OF_WEEK_UNSPECIFIED = 0, - MONDAY = 1, - TUESDAY = 2, - WEDNESDAY = 3, - THURSDAY = 4, - FRIDAY = 5, - SATURDAY = 6, - SUNDAY = 7 - } - - /** Month enum. */ - enum Month { - MONTH_UNSPECIFIED = 0, - JANUARY = 1, - FEBRUARY = 2, - MARCH = 3, - APRIL = 4, - MAY = 5, - JUNE = 6, - JULY = 7, - AUGUST = 8, - SEPTEMBER = 9, - OCTOBER = 10, - NOVEMBER = 11, - DECEMBER = 12 - } - } - - /** 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 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; - } - } -} diff --git a/owl-bot-staging/google-cloud-backupdr/protos/protos.js b/owl-bot-staging/google-cloud-backupdr/protos/protos.js deleted file mode 100644 index 2eab54d52dd..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/protos.js +++ /dev/null @@ -1,69448 +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_backupdr_protos || ($protobuf.roots._google_cloud_backupdr_protos = {}); - - $root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.cloud = (function() { - - /** - * Namespace cloud. - * @memberof google - * @namespace - */ - var cloud = {}; - - cloud.backupdr = (function() { - - /** - * Namespace backupdr. - * @memberof google.cloud - * @namespace - */ - var backupdr = {}; - - backupdr.v1 = (function() { - - /** - * Namespace v1. - * @memberof google.cloud.backupdr - * @namespace - */ - var v1 = {}; - - v1.BackupDR = (function() { - - /** - * Constructs a new BackupDR service. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupDR - * @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 BackupDR(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BackupDR.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackupDR; - - /** - * Creates new BackupDR service using the specified rpc implementation. - * @function create - * @memberof google.cloud.backupdr.v1.BackupDR - * @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 {BackupDR} RPC service. Useful where requests and/or responses are streamed. - */ - BackupDR.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listManagementServers}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListManagementServersCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListManagementServersResponse} [response] ListManagementServersResponse - */ - - /** - * Calls ListManagementServers. - * @function listManagementServers - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListManagementServersRequest} request ListManagementServersRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListManagementServersCallback} callback Node-style callback called with the error, if any, and ListManagementServersResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listManagementServers = function listManagementServers(request, callback) { - return this.rpcCall(listManagementServers, $root.google.cloud.backupdr.v1.ListManagementServersRequest, $root.google.cloud.backupdr.v1.ListManagementServersResponse, request, callback); - }, "name", { value: "ListManagementServers" }); - - /** - * Calls ListManagementServers. - * @function listManagementServers - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListManagementServersRequest} request ListManagementServersRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getManagementServer}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetManagementServerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ManagementServer} [response] ManagementServer - */ - - /** - * Calls GetManagementServer. - * @function getManagementServer - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} request GetManagementServerRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetManagementServerCallback} callback Node-style callback called with the error, if any, and ManagementServer - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getManagementServer = function getManagementServer(request, callback) { - return this.rpcCall(getManagementServer, $root.google.cloud.backupdr.v1.GetManagementServerRequest, $root.google.cloud.backupdr.v1.ManagementServer, request, callback); - }, "name", { value: "GetManagementServer" }); - - /** - * Calls GetManagementServer. - * @function getManagementServer - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} request GetManagementServerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createManagementServer}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef CreateManagementServerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateManagementServer. - * @function createManagementServer - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} request CreateManagementServerRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.CreateManagementServerCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.createManagementServer = function createManagementServer(request, callback) { - return this.rpcCall(createManagementServer, $root.google.cloud.backupdr.v1.CreateManagementServerRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateManagementServer" }); - - /** - * Calls CreateManagementServer. - * @function createManagementServer - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} request CreateManagementServerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteManagementServer}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef DeleteManagementServerCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteManagementServer. - * @function deleteManagementServer - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} request DeleteManagementServerRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.DeleteManagementServerCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.deleteManagementServer = function deleteManagementServer(request, callback) { - return this.rpcCall(deleteManagementServer, $root.google.cloud.backupdr.v1.DeleteManagementServerRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteManagementServer" }); - - /** - * Calls DeleteManagementServer. - * @function deleteManagementServer - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} request DeleteManagementServerRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupVault}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef CreateBackupVaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackupVault. - * @function createBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.createBackupVault = function createBackupVault(request, callback) { - return this.rpcCall(createBackupVault, $root.google.cloud.backupdr.v1.CreateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackupVault" }); - - /** - * Calls CreateBackupVault. - * @function createBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} request CreateBackupVaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupVaults}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListBackupVaultsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} [response] ListBackupVaultsResponse - */ - - /** - * Calls ListBackupVaults. - * @function listBackupVaults - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListBackupVaultsCallback} callback Node-style callback called with the error, if any, and ListBackupVaultsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listBackupVaults = function listBackupVaults(request, callback) { - return this.rpcCall(listBackupVaults, $root.google.cloud.backupdr.v1.ListBackupVaultsRequest, $root.google.cloud.backupdr.v1.ListBackupVaultsResponse, request, callback); - }, "name", { value: "ListBackupVaults" }); - - /** - * Calls ListBackupVaults. - * @function listBackupVaults - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} request ListBackupVaultsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchUsableBackupVaults}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef FetchUsableBackupVaultsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} [response] FetchUsableBackupVaultsResponse - */ - - /** - * Calls FetchUsableBackupVaults. - * @function fetchUsableBackupVaults - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaultsCallback} callback Node-style callback called with the error, if any, and FetchUsableBackupVaultsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.fetchUsableBackupVaults = function fetchUsableBackupVaults(request, callback) { - return this.rpcCall(fetchUsableBackupVaults, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest, $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse, request, callback); - }, "name", { value: "FetchUsableBackupVaults" }); - - /** - * Calls FetchUsableBackupVaults. - * @function fetchUsableBackupVaults - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} request FetchUsableBackupVaultsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupVault}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetBackupVaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.BackupVault} [response] BackupVault - */ - - /** - * Calls GetBackupVault. - * @function getBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetBackupVaultCallback} callback Node-style callback called with the error, if any, and BackupVault - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getBackupVault = function getBackupVault(request, callback) { - return this.rpcCall(getBackupVault, $root.google.cloud.backupdr.v1.GetBackupVaultRequest, $root.google.cloud.backupdr.v1.BackupVault, request, callback); - }, "name", { value: "GetBackupVault" }); - - /** - * Calls GetBackupVault. - * @function getBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} request GetBackupVaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupVault}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef UpdateBackupVaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackupVault. - * @function updateBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.updateBackupVault = function updateBackupVault(request, callback) { - return this.rpcCall(updateBackupVault, $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackupVault" }); - - /** - * Calls UpdateBackupVault. - * @function updateBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} request UpdateBackupVaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupVault}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef DeleteBackupVaultCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackupVault. - * @function deleteBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupVaultCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.deleteBackupVault = function deleteBackupVault(request, callback) { - return this.rpcCall(deleteBackupVault, $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackupVault" }); - - /** - * Calls DeleteBackupVault. - * @function deleteBackupVault - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} request DeleteBackupVaultRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSources}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListDataSourcesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} [response] ListDataSourcesResponse - */ - - /** - * Calls ListDataSources. - * @function listDataSources - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListDataSourcesCallback} callback Node-style callback called with the error, if any, and ListDataSourcesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listDataSources = function listDataSources(request, callback) { - return this.rpcCall(listDataSources, $root.google.cloud.backupdr.v1.ListDataSourcesRequest, $root.google.cloud.backupdr.v1.ListDataSourcesResponse, request, callback); - }, "name", { value: "ListDataSources" }); - - /** - * Calls ListDataSources. - * @function listDataSources - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} request ListDataSourcesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSource}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetDataSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.DataSource} [response] DataSource - */ - - /** - * Calls GetDataSource. - * @function getDataSource - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetDataSourceCallback} callback Node-style callback called with the error, if any, and DataSource - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getDataSource = function getDataSource(request, callback) { - return this.rpcCall(getDataSource, $root.google.cloud.backupdr.v1.GetDataSourceRequest, $root.google.cloud.backupdr.v1.DataSource, request, callback); - }, "name", { value: "GetDataSource" }); - - /** - * Calls GetDataSource. - * @function getDataSource - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} request GetDataSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateDataSource}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef UpdateDataSourceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateDataSource. - * @function updateDataSource - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.UpdateDataSourceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.updateDataSource = function updateDataSource(request, callback) { - return this.rpcCall(updateDataSource, $root.google.cloud.backupdr.v1.UpdateDataSourceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateDataSource" }); - - /** - * Calls UpdateDataSource. - * @function updateDataSource - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} request UpdateDataSourceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackups}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListBackupsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListBackupsResponse} [response] ListBackupsResponse - */ - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListBackupsCallback} callback Node-style callback called with the error, if any, and ListBackupsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listBackups = function listBackups(request, callback) { - return this.rpcCall(listBackups, $root.google.cloud.backupdr.v1.ListBackupsRequest, $root.google.cloud.backupdr.v1.ListBackupsResponse, request, callback); - }, "name", { value: "ListBackups" }); - - /** - * Calls ListBackups. - * @function listBackups - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupsRequest} request ListBackupsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupsForResourceType}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef FetchBackupsForResourceTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} [response] FetchBackupsForResourceTypeResponse - */ - - /** - * Calls FetchBackupsForResourceType. - * @function fetchBackupsForResourceType - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} request FetchBackupsForResourceTypeRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceTypeCallback} callback Node-style callback called with the error, if any, and FetchBackupsForResourceTypeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.fetchBackupsForResourceType = function fetchBackupsForResourceType(request, callback) { - return this.rpcCall(fetchBackupsForResourceType, $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest, $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse, request, callback); - }, "name", { value: "FetchBackupsForResourceType" }); - - /** - * Calls FetchBackupsForResourceType. - * @function fetchBackupsForResourceType - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} request FetchBackupsForResourceTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackup}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.Backup} [response] Backup - */ - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetBackupCallback} callback Node-style callback called with the error, if any, and Backup - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getBackup = function getBackup(request, callback) { - return this.rpcCall(getBackup, $root.google.cloud.backupdr.v1.GetBackupRequest, $root.google.cloud.backupdr.v1.Backup, request, callback); - }, "name", { value: "GetBackup" }); - - /** - * Calls GetBackup. - * @function getBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupRequest} request GetBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackup}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef UpdateBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.updateBackup = function updateBackup(request, callback) { - return this.rpcCall(updateBackup, $root.google.cloud.backupdr.v1.UpdateBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackup" }); - - /** - * Calls UpdateBackup. - * @function updateBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} request UpdateBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackup}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef DeleteBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.deleteBackup = function deleteBackup(request, callback) { - return this.rpcCall(deleteBackup, $root.google.cloud.backupdr.v1.DeleteBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackup" }); - - /** - * Calls DeleteBackup. - * @function deleteBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} request DeleteBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|restoreBackup}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef RestoreBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls RestoreBackup. - * @function restoreBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.RestoreBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.restoreBackup = function restoreBackup(request, callback) { - return this.rpcCall(restoreBackup, $root.google.cloud.backupdr.v1.RestoreBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "RestoreBackup" }); - - /** - * Calls RestoreBackup. - * @function restoreBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} request RestoreBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlan}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef CreateBackupPlanCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackupPlan. - * @function createBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.createBackupPlan = function createBackupPlan(request, callback) { - return this.rpcCall(createBackupPlan, $root.google.cloud.backupdr.v1.CreateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackupPlan" }); - - /** - * Calls CreateBackupPlan. - * @function createBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} request CreateBackupPlanRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlan}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef UpdateBackupPlanCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackupPlan. - * @function updateBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} request UpdateBackupPlanRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.updateBackupPlan = function updateBackupPlan(request, callback) { - return this.rpcCall(updateBackupPlan, $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackupPlan" }); - - /** - * Calls UpdateBackupPlan. - * @function updateBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} request UpdateBackupPlanRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlan}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetBackupPlanCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.BackupPlan} [response] BackupPlan - */ - - /** - * Calls GetBackupPlan. - * @function getBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanCallback} callback Node-style callback called with the error, if any, and BackupPlan - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getBackupPlan = function getBackupPlan(request, callback) { - return this.rpcCall(getBackupPlan, $root.google.cloud.backupdr.v1.GetBackupPlanRequest, $root.google.cloud.backupdr.v1.BackupPlan, request, callback); - }, "name", { value: "GetBackupPlan" }); - - /** - * Calls GetBackupPlan. - * @function getBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} request GetBackupPlanRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlans}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListBackupPlansCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} [response] ListBackupPlansResponse - */ - - /** - * Calls ListBackupPlans. - * @function listBackupPlans - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlansCallback} callback Node-style callback called with the error, if any, and ListBackupPlansResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listBackupPlans = function listBackupPlans(request, callback) { - return this.rpcCall(listBackupPlans, $root.google.cloud.backupdr.v1.ListBackupPlansRequest, $root.google.cloud.backupdr.v1.ListBackupPlansResponse, request, callback); - }, "name", { value: "ListBackupPlans" }); - - /** - * Calls ListBackupPlans. - * @function listBackupPlans - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} request ListBackupPlansRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlan}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef DeleteBackupPlanCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackupPlan. - * @function deleteBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.deleteBackupPlan = function deleteBackupPlan(request, callback) { - return this.rpcCall(deleteBackupPlan, $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackupPlan" }); - - /** - * Calls DeleteBackupPlan. - * @function deleteBackupPlan - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} request DeleteBackupPlanRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanRevision}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetBackupPlanRevisionCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.BackupPlanRevision} [response] BackupPlanRevision - */ - - /** - * Calls GetBackupPlanRevision. - * @function getBackupPlanRevision - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} request GetBackupPlanRevisionRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevisionCallback} callback Node-style callback called with the error, if any, and BackupPlanRevision - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getBackupPlanRevision = function getBackupPlanRevision(request, callback) { - return this.rpcCall(getBackupPlanRevision, $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest, $root.google.cloud.backupdr.v1.BackupPlanRevision, request, callback); - }, "name", { value: "GetBackupPlanRevision" }); - - /** - * Calls GetBackupPlanRevision. - * @function getBackupPlanRevision - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} request GetBackupPlanRevisionRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanRevisions}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListBackupPlanRevisionsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} [response] ListBackupPlanRevisionsResponse - */ - - /** - * Calls ListBackupPlanRevisions. - * @function listBackupPlanRevisions - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} request ListBackupPlanRevisionsRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisionsCallback} callback Node-style callback called with the error, if any, and ListBackupPlanRevisionsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listBackupPlanRevisions = function listBackupPlanRevisions(request, callback) { - return this.rpcCall(listBackupPlanRevisions, $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest, $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse, request, callback); - }, "name", { value: "ListBackupPlanRevisions" }); - - /** - * Calls ListBackupPlanRevisions. - * @function listBackupPlanRevisions - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} request ListBackupPlanRevisionsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|createBackupPlanAssociation}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef CreateBackupPlanAssociationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls CreateBackupPlanAssociation. - * @function createBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.createBackupPlanAssociation = function createBackupPlanAssociation(request, callback) { - return this.rpcCall(createBackupPlanAssociation, $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "CreateBackupPlanAssociation" }); - - /** - * Calls CreateBackupPlanAssociation. - * @function createBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} request CreateBackupPlanAssociationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|updateBackupPlanAssociation}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef UpdateBackupPlanAssociationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls UpdateBackupPlanAssociation. - * @function updateBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} request UpdateBackupPlanAssociationRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.updateBackupPlanAssociation = function updateBackupPlanAssociation(request, callback) { - return this.rpcCall(updateBackupPlanAssociation, $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "UpdateBackupPlanAssociation" }); - - /** - * Calls UpdateBackupPlanAssociation. - * @function updateBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} request UpdateBackupPlanAssociationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getBackupPlanAssociation}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetBackupPlanAssociationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.BackupPlanAssociation} [response] BackupPlanAssociation - */ - - /** - * Calls GetBackupPlanAssociation. - * @function getBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and BackupPlanAssociation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getBackupPlanAssociation = function getBackupPlanAssociation(request, callback) { - return this.rpcCall(getBackupPlanAssociation, $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest, $root.google.cloud.backupdr.v1.BackupPlanAssociation, request, callback); - }, "name", { value: "GetBackupPlanAssociation" }); - - /** - * Calls GetBackupPlanAssociation. - * @function getBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} request GetBackupPlanAssociationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listBackupPlanAssociations}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListBackupPlanAssociationsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} [response] ListBackupPlanAssociationsResponse - */ - - /** - * Calls ListBackupPlanAssociations. - * @function listBackupPlanAssociations - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociationsCallback} callback Node-style callback called with the error, if any, and ListBackupPlanAssociationsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listBackupPlanAssociations = function listBackupPlanAssociations(request, callback) { - return this.rpcCall(listBackupPlanAssociations, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest, $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse, request, callback); - }, "name", { value: "ListBackupPlanAssociations" }); - - /** - * Calls ListBackupPlanAssociations. - * @function listBackupPlanAssociations - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} request ListBackupPlanAssociationsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchBackupPlanAssociationsForResourceType}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef FetchBackupPlanAssociationsForResourceTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} [response] FetchBackupPlanAssociationsForResourceTypeResponse - */ - - /** - * Calls FetchBackupPlanAssociationsForResourceType. - * @function fetchBackupPlanAssociationsForResourceType - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceTypeCallback} callback Node-style callback called with the error, if any, and FetchBackupPlanAssociationsForResourceTypeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.fetchBackupPlanAssociationsForResourceType = function fetchBackupPlanAssociationsForResourceType(request, callback) { - return this.rpcCall(fetchBackupPlanAssociationsForResourceType, $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest, $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse, request, callback); - }, "name", { value: "FetchBackupPlanAssociationsForResourceType" }); - - /** - * Calls FetchBackupPlanAssociationsForResourceType. - * @function fetchBackupPlanAssociationsForResourceType - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} request FetchBackupPlanAssociationsForResourceTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|deleteBackupPlanAssociation}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef DeleteBackupPlanAssociationCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls DeleteBackupPlanAssociation. - * @function deleteBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociationCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.deleteBackupPlanAssociation = function deleteBackupPlanAssociation(request, callback) { - return this.rpcCall(deleteBackupPlanAssociation, $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "DeleteBackupPlanAssociation" }); - - /** - * Calls DeleteBackupPlanAssociation. - * @function deleteBackupPlanAssociation - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} request DeleteBackupPlanAssociationRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|triggerBackup}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef TriggerBackupCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls TriggerBackup. - * @function triggerBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.TriggerBackupCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.triggerBackup = function triggerBackup(request, callback) { - return this.rpcCall(triggerBackup, $root.google.cloud.backupdr.v1.TriggerBackupRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "TriggerBackup" }); - - /** - * Calls TriggerBackup. - * @function triggerBackup - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} request TriggerBackupRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|getDataSourceReference}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef GetDataSourceReferenceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.DataSourceReference} [response] DataSourceReference - */ - - /** - * Calls GetDataSourceReference. - * @function getDataSourceReference - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} request GetDataSourceReferenceRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.GetDataSourceReferenceCallback} callback Node-style callback called with the error, if any, and DataSourceReference - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.getDataSourceReference = function getDataSourceReference(request, callback) { - return this.rpcCall(getDataSourceReference, $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest, $root.google.cloud.backupdr.v1.DataSourceReference, request, callback); - }, "name", { value: "GetDataSourceReference" }); - - /** - * Calls GetDataSourceReference. - * @function getDataSourceReference - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} request GetDataSourceReferenceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|listDataSourceReferences}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef ListDataSourceReferencesCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} [response] ListDataSourceReferencesResponse - */ - - /** - * Calls ListDataSourceReferences. - * @function listDataSourceReferences - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} request ListDataSourceReferencesRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.ListDataSourceReferencesCallback} callback Node-style callback called with the error, if any, and ListDataSourceReferencesResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.listDataSourceReferences = function listDataSourceReferences(request, callback) { - return this.rpcCall(listDataSourceReferences, $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest, $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse, request, callback); - }, "name", { value: "ListDataSourceReferences" }); - - /** - * Calls ListDataSourceReferences. - * @function listDataSourceReferences - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} request ListDataSourceReferencesRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|fetchDataSourceReferencesForResourceType}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef FetchDataSourceReferencesForResourceTypeCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} [response] FetchDataSourceReferencesForResourceTypeResponse - */ - - /** - * Calls FetchDataSourceReferencesForResourceType. - * @function fetchDataSourceReferencesForResourceType - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} request FetchDataSourceReferencesForResourceTypeRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceTypeCallback} callback Node-style callback called with the error, if any, and FetchDataSourceReferencesForResourceTypeResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.fetchDataSourceReferencesForResourceType = function fetchDataSourceReferencesForResourceType(request, callback) { - return this.rpcCall(fetchDataSourceReferencesForResourceType, $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest, $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse, request, callback); - }, "name", { value: "FetchDataSourceReferencesForResourceType" }); - - /** - * Calls FetchDataSourceReferencesForResourceType. - * @function fetchDataSourceReferencesForResourceType - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} request FetchDataSourceReferencesForResourceTypeRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDR|initializeService}. - * @memberof google.cloud.backupdr.v1.BackupDR - * @typedef InitializeServiceCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.longrunning.Operation} [response] Operation - */ - - /** - * Calls InitializeService. - * @function initializeService - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} request InitializeServiceRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDR.InitializeServiceCallback} callback Node-style callback called with the error, if any, and Operation - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDR.prototype.initializeService = function initializeService(request, callback) { - return this.rpcCall(initializeService, $root.google.cloud.backupdr.v1.InitializeServiceRequest, $root.google.longrunning.Operation, request, callback); - }, "name", { value: "InitializeService" }); - - /** - * Calls InitializeService. - * @function initializeService - * @memberof google.cloud.backupdr.v1.BackupDR - * @instance - * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} request InitializeServiceRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BackupDR; - })(); - - v1.NetworkConfig = (function() { - - /** - * Properties of a NetworkConfig. - * @memberof google.cloud.backupdr.v1 - * @interface INetworkConfig - * @property {string|null} [network] NetworkConfig network - * @property {google.cloud.backupdr.v1.NetworkConfig.PeeringMode|null} [peeringMode] NetworkConfig peeringMode - */ - - /** - * Constructs a new NetworkConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a NetworkConfig. - * @implements INetworkConfig - * @constructor - * @param {google.cloud.backupdr.v1.INetworkConfig=} [properties] Properties to set - */ - function NetworkConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkConfig network. - * @member {string} network - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @instance - */ - NetworkConfig.prototype.network = ""; - - /** - * NetworkConfig peeringMode. - * @member {google.cloud.backupdr.v1.NetworkConfig.PeeringMode} peeringMode - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @instance - */ - NetworkConfig.prototype.peeringMode = 0; - - /** - * Creates a new NetworkConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {google.cloud.backupdr.v1.INetworkConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig instance - */ - NetworkConfig.create = function create(properties) { - return new NetworkConfig(properties); - }; - - /** - * Encodes the specified NetworkConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {google.cloud.backupdr.v1.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.peeringMode != null && Object.hasOwnProperty.call(message, "peeringMode")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.peeringMode); - return writer; - }; - - /** - * Encodes the specified NetworkConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {google.cloud.backupdr.v1.INetworkConfig} message NetworkConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.peeringMode = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.network != null && message.hasOwnProperty("network")) - if (!$util.isString(message.network)) - return "network: string expected"; - if (message.peeringMode != null && message.hasOwnProperty("peeringMode")) - switch (message.peeringMode) { - default: - return "peeringMode: enum value expected"; - case 0: - case 1: - break; - } - return null; - }; - - /** - * Creates a NetworkConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.NetworkConfig} NetworkConfig - */ - NetworkConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.NetworkConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.NetworkConfig(); - if (object.network != null) - message.network = String(object.network); - switch (object.peeringMode) { - default: - if (typeof object.peeringMode === "number") { - message.peeringMode = object.peeringMode; - break; - } - break; - case "PEERING_MODE_UNSPECIFIED": - case 0: - message.peeringMode = 0; - break; - case "PRIVATE_SERVICE_ACCESS": - case 1: - message.peeringMode = 1; - break; - } - return message; - }; - - /** - * Creates a plain object from a NetworkConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {google.cloud.backupdr.v1.NetworkConfig} message NetworkConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.network = ""; - object.peeringMode = options.enums === String ? "PEERING_MODE_UNSPECIFIED" : 0; - } - if (message.network != null && message.hasOwnProperty("network")) - object.network = message.network; - if (message.peeringMode != null && message.hasOwnProperty("peeringMode")) - object.peeringMode = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkConfig.PeeringMode[message.peeringMode] === undefined ? message.peeringMode : $root.google.cloud.backupdr.v1.NetworkConfig.PeeringMode[message.peeringMode] : message.peeringMode; - return object; - }; - - /** - * Converts this NetworkConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @instance - * @returns {Object.} JSON object - */ - NetworkConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.NetworkConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkConfig"; - }; - - /** - * PeeringMode enum. - * @name google.cloud.backupdr.v1.NetworkConfig.PeeringMode - * @enum {number} - * @property {number} PEERING_MODE_UNSPECIFIED=0 PEERING_MODE_UNSPECIFIED value - * @property {number} PRIVATE_SERVICE_ACCESS=1 PRIVATE_SERVICE_ACCESS value - */ - NetworkConfig.PeeringMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PEERING_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRIVATE_SERVICE_ACCESS"] = 1; - return values; - })(); - - return NetworkConfig; - })(); - - v1.ManagementURI = (function() { - - /** - * Properties of a ManagementURI. - * @memberof google.cloud.backupdr.v1 - * @interface IManagementURI - * @property {string|null} [webUi] ManagementURI webUi - * @property {string|null} [api] ManagementURI api - */ - - /** - * Constructs a new ManagementURI. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ManagementURI. - * @implements IManagementURI - * @constructor - * @param {google.cloud.backupdr.v1.IManagementURI=} [properties] Properties to set - */ - function ManagementURI(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ManagementURI webUi. - * @member {string} webUi - * @memberof google.cloud.backupdr.v1.ManagementURI - * @instance - */ - ManagementURI.prototype.webUi = ""; - - /** - * ManagementURI api. - * @member {string} api - * @memberof google.cloud.backupdr.v1.ManagementURI - * @instance - */ - ManagementURI.prototype.api = ""; - - /** - * Creates a new ManagementURI instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {google.cloud.backupdr.v1.IManagementURI=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI instance - */ - ManagementURI.create = function create(properties) { - return new ManagementURI(properties); - }; - - /** - * Encodes the specified ManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {google.cloud.backupdr.v1.IManagementURI} message ManagementURI message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagementURI.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.webUi != null && Object.hasOwnProperty.call(message, "webUi")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.webUi); - if (message.api != null && Object.hasOwnProperty.call(message, "api")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.api); - return writer; - }; - - /** - * Encodes the specified ManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementURI.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {google.cloud.backupdr.v1.IManagementURI} message ManagementURI message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagementURI.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ManagementURI message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagementURI.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ManagementURI(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.webUi = reader.string(); - break; - } - case 2: { - message.api = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ManagementURI message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagementURI.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ManagementURI message. - * @function verify - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ManagementURI.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.webUi != null && message.hasOwnProperty("webUi")) - if (!$util.isString(message.webUi)) - return "webUi: string expected"; - if (message.api != null && message.hasOwnProperty("api")) - if (!$util.isString(message.api)) - return "api: string expected"; - return null; - }; - - /** - * Creates a ManagementURI message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ManagementURI} ManagementURI - */ - ManagementURI.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ManagementURI) - return object; - var message = new $root.google.cloud.backupdr.v1.ManagementURI(); - if (object.webUi != null) - message.webUi = String(object.webUi); - if (object.api != null) - message.api = String(object.api); - return message; - }; - - /** - * Creates a plain object from a ManagementURI message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {google.cloud.backupdr.v1.ManagementURI} message ManagementURI - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ManagementURI.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.webUi = ""; - object.api = ""; - } - if (message.webUi != null && message.hasOwnProperty("webUi")) - object.webUi = message.webUi; - if (message.api != null && message.hasOwnProperty("api")) - object.api = message.api; - return object; - }; - - /** - * Converts this ManagementURI to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ManagementURI - * @instance - * @returns {Object.} JSON object - */ - ManagementURI.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ManagementURI - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ManagementURI - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ManagementURI.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ManagementURI"; - }; - - return ManagementURI; - })(); - - v1.WorkforceIdentityBasedManagementURI = (function() { - - /** - * Properties of a WorkforceIdentityBasedManagementURI. - * @memberof google.cloud.backupdr.v1 - * @interface IWorkforceIdentityBasedManagementURI - * @property {string|null} [firstPartyManagementUri] WorkforceIdentityBasedManagementURI firstPartyManagementUri - * @property {string|null} [thirdPartyManagementUri] WorkforceIdentityBasedManagementURI thirdPartyManagementUri - */ - - /** - * Constructs a new WorkforceIdentityBasedManagementURI. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a WorkforceIdentityBasedManagementURI. - * @implements IWorkforceIdentityBasedManagementURI - * @constructor - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI=} [properties] Properties to set - */ - function WorkforceIdentityBasedManagementURI(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkforceIdentityBasedManagementURI firstPartyManagementUri. - * @member {string} firstPartyManagementUri - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @instance - */ - WorkforceIdentityBasedManagementURI.prototype.firstPartyManagementUri = ""; - - /** - * WorkforceIdentityBasedManagementURI thirdPartyManagementUri. - * @member {string} thirdPartyManagementUri - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @instance - */ - WorkforceIdentityBasedManagementURI.prototype.thirdPartyManagementUri = ""; - - /** - * Creates a new WorkforceIdentityBasedManagementURI instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI instance - */ - WorkforceIdentityBasedManagementURI.create = function create(properties) { - return new WorkforceIdentityBasedManagementURI(properties); - }; - - /** - * Encodes the specified WorkforceIdentityBasedManagementURI message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI} message WorkforceIdentityBasedManagementURI message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkforceIdentityBasedManagementURI.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.firstPartyManagementUri != null && Object.hasOwnProperty.call(message, "firstPartyManagementUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyManagementUri); - if (message.thirdPartyManagementUri != null && Object.hasOwnProperty.call(message, "thirdPartyManagementUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyManagementUri); - return writer; - }; - - /** - * Encodes the specified WorkforceIdentityBasedManagementURI message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI} message WorkforceIdentityBasedManagementURI message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkforceIdentityBasedManagementURI.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkforceIdentityBasedManagementURI.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.firstPartyManagementUri = reader.string(); - break; - } - case 2: { - message.thirdPartyManagementUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkforceIdentityBasedManagementURI message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkforceIdentityBasedManagementURI.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkforceIdentityBasedManagementURI message. - * @function verify - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkforceIdentityBasedManagementURI.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) - if (!$util.isString(message.firstPartyManagementUri)) - return "firstPartyManagementUri: string expected"; - if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) - if (!$util.isString(message.thirdPartyManagementUri)) - return "thirdPartyManagementUri: string expected"; - return null; - }; - - /** - * Creates a WorkforceIdentityBasedManagementURI message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} WorkforceIdentityBasedManagementURI - */ - WorkforceIdentityBasedManagementURI.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI) - return object; - var message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI(); - if (object.firstPartyManagementUri != null) - message.firstPartyManagementUri = String(object.firstPartyManagementUri); - if (object.thirdPartyManagementUri != null) - message.thirdPartyManagementUri = String(object.thirdPartyManagementUri); - return message; - }; - - /** - * Creates a plain object from a WorkforceIdentityBasedManagementURI message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI} message WorkforceIdentityBasedManagementURI - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkforceIdentityBasedManagementURI.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.firstPartyManagementUri = ""; - object.thirdPartyManagementUri = ""; - } - if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) - object.firstPartyManagementUri = message.firstPartyManagementUri; - if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) - object.thirdPartyManagementUri = message.thirdPartyManagementUri; - return object; - }; - - /** - * Converts this WorkforceIdentityBasedManagementURI to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @instance - * @returns {Object.} JSON object - */ - WorkforceIdentityBasedManagementURI.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkforceIdentityBasedManagementURI - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkforceIdentityBasedManagementURI.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI"; - }; - - return WorkforceIdentityBasedManagementURI; - })(); - - v1.WorkforceIdentityBasedOAuth2ClientID = (function() { - - /** - * Properties of a WorkforceIdentityBasedOAuth2ClientID. - * @memberof google.cloud.backupdr.v1 - * @interface IWorkforceIdentityBasedOAuth2ClientID - * @property {string|null} [firstPartyOauth2ClientId] WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId - * @property {string|null} [thirdPartyOauth2ClientId] WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId - */ - - /** - * Constructs a new WorkforceIdentityBasedOAuth2ClientID. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a WorkforceIdentityBasedOAuth2ClientID. - * @implements IWorkforceIdentityBasedOAuth2ClientID - * @constructor - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID=} [properties] Properties to set - */ - function WorkforceIdentityBasedOAuth2ClientID(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WorkforceIdentityBasedOAuth2ClientID firstPartyOauth2ClientId. - * @member {string} firstPartyOauth2ClientId - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @instance - */ - WorkforceIdentityBasedOAuth2ClientID.prototype.firstPartyOauth2ClientId = ""; - - /** - * WorkforceIdentityBasedOAuth2ClientID thirdPartyOauth2ClientId. - * @member {string} thirdPartyOauth2ClientId - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @instance - */ - WorkforceIdentityBasedOAuth2ClientID.prototype.thirdPartyOauth2ClientId = ""; - - /** - * Creates a new WorkforceIdentityBasedOAuth2ClientID instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID instance - */ - WorkforceIdentityBasedOAuth2ClientID.create = function create(properties) { - return new WorkforceIdentityBasedOAuth2ClientID(properties); - }; - - /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID} message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkforceIdentityBasedOAuth2ClientID.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.firstPartyOauth2ClientId != null && Object.hasOwnProperty.call(message, "firstPartyOauth2ClientId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyOauth2ClientId); - if (message.thirdPartyOauth2ClientId != null && Object.hasOwnProperty.call(message, "thirdPartyOauth2ClientId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyOauth2ClientId); - return writer; - }; - - /** - * Encodes the specified WorkforceIdentityBasedOAuth2ClientID message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID} message WorkforceIdentityBasedOAuth2ClientID message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WorkforceIdentityBasedOAuth2ClientID.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkforceIdentityBasedOAuth2ClientID.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.firstPartyOauth2ClientId = reader.string(); - break; - } - case 2: { - message.thirdPartyOauth2ClientId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WorkforceIdentityBasedOAuth2ClientID message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WorkforceIdentityBasedOAuth2ClientID.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WorkforceIdentityBasedOAuth2ClientID message. - * @function verify - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WorkforceIdentityBasedOAuth2ClientID.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.firstPartyOauth2ClientId != null && message.hasOwnProperty("firstPartyOauth2ClientId")) - if (!$util.isString(message.firstPartyOauth2ClientId)) - return "firstPartyOauth2ClientId: string expected"; - if (message.thirdPartyOauth2ClientId != null && message.hasOwnProperty("thirdPartyOauth2ClientId")) - if (!$util.isString(message.thirdPartyOauth2ClientId)) - return "thirdPartyOauth2ClientId: string expected"; - return null; - }; - - /** - * Creates a WorkforceIdentityBasedOAuth2ClientID message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} WorkforceIdentityBasedOAuth2ClientID - */ - WorkforceIdentityBasedOAuth2ClientID.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID) - return object; - var message = new $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID(); - if (object.firstPartyOauth2ClientId != null) - message.firstPartyOauth2ClientId = String(object.firstPartyOauth2ClientId); - if (object.thirdPartyOauth2ClientId != null) - message.thirdPartyOauth2ClientId = String(object.thirdPartyOauth2ClientId); - return message; - }; - - /** - * Creates a plain object from a WorkforceIdentityBasedOAuth2ClientID message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID} message WorkforceIdentityBasedOAuth2ClientID - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WorkforceIdentityBasedOAuth2ClientID.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.firstPartyOauth2ClientId = ""; - object.thirdPartyOauth2ClientId = ""; - } - if (message.firstPartyOauth2ClientId != null && message.hasOwnProperty("firstPartyOauth2ClientId")) - object.firstPartyOauth2ClientId = message.firstPartyOauth2ClientId; - if (message.thirdPartyOauth2ClientId != null && message.hasOwnProperty("thirdPartyOauth2ClientId")) - object.thirdPartyOauth2ClientId = message.thirdPartyOauth2ClientId; - return object; - }; - - /** - * Converts this WorkforceIdentityBasedOAuth2ClientID to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @instance - * @returns {Object.} JSON object - */ - WorkforceIdentityBasedOAuth2ClientID.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WorkforceIdentityBasedOAuth2ClientID - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WorkforceIdentityBasedOAuth2ClientID.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID"; - }; - - return WorkforceIdentityBasedOAuth2ClientID; - })(); - - v1.ManagementServer = (function() { - - /** - * Properties of a ManagementServer. - * @memberof google.cloud.backupdr.v1 - * @interface IManagementServer - * @property {string|null} [name] ManagementServer name - * @property {string|null} [description] ManagementServer description - * @property {Object.|null} [labels] ManagementServer labels - * @property {google.protobuf.ITimestamp|null} [createTime] ManagementServer createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] ManagementServer updateTime - * @property {google.cloud.backupdr.v1.ManagementServer.InstanceType|null} [type] ManagementServer type - * @property {google.cloud.backupdr.v1.IManagementURI|null} [managementUri] ManagementServer managementUri - * @property {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null} [workforceIdentityBasedManagementUri] ManagementServer workforceIdentityBasedManagementUri - * @property {google.cloud.backupdr.v1.ManagementServer.InstanceState|null} [state] ManagementServer state - * @property {Array.|null} [networks] ManagementServer networks - * @property {string|null} [etag] ManagementServer etag - * @property {string|null} [oauth2ClientId] ManagementServer oauth2ClientId - * @property {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null} [workforceIdentityBasedOauth2ClientId] ManagementServer workforceIdentityBasedOauth2ClientId - * @property {Array.|null} [baProxyUri] ManagementServer baProxyUri - * @property {google.protobuf.IBoolValue|null} [satisfiesPzs] ManagementServer satisfiesPzs - * @property {boolean|null} [satisfiesPzi] ManagementServer satisfiesPzi - */ - - /** - * Constructs a new ManagementServer. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ManagementServer. - * @implements IManagementServer - * @constructor - * @param {google.cloud.backupdr.v1.IManagementServer=} [properties] Properties to set - */ - function ManagementServer(properties) { - this.labels = {}; - this.networks = []; - this.baProxyUri = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ManagementServer name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.name = ""; - - /** - * ManagementServer description. - * @member {string} description - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.description = ""; - - /** - * ManagementServer labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.labels = $util.emptyObject; - - /** - * ManagementServer createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.createTime = null; - - /** - * ManagementServer updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.updateTime = null; - - /** - * ManagementServer type. - * @member {google.cloud.backupdr.v1.ManagementServer.InstanceType} type - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.type = 0; - - /** - * ManagementServer managementUri. - * @member {google.cloud.backupdr.v1.IManagementURI|null|undefined} managementUri - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.managementUri = null; - - /** - * ManagementServer workforceIdentityBasedManagementUri. - * @member {google.cloud.backupdr.v1.IWorkforceIdentityBasedManagementURI|null|undefined} workforceIdentityBasedManagementUri - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.workforceIdentityBasedManagementUri = null; - - /** - * ManagementServer state. - * @member {google.cloud.backupdr.v1.ManagementServer.InstanceState} state - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.state = 0; - - /** - * ManagementServer networks. - * @member {Array.} networks - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.networks = $util.emptyArray; - - /** - * ManagementServer etag. - * @member {string} etag - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.etag = ""; - - /** - * ManagementServer oauth2ClientId. - * @member {string} oauth2ClientId - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.oauth2ClientId = ""; - - /** - * ManagementServer workforceIdentityBasedOauth2ClientId. - * @member {google.cloud.backupdr.v1.IWorkforceIdentityBasedOAuth2ClientID|null|undefined} workforceIdentityBasedOauth2ClientId - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.workforceIdentityBasedOauth2ClientId = null; - - /** - * ManagementServer baProxyUri. - * @member {Array.} baProxyUri - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.baProxyUri = $util.emptyArray; - - /** - * ManagementServer satisfiesPzs. - * @member {google.protobuf.IBoolValue|null|undefined} satisfiesPzs - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.satisfiesPzs = null; - - /** - * ManagementServer satisfiesPzi. - * @member {boolean} satisfiesPzi - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - */ - ManagementServer.prototype.satisfiesPzi = false; - - /** - * Creates a new ManagementServer instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {google.cloud.backupdr.v1.IManagementServer=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer instance - */ - ManagementServer.create = function create(properties) { - return new ManagementServer(properties); - }; - - /** - * Encodes the specified ManagementServer message. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {google.cloud.backupdr.v1.IManagementServer} message ManagementServer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagementServer.encode = function encode(message, writer) { - if (!writer) - 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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, 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(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.networks != null && message.networks.length) - for (var i = 0; i < message.networks.length; ++i) - $root.google.cloud.backupdr.v1.NetworkConfig.encode(message.networks[i], 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.managementUri != null && Object.hasOwnProperty.call(message, "managementUri")) - $root.google.cloud.backupdr.v1.ManagementURI.encode(message.managementUri, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.etag); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.type); - if (message.oauth2ClientId != null && Object.hasOwnProperty.call(message, "oauth2ClientId")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.oauth2ClientId); - if (message.workforceIdentityBasedManagementUri != null && Object.hasOwnProperty.call(message, "workforceIdentityBasedManagementUri")) - $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.encode(message.workforceIdentityBasedManagementUri, writer.uint32(/* id 16, wireType 2 =*/130).fork()).ldelim(); - if (message.workforceIdentityBasedOauth2ClientId != null && Object.hasOwnProperty.call(message, "workforceIdentityBasedOauth2ClientId")) - $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.encode(message.workforceIdentityBasedOauth2ClientId, writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.baProxyUri != null && message.baProxyUri.length) - for (var i = 0; i < message.baProxyUri.length; ++i) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.baProxyUri[i]); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - $root.google.protobuf.BoolValue.encode(message.satisfiesPzs, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.satisfiesPzi); - return writer; - }; - - /** - * Encodes the specified ManagementServer message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ManagementServer.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {google.cloud.backupdr.v1.IManagementServer} message ManagementServer message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ManagementServer.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ManagementServer message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagementServer.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ManagementServer(), 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 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 2: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 14: { - message.type = reader.int32(); - break; - } - case 11: { - message.managementUri = $root.google.cloud.backupdr.v1.ManagementURI.decode(reader, reader.uint32()); - break; - } - case 16: { - message.workforceIdentityBasedManagementUri = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - if (!(message.networks && message.networks.length)) - message.networks = []; - message.networks.push($root.google.cloud.backupdr.v1.NetworkConfig.decode(reader, reader.uint32())); - break; - } - case 13: { - message.etag = reader.string(); - break; - } - case 15: { - message.oauth2ClientId = reader.string(); - break; - } - case 17: { - message.workforceIdentityBasedOauth2ClientId = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.decode(reader, reader.uint32()); - break; - } - case 18: { - if (!(message.baProxyUri && message.baProxyUri.length)) - message.baProxyUri = []; - message.baProxyUri.push(reader.string()); - break; - } - case 19: { - message.satisfiesPzs = $root.google.protobuf.BoolValue.decode(reader, reader.uint32()); - break; - } - case 20: { - message.satisfiesPzi = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ManagementServer message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ManagementServer.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ManagementServer message. - * @function verify - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ManagementServer.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.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.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.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - break; - } - if (message.managementUri != null && message.hasOwnProperty("managementUri")) { - var error = $root.google.cloud.backupdr.v1.ManagementURI.verify(message.managementUri); - if (error) - return "managementUri." + error; - } - if (message.workforceIdentityBasedManagementUri != null && message.hasOwnProperty("workforceIdentityBasedManagementUri")) { - var error = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.verify(message.workforceIdentityBasedManagementUri); - if (error) - return "workforceIdentityBasedManagementUri." + 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: - case 7: - break; - } - if (message.networks != null && message.hasOwnProperty("networks")) { - if (!Array.isArray(message.networks)) - return "networks: array expected"; - for (var i = 0; i < message.networks.length; ++i) { - var error = $root.google.cloud.backupdr.v1.NetworkConfig.verify(message.networks[i]); - if (error) - return "networks." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) - if (!$util.isString(message.oauth2ClientId)) - return "oauth2ClientId: string expected"; - if (message.workforceIdentityBasedOauth2ClientId != null && message.hasOwnProperty("workforceIdentityBasedOauth2ClientId")) { - var error = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.verify(message.workforceIdentityBasedOauth2ClientId); - if (error) - return "workforceIdentityBasedOauth2ClientId." + error; - } - if (message.baProxyUri != null && message.hasOwnProperty("baProxyUri")) { - if (!Array.isArray(message.baProxyUri)) - return "baProxyUri: array expected"; - for (var i = 0; i < message.baProxyUri.length; ++i) - if (!$util.isString(message.baProxyUri[i])) - return "baProxyUri: string[] expected"; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { - var error = $root.google.protobuf.BoolValue.verify(message.satisfiesPzs); - if (error) - return "satisfiesPzs." + error; - } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - return null; - }; - - /** - * Creates a ManagementServer message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ManagementServer} ManagementServer - */ - ManagementServer.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ManagementServer) - return object; - var message = new $root.google.cloud.backupdr.v1.ManagementServer(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.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.backupdr.v1.ManagementServer.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "INSTANCE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "BACKUP_RESTORE": - case 1: - message.type = 1; - break; - } - if (object.managementUri != null) { - if (typeof object.managementUri !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.managementUri: object expected"); - message.managementUri = $root.google.cloud.backupdr.v1.ManagementURI.fromObject(object.managementUri); - } - if (object.workforceIdentityBasedManagementUri != null) { - if (typeof object.workforceIdentityBasedManagementUri !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.workforceIdentityBasedManagementUri: object expected"); - message.workforceIdentityBasedManagementUri = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.fromObject(object.workforceIdentityBasedManagementUri); - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "INSTANCE_STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "READY": - case 2: - message.state = 2; - break; - case "UPDATING": - case 3: - message.state = 3; - break; - case "DELETING": - case 4: - message.state = 4; - break; - case "REPAIRING": - case 5: - message.state = 5; - break; - case "MAINTENANCE": - case 6: - message.state = 6; - break; - case "ERROR": - case 7: - message.state = 7; - break; - } - if (object.networks) { - if (!Array.isArray(object.networks)) - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.networks: array expected"); - message.networks = []; - for (var i = 0; i < object.networks.length; ++i) { - if (typeof object.networks[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.networks: object expected"); - message.networks[i] = $root.google.cloud.backupdr.v1.NetworkConfig.fromObject(object.networks[i]); - } - } - if (object.etag != null) - message.etag = String(object.etag); - if (object.oauth2ClientId != null) - message.oauth2ClientId = String(object.oauth2ClientId); - if (object.workforceIdentityBasedOauth2ClientId != null) { - if (typeof object.workforceIdentityBasedOauth2ClientId !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.workforceIdentityBasedOauth2ClientId: object expected"); - message.workforceIdentityBasedOauth2ClientId = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.fromObject(object.workforceIdentityBasedOauth2ClientId); - } - if (object.baProxyUri) { - if (!Array.isArray(object.baProxyUri)) - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.baProxyUri: array expected"); - message.baProxyUri = []; - for (var i = 0; i < object.baProxyUri.length; ++i) - message.baProxyUri[i] = String(object.baProxyUri[i]); - } - if (object.satisfiesPzs != null) { - if (typeof object.satisfiesPzs !== "object") - throw TypeError(".google.cloud.backupdr.v1.ManagementServer.satisfiesPzs: object expected"); - message.satisfiesPzs = $root.google.protobuf.BoolValue.fromObject(object.satisfiesPzs); - } - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - return message; - }; - - /** - * Creates a plain object from a ManagementServer message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {google.cloud.backupdr.v1.ManagementServer} message ManagementServer - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ManagementServer.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.networks = []; - object.baProxyUri = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "INSTANCE_STATE_UNSPECIFIED" : 0; - object.description = ""; - object.managementUri = null; - object.etag = ""; - object.type = options.enums === String ? "INSTANCE_TYPE_UNSPECIFIED" : 0; - object.oauth2ClientId = ""; - object.workforceIdentityBasedManagementUri = null; - object.workforceIdentityBasedOauth2ClientId = null; - object.satisfiesPzs = null; - object.satisfiesPzi = false; - } - 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.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.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.ManagementServer.InstanceState[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.ManagementServer.InstanceState[message.state] : message.state; - if (message.networks && message.networks.length) { - object.networks = []; - for (var j = 0; j < message.networks.length; ++j) - object.networks[j] = $root.google.cloud.backupdr.v1.NetworkConfig.toObject(message.networks[j], options); - } - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.managementUri != null && message.hasOwnProperty("managementUri")) - object.managementUri = $root.google.cloud.backupdr.v1.ManagementURI.toObject(message.managementUri, options); - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.backupdr.v1.ManagementServer.InstanceType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.ManagementServer.InstanceType[message.type] : message.type; - if (message.oauth2ClientId != null && message.hasOwnProperty("oauth2ClientId")) - object.oauth2ClientId = message.oauth2ClientId; - if (message.workforceIdentityBasedManagementUri != null && message.hasOwnProperty("workforceIdentityBasedManagementUri")) - object.workforceIdentityBasedManagementUri = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedManagementURI.toObject(message.workforceIdentityBasedManagementUri, options); - if (message.workforceIdentityBasedOauth2ClientId != null && message.hasOwnProperty("workforceIdentityBasedOauth2ClientId")) - object.workforceIdentityBasedOauth2ClientId = $root.google.cloud.backupdr.v1.WorkforceIdentityBasedOAuth2ClientID.toObject(message.workforceIdentityBasedOauth2ClientId, options); - if (message.baProxyUri && message.baProxyUri.length) { - object.baProxyUri = []; - for (var j = 0; j < message.baProxyUri.length; ++j) - object.baProxyUri[j] = message.baProxyUri[j]; - } - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) - object.satisfiesPzs = $root.google.protobuf.BoolValue.toObject(message.satisfiesPzs, options); - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) - object.satisfiesPzi = message.satisfiesPzi; - return object; - }; - - /** - * Converts this ManagementServer to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ManagementServer - * @instance - * @returns {Object.} JSON object - */ - ManagementServer.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ManagementServer - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ManagementServer - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ManagementServer.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ManagementServer"; - }; - - /** - * InstanceType enum. - * @name google.cloud.backupdr.v1.ManagementServer.InstanceType - * @enum {number} - * @property {number} INSTANCE_TYPE_UNSPECIFIED=0 INSTANCE_TYPE_UNSPECIFIED value - * @property {number} BACKUP_RESTORE=1 BACKUP_RESTORE value - */ - ManagementServer.InstanceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "BACKUP_RESTORE"] = 1; - return values; - })(); - - /** - * InstanceState enum. - * @name google.cloud.backupdr.v1.ManagementServer.InstanceState - * @enum {number} - * @property {number} INSTANCE_STATE_UNSPECIFIED=0 INSTANCE_STATE_UNSPECIFIED value - * @property {number} CREATING=1 CREATING value - * @property {number} READY=2 READY value - * @property {number} UPDATING=3 UPDATING value - * @property {number} DELETING=4 DELETING value - * @property {number} REPAIRING=5 REPAIRING value - * @property {number} MAINTENANCE=6 MAINTENANCE value - * @property {number} ERROR=7 ERROR value - */ - ManagementServer.InstanceState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CREATING"] = 1; - values[valuesById[2] = "READY"] = 2; - values[valuesById[3] = "UPDATING"] = 3; - values[valuesById[4] = "DELETING"] = 4; - values[valuesById[5] = "REPAIRING"] = 5; - values[valuesById[6] = "MAINTENANCE"] = 6; - values[valuesById[7] = "ERROR"] = 7; - return values; - })(); - - return ManagementServer; - })(); - - v1.ListManagementServersRequest = (function() { - - /** - * Properties of a ListManagementServersRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListManagementServersRequest - * @property {string|null} [parent] ListManagementServersRequest parent - * @property {number|null} [pageSize] ListManagementServersRequest pageSize - * @property {string|null} [pageToken] ListManagementServersRequest pageToken - * @property {string|null} [filter] ListManagementServersRequest filter - * @property {string|null} [orderBy] ListManagementServersRequest orderBy - */ - - /** - * Constructs a new ListManagementServersRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListManagementServersRequest. - * @implements IListManagementServersRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListManagementServersRequest=} [properties] Properties to set - */ - function ListManagementServersRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListManagementServersRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @instance - */ - ListManagementServersRequest.prototype.parent = ""; - - /** - * ListManagementServersRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @instance - */ - ListManagementServersRequest.prototype.pageSize = 0; - - /** - * ListManagementServersRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @instance - */ - ListManagementServersRequest.prototype.pageToken = ""; - - /** - * ListManagementServersRequest filter. - * @member {string|null|undefined} filter - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @instance - */ - ListManagementServersRequest.prototype.filter = null; - - /** - * ListManagementServersRequest orderBy. - * @member {string|null|undefined} orderBy - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @instance - */ - ListManagementServersRequest.prototype.orderBy = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListManagementServersRequest.prototype, "_filter", { - get: $util.oneOfGetter($oneOfFields = ["filter"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ListManagementServersRequest.prototype, "_orderBy", { - get: $util.oneOfGetter($oneOfFields = ["orderBy"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ListManagementServersRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {google.cloud.backupdr.v1.IListManagementServersRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest instance - */ - ListManagementServersRequest.create = function create(properties) { - return new ListManagementServersRequest(properties); - }; - - /** - * Encodes the specified ListManagementServersRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {google.cloud.backupdr.v1.IListManagementServersRequest} message ListManagementServersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListManagementServersRequest.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 ListManagementServersRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {google.cloud.backupdr.v1.IListManagementServersRequest} message ListManagementServersRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListManagementServersRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListManagementServersRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListManagementServersRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListManagementServersRequest(); - 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 ListManagementServersRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListManagementServersRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListManagementServersRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListManagementServersRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.parent != null && message.hasOwnProperty("parent")) - if (!$util.isString(message.parent)) - return "parent: string expected"; - if (message.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")) { - properties._filter = 1; - if (!$util.isString(message.filter)) - return "filter: string expected"; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) { - properties._orderBy = 1; - if (!$util.isString(message.orderBy)) - return "orderBy: string expected"; - } - return null; - }; - - /** - * Creates a ListManagementServersRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListManagementServersRequest} ListManagementServersRequest - */ - ListManagementServersRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListManagementServersRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListManagementServersRequest(); - 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 ListManagementServersRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {google.cloud.backupdr.v1.ListManagementServersRequest} message ListManagementServersRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListManagementServersRequest.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; - if (message.filter != null && message.hasOwnProperty("filter")) { - object.filter = message.filter; - if (options.oneofs) - object._filter = "filter"; - } - if (message.orderBy != null && message.hasOwnProperty("orderBy")) { - object.orderBy = message.orderBy; - if (options.oneofs) - object._orderBy = "orderBy"; - } - return object; - }; - - /** - * Converts this ListManagementServersRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @instance - * @returns {Object.} JSON object - */ - ListManagementServersRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListManagementServersRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListManagementServersRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListManagementServersRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListManagementServersRequest"; - }; - - return ListManagementServersRequest; - })(); - - v1.ListManagementServersResponse = (function() { - - /** - * Properties of a ListManagementServersResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListManagementServersResponse - * @property {Array.|null} [managementServers] ListManagementServersResponse managementServers - * @property {string|null} [nextPageToken] ListManagementServersResponse nextPageToken - * @property {Array.|null} [unreachable] ListManagementServersResponse unreachable - */ - - /** - * Constructs a new ListManagementServersResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListManagementServersResponse. - * @implements IListManagementServersResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListManagementServersResponse=} [properties] Properties to set - */ - function ListManagementServersResponse(properties) { - this.managementServers = []; - 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]]; - } - - /** - * ListManagementServersResponse managementServers. - * @member {Array.} managementServers - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @instance - */ - ListManagementServersResponse.prototype.managementServers = $util.emptyArray; - - /** - * ListManagementServersResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @instance - */ - ListManagementServersResponse.prototype.nextPageToken = ""; - - /** - * ListManagementServersResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @instance - */ - ListManagementServersResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListManagementServersResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {google.cloud.backupdr.v1.IListManagementServersResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse instance - */ - ListManagementServersResponse.create = function create(properties) { - return new ListManagementServersResponse(properties); - }; - - /** - * Encodes the specified ListManagementServersResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {google.cloud.backupdr.v1.IListManagementServersResponse} message ListManagementServersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListManagementServersResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.managementServers != null && message.managementServers.length) - for (var i = 0; i < message.managementServers.length; ++i) - $root.google.cloud.backupdr.v1.ManagementServer.encode(message.managementServers[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 ListManagementServersResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListManagementServersResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {google.cloud.backupdr.v1.IListManagementServersResponse} message ListManagementServersResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListManagementServersResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListManagementServersResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListManagementServersResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListManagementServersResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.managementServers && message.managementServers.length)) - message.managementServers = []; - message.managementServers.push($root.google.cloud.backupdr.v1.ManagementServer.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 ListManagementServersResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListManagementServersResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListManagementServersResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListManagementServersResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.managementServers != null && message.hasOwnProperty("managementServers")) { - if (!Array.isArray(message.managementServers)) - return "managementServers: array expected"; - for (var i = 0; i < message.managementServers.length; ++i) { - var error = $root.google.cloud.backupdr.v1.ManagementServer.verify(message.managementServers[i]); - if (error) - return "managementServers." + 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 ListManagementServersResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListManagementServersResponse} ListManagementServersResponse - */ - ListManagementServersResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListManagementServersResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListManagementServersResponse(); - if (object.managementServers) { - if (!Array.isArray(object.managementServers)) - throw TypeError(".google.cloud.backupdr.v1.ListManagementServersResponse.managementServers: array expected"); - message.managementServers = []; - for (var i = 0; i < object.managementServers.length; ++i) { - if (typeof object.managementServers[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListManagementServersResponse.managementServers: object expected"); - message.managementServers[i] = $root.google.cloud.backupdr.v1.ManagementServer.fromObject(object.managementServers[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListManagementServersResponse.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 ListManagementServersResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {google.cloud.backupdr.v1.ListManagementServersResponse} message ListManagementServersResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListManagementServersResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.managementServers = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.managementServers && message.managementServers.length) { - object.managementServers = []; - for (var j = 0; j < message.managementServers.length; ++j) - object.managementServers[j] = $root.google.cloud.backupdr.v1.ManagementServer.toObject(message.managementServers[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 ListManagementServersResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @instance - * @returns {Object.} JSON object - */ - ListManagementServersResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListManagementServersResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListManagementServersResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListManagementServersResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListManagementServersResponse"; - }; - - return ListManagementServersResponse; - })(); - - v1.GetManagementServerRequest = (function() { - - /** - * Properties of a GetManagementServerRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetManagementServerRequest - * @property {string|null} [name] GetManagementServerRequest name - */ - - /** - * Constructs a new GetManagementServerRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetManagementServerRequest. - * @implements IGetManagementServerRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetManagementServerRequest=} [properties] Properties to set - */ - function GetManagementServerRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetManagementServerRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @instance - */ - GetManagementServerRequest.prototype.name = ""; - - /** - * Creates a new GetManagementServerRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.IGetManagementServerRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest instance - */ - GetManagementServerRequest.create = function create(properties) { - return new GetManagementServerRequest(properties); - }; - - /** - * Encodes the specified GetManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} message GetManagementServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetManagementServerRequest.encode = function encode(message, writer) { - 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 GetManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetManagementServerRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.IGetManagementServerRequest} message GetManagementServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetManagementServerRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetManagementServerRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetManagementServerRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetManagementServerRequest(); - 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 GetManagementServerRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetManagementServerRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetManagementServerRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetManagementServerRequest.verify = function verify(message) { - if (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 GetManagementServerRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetManagementServerRequest} GetManagementServerRequest - */ - GetManagementServerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetManagementServerRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetManagementServerRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetManagementServerRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.GetManagementServerRequest} message GetManagementServerRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetManagementServerRequest.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 GetManagementServerRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @instance - * @returns {Object.} JSON object - */ - GetManagementServerRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetManagementServerRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetManagementServerRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetManagementServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetManagementServerRequest"; - }; - - return GetManagementServerRequest; - })(); - - v1.CreateManagementServerRequest = (function() { - - /** - * Properties of a CreateManagementServerRequest. - * @memberof google.cloud.backupdr.v1 - * @interface ICreateManagementServerRequest - * @property {string|null} [parent] CreateManagementServerRequest parent - * @property {string|null} [managementServerId] CreateManagementServerRequest managementServerId - * @property {google.cloud.backupdr.v1.IManagementServer|null} [managementServer] CreateManagementServerRequest managementServer - * @property {string|null} [requestId] CreateManagementServerRequest requestId - */ - - /** - * Constructs a new CreateManagementServerRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CreateManagementServerRequest. - * @implements ICreateManagementServerRequest - * @constructor - * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest=} [properties] Properties to set - */ - function CreateManagementServerRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateManagementServerRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @instance - */ - CreateManagementServerRequest.prototype.parent = ""; - - /** - * CreateManagementServerRequest managementServerId. - * @member {string} managementServerId - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @instance - */ - CreateManagementServerRequest.prototype.managementServerId = ""; - - /** - * CreateManagementServerRequest managementServer. - * @member {google.cloud.backupdr.v1.IManagementServer|null|undefined} managementServer - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @instance - */ - CreateManagementServerRequest.prototype.managementServer = null; - - /** - * CreateManagementServerRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @instance - */ - CreateManagementServerRequest.prototype.requestId = ""; - - /** - * Creates a new CreateManagementServerRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest instance - */ - CreateManagementServerRequest.create = function create(properties) { - return new CreateManagementServerRequest(properties); - }; - - /** - * Encodes the specified CreateManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} message CreateManagementServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateManagementServerRequest.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.managementServerId != null && Object.hasOwnProperty.call(message, "managementServerId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.managementServerId); - if (message.managementServer != null && Object.hasOwnProperty.call(message, "managementServer")) - $root.google.cloud.backupdr.v1.ManagementServer.encode(message.managementServer, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateManagementServerRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateManagementServerRequest} message CreateManagementServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateManagementServerRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateManagementServerRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateManagementServerRequest(); - 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.managementServerId = reader.string(); - break; - } - case 3: { - message.managementServer = $root.google.cloud.backupdr.v1.ManagementServer.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateManagementServerRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateManagementServerRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateManagementServerRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateManagementServerRequest.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.managementServerId != null && message.hasOwnProperty("managementServerId")) - if (!$util.isString(message.managementServerId)) - return "managementServerId: string expected"; - if (message.managementServer != null && message.hasOwnProperty("managementServer")) { - var error = $root.google.cloud.backupdr.v1.ManagementServer.verify(message.managementServer); - if (error) - return "managementServer." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateManagementServerRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CreateManagementServerRequest} CreateManagementServerRequest - */ - CreateManagementServerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CreateManagementServerRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.CreateManagementServerRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.managementServerId != null) - message.managementServerId = String(object.managementServerId); - if (object.managementServer != null) { - if (typeof object.managementServer !== "object") - throw TypeError(".google.cloud.backupdr.v1.CreateManagementServerRequest.managementServer: object expected"); - message.managementServer = $root.google.cloud.backupdr.v1.ManagementServer.fromObject(object.managementServer); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateManagementServerRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.CreateManagementServerRequest} message CreateManagementServerRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateManagementServerRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.managementServerId = ""; - object.managementServer = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.managementServerId != null && message.hasOwnProperty("managementServerId")) - object.managementServerId = message.managementServerId; - if (message.managementServer != null && message.hasOwnProperty("managementServer")) - object.managementServer = $root.google.cloud.backupdr.v1.ManagementServer.toObject(message.managementServer, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateManagementServerRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @instance - * @returns {Object.} JSON object - */ - CreateManagementServerRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateManagementServerRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CreateManagementServerRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateManagementServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateManagementServerRequest"; - }; - - return CreateManagementServerRequest; - })(); - - v1.DeleteManagementServerRequest = (function() { - - /** - * Properties of a DeleteManagementServerRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IDeleteManagementServerRequest - * @property {string|null} [name] DeleteManagementServerRequest name - * @property {string|null} [requestId] DeleteManagementServerRequest requestId - */ - - /** - * Constructs a new DeleteManagementServerRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DeleteManagementServerRequest. - * @implements IDeleteManagementServerRequest - * @constructor - * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest=} [properties] Properties to set - */ - function DeleteManagementServerRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteManagementServerRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @instance - */ - DeleteManagementServerRequest.prototype.name = ""; - - /** - * DeleteManagementServerRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @instance - */ - DeleteManagementServerRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteManagementServerRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest instance - */ - DeleteManagementServerRequest.create = function create(properties) { - return new DeleteManagementServerRequest(properties); - }; - - /** - * Encodes the specified DeleteManagementServerRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} message DeleteManagementServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteManagementServerRequest.encode = function encode(message, writer) { - if (!writer) - 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 DeleteManagementServerRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteManagementServerRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteManagementServerRequest} message DeleteManagementServerRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteManagementServerRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteManagementServerRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteManagementServerRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteManagementServerRequest(); - 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 DeleteManagementServerRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteManagementServerRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteManagementServerRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteManagementServerRequest.verify = function verify(message) { - if (typeof message !== "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 DeleteManagementServerRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DeleteManagementServerRequest} DeleteManagementServerRequest - */ - DeleteManagementServerRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DeleteManagementServerRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.DeleteManagementServerRequest(); - 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 DeleteManagementServerRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {google.cloud.backupdr.v1.DeleteManagementServerRequest} message DeleteManagementServerRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteManagementServerRequest.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 DeleteManagementServerRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteManagementServerRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteManagementServerRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DeleteManagementServerRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteManagementServerRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteManagementServerRequest"; - }; - - return DeleteManagementServerRequest; - })(); - - v1.InitializeServiceRequest = (function() { - - /** - * Properties of an InitializeServiceRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IInitializeServiceRequest - * @property {string|null} [name] InitializeServiceRequest name - * @property {string|null} [resourceType] InitializeServiceRequest resourceType - * @property {string|null} [requestId] InitializeServiceRequest requestId - * @property {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null} [cloudSqlInstanceInitializationConfig] InitializeServiceRequest cloudSqlInstanceInitializationConfig - */ - - /** - * Constructs a new InitializeServiceRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an InitializeServiceRequest. - * @implements IInitializeServiceRequest - * @constructor - * @param {google.cloud.backupdr.v1.IInitializeServiceRequest=} [properties] Properties to set - */ - function InitializeServiceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InitializeServiceRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @instance - */ - InitializeServiceRequest.prototype.name = ""; - - /** - * InitializeServiceRequest resourceType. - * @member {string} resourceType - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @instance - */ - InitializeServiceRequest.prototype.resourceType = ""; - - /** - * InitializeServiceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @instance - */ - InitializeServiceRequest.prototype.requestId = ""; - - /** - * InitializeServiceRequest cloudSqlInstanceInitializationConfig. - * @member {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig|null|undefined} cloudSqlInstanceInitializationConfig - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @instance - */ - InitializeServiceRequest.prototype.cloudSqlInstanceInitializationConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * InitializeServiceRequest initializationConfig. - * @member {"cloudSqlInstanceInitializationConfig"|undefined} initializationConfig - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @instance - */ - Object.defineProperty(InitializeServiceRequest.prototype, "initializationConfig", { - get: $util.oneOfGetter($oneOfFields = ["cloudSqlInstanceInitializationConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InitializeServiceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {google.cloud.backupdr.v1.IInitializeServiceRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest instance - */ - InitializeServiceRequest.create = function create(properties) { - return new InitializeServiceRequest(properties); - }; - - /** - * Encodes the specified InitializeServiceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} message InitializeServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InitializeServiceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - if (message.cloudSqlInstanceInitializationConfig != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceInitializationConfig")) - $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.encode(message.cloudSqlInstanceInitializationConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified InitializeServiceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {google.cloud.backupdr.v1.IInitializeServiceRequest} message InitializeServiceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InitializeServiceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InitializeServiceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InitializeServiceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InitializeServiceRequest(); - 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.resourceType = reader.string(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.cloudSqlInstanceInitializationConfig = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InitializeServiceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InitializeServiceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InitializeServiceRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InitializeServiceRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.cloudSqlInstanceInitializationConfig != null && message.hasOwnProperty("cloudSqlInstanceInitializationConfig")) { - properties.initializationConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify(message.cloudSqlInstanceInitializationConfig); - if (error) - return "cloudSqlInstanceInitializationConfig." + error; - } - } - return null; - }; - - /** - * Creates an InitializeServiceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.InitializeServiceRequest} InitializeServiceRequest - */ - InitializeServiceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.InitializeServiceRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.InitializeServiceRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.cloudSqlInstanceInitializationConfig != null) { - if (typeof object.cloudSqlInstanceInitializationConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.InitializeServiceRequest.cloudSqlInstanceInitializationConfig: object expected"); - message.cloudSqlInstanceInitializationConfig = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.fromObject(object.cloudSqlInstanceInitializationConfig); - } - return message; - }; - - /** - * Creates a plain object from an InitializeServiceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {google.cloud.backupdr.v1.InitializeServiceRequest} message InitializeServiceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InitializeServiceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.resourceType = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.cloudSqlInstanceInitializationConfig != null && message.hasOwnProperty("cloudSqlInstanceInitializationConfig")) { - object.cloudSqlInstanceInitializationConfig = $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.toObject(message.cloudSqlInstanceInitializationConfig, options); - if (options.oneofs) - object.initializationConfig = "cloudSqlInstanceInitializationConfig"; - } - return object; - }; - - /** - * Converts this InitializeServiceRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @instance - * @returns {Object.} JSON object - */ - InitializeServiceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InitializeServiceRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.InitializeServiceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InitializeServiceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.InitializeServiceRequest"; - }; - - return InitializeServiceRequest; - })(); - - v1.InitializeServiceResponse = (function() { - - /** - * Properties of an InitializeServiceResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IInitializeServiceResponse - * @property {string|null} [backupVaultName] InitializeServiceResponse backupVaultName - * @property {string|null} [backupPlanName] InitializeServiceResponse backupPlanName - */ - - /** - * Constructs a new InitializeServiceResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an InitializeServiceResponse. - * @implements IInitializeServiceResponse - * @constructor - * @param {google.cloud.backupdr.v1.IInitializeServiceResponse=} [properties] Properties to set - */ - function InitializeServiceResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InitializeServiceResponse backupVaultName. - * @member {string} backupVaultName - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @instance - */ - InitializeServiceResponse.prototype.backupVaultName = ""; - - /** - * InitializeServiceResponse backupPlanName. - * @member {string} backupPlanName - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @instance - */ - InitializeServiceResponse.prototype.backupPlanName = ""; - - /** - * Creates a new InitializeServiceResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {google.cloud.backupdr.v1.IInitializeServiceResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse instance - */ - InitializeServiceResponse.create = function create(properties) { - return new InitializeServiceResponse(properties); - }; - - /** - * Encodes the specified InitializeServiceResponse message. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {google.cloud.backupdr.v1.IInitializeServiceResponse} message InitializeServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InitializeServiceResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupVaultName != null && Object.hasOwnProperty.call(message, "backupVaultName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupVaultName); - if (message.backupPlanName != null && Object.hasOwnProperty.call(message, "backupPlanName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanName); - return writer; - }; - - /** - * Encodes the specified InitializeServiceResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InitializeServiceResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {google.cloud.backupdr.v1.IInitializeServiceResponse} message InitializeServiceResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InitializeServiceResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InitializeServiceResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InitializeServiceResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InitializeServiceResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupVaultName = reader.string(); - break; - } - case 2: { - message.backupPlanName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InitializeServiceResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InitializeServiceResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InitializeServiceResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InitializeServiceResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupVaultName != null && message.hasOwnProperty("backupVaultName")) - if (!$util.isString(message.backupVaultName)) - return "backupVaultName: string expected"; - if (message.backupPlanName != null && message.hasOwnProperty("backupPlanName")) - if (!$util.isString(message.backupPlanName)) - return "backupPlanName: string expected"; - return null; - }; - - /** - * Creates an InitializeServiceResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.InitializeServiceResponse} InitializeServiceResponse - */ - InitializeServiceResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.InitializeServiceResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.InitializeServiceResponse(); - if (object.backupVaultName != null) - message.backupVaultName = String(object.backupVaultName); - if (object.backupPlanName != null) - message.backupPlanName = String(object.backupPlanName); - return message; - }; - - /** - * Creates a plain object from an InitializeServiceResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {google.cloud.backupdr.v1.InitializeServiceResponse} message InitializeServiceResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InitializeServiceResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupVaultName = ""; - object.backupPlanName = ""; - } - if (message.backupVaultName != null && message.hasOwnProperty("backupVaultName")) - object.backupVaultName = message.backupVaultName; - if (message.backupPlanName != null && message.hasOwnProperty("backupPlanName")) - object.backupPlanName = message.backupPlanName; - return object; - }; - - /** - * Converts this InitializeServiceResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @instance - * @returns {Object.} JSON object - */ - InitializeServiceResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InitializeServiceResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.InitializeServiceResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InitializeServiceResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.InitializeServiceResponse"; - }; - - return InitializeServiceResponse; - })(); - - v1.OperationMetadata = (function() { - - /** - * Properties of an OperationMetadata. - * @memberof google.cloud.backupdr.v1 - * @interface IOperationMetadata - * @property {google.protobuf.ITimestamp|null} [createTime] OperationMetadata createTime - * @property {google.protobuf.ITimestamp|null} [endTime] OperationMetadata endTime - * @property {string|null} [target] OperationMetadata target - * @property {string|null} [verb] OperationMetadata verb - * @property {string|null} [statusMessage] OperationMetadata statusMessage - * @property {boolean|null} [requestedCancellation] OperationMetadata requestedCancellation - * @property {string|null} [apiVersion] OperationMetadata apiVersion - * @property {Object.|null} [additionalInfo] OperationMetadata additionalInfo - */ - - /** - * Constructs a new OperationMetadata. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an OperationMetadata. - * @implements IOperationMetadata - * @constructor - * @param {google.cloud.backupdr.v1.IOperationMetadata=} [properties] Properties to set - */ - function OperationMetadata(properties) { - this.additionalInfo = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * OperationMetadata createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.createTime = null; - - /** - * OperationMetadata endTime. - * @member {google.protobuf.ITimestamp|null|undefined} endTime - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.endTime = null; - - /** - * OperationMetadata target. - * @member {string} target - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.target = ""; - - /** - * OperationMetadata verb. - * @member {string} verb - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.verb = ""; - - /** - * OperationMetadata statusMessage. - * @member {string} statusMessage - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.statusMessage = ""; - - /** - * OperationMetadata requestedCancellation. - * @member {boolean} requestedCancellation - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.requestedCancellation = false; - - /** - * OperationMetadata apiVersion. - * @member {string} apiVersion - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.apiVersion = ""; - - /** - * OperationMetadata additionalInfo. - * @member {Object.} additionalInfo - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - */ - OperationMetadata.prototype.additionalInfo = $util.emptyObject; - - /** - * Creates a new OperationMetadata instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {google.cloud.backupdr.v1.IOperationMetadata=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata instance - */ - OperationMetadata.create = function create(properties) { - return new OperationMetadata(properties); - }; - - /** - * Encodes the specified OperationMetadata message. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {google.cloud.backupdr.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.endTime != null && Object.hasOwnProperty.call(message, "endTime")) - $root.google.protobuf.Timestamp.encode(message.endTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.target != null && Object.hasOwnProperty.call(message, "target")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.target); - if (message.verb != null && Object.hasOwnProperty.call(message, "verb")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.verb); - if (message.statusMessage != null && Object.hasOwnProperty.call(message, "statusMessage")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.statusMessage); - if (message.requestedCancellation != null && Object.hasOwnProperty.call(message, "requestedCancellation")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.requestedCancellation); - if (message.apiVersion != null && Object.hasOwnProperty.call(message, "apiVersion")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.apiVersion); - if (message.additionalInfo != null && Object.hasOwnProperty.call(message, "additionalInfo")) - for (var keys = Object.keys(message.additionalInfo), 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.additionalInfo[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified OperationMetadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.OperationMetadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {google.cloud.backupdr.v1.IOperationMetadata} message OperationMetadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OperationMetadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.OperationMetadata(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 2: { - message.endTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.target = reader.string(); - break; - } - case 4: { - message.verb = reader.string(); - break; - } - case 5: { - message.statusMessage = reader.string(); - break; - } - case 6: { - message.requestedCancellation = reader.bool(); - break; - } - case 7: { - message.apiVersion = reader.string(); - break; - } - case 8: { - if (message.additionalInfo === $util.emptyObject) - message.additionalInfo = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.additionalInfo[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OperationMetadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OperationMetadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OperationMetadata message. - * @function verify - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OperationMetadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.endTime != null && message.hasOwnProperty("endTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.endTime); - if (error) - return "endTime." + error; - } - if (message.target != null && message.hasOwnProperty("target")) - if (!$util.isString(message.target)) - return "target: string expected"; - if (message.verb != null && message.hasOwnProperty("verb")) - if (!$util.isString(message.verb)) - return "verb: string expected"; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - if (!$util.isString(message.statusMessage)) - return "statusMessage: string expected"; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - if (typeof message.requestedCancellation !== "boolean") - return "requestedCancellation: boolean expected"; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - if (!$util.isString(message.apiVersion)) - return "apiVersion: string expected"; - if (message.additionalInfo != null && message.hasOwnProperty("additionalInfo")) { - if (!$util.isObject(message.additionalInfo)) - return "additionalInfo: object expected"; - var key = Object.keys(message.additionalInfo); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.additionalInfo[key[i]])) - return "additionalInfo: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an OperationMetadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.OperationMetadata} OperationMetadata - */ - OperationMetadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.OperationMetadata) - return object; - var message = new $root.google.cloud.backupdr.v1.OperationMetadata(); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.OperationMetadata.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - if (object.endTime != null) { - if (typeof object.endTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.OperationMetadata.endTime: object expected"); - message.endTime = $root.google.protobuf.Timestamp.fromObject(object.endTime); - } - if (object.target != null) - message.target = String(object.target); - if (object.verb != null) - message.verb = String(object.verb); - if (object.statusMessage != null) - message.statusMessage = String(object.statusMessage); - if (object.requestedCancellation != null) - message.requestedCancellation = Boolean(object.requestedCancellation); - if (object.apiVersion != null) - message.apiVersion = String(object.apiVersion); - if (object.additionalInfo) { - if (typeof object.additionalInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.OperationMetadata.additionalInfo: object expected"); - message.additionalInfo = {}; - for (var keys = Object.keys(object.additionalInfo), i = 0; i < keys.length; ++i) - message.additionalInfo[keys[i]] = String(object.additionalInfo[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an OperationMetadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {google.cloud.backupdr.v1.OperationMetadata} message OperationMetadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OperationMetadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.additionalInfo = {}; - if (options.defaults) { - object.createTime = null; - object.endTime = null; - object.target = ""; - object.verb = ""; - object.statusMessage = ""; - object.requestedCancellation = false; - object.apiVersion = ""; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.endTime != null && message.hasOwnProperty("endTime")) - object.endTime = $root.google.protobuf.Timestamp.toObject(message.endTime, options); - if (message.target != null && message.hasOwnProperty("target")) - object.target = message.target; - if (message.verb != null && message.hasOwnProperty("verb")) - object.verb = message.verb; - if (message.statusMessage != null && message.hasOwnProperty("statusMessage")) - object.statusMessage = message.statusMessage; - if (message.requestedCancellation != null && message.hasOwnProperty("requestedCancellation")) - object.requestedCancellation = message.requestedCancellation; - if (message.apiVersion != null && message.hasOwnProperty("apiVersion")) - object.apiVersion = message.apiVersion; - var keys2; - if (message.additionalInfo && (keys2 = Object.keys(message.additionalInfo)).length) { - object.additionalInfo = {}; - for (var j = 0; j < keys2.length; ++j) - object.additionalInfo[keys2[j]] = message.additionalInfo[keys2[j]]; - } - return object; - }; - - /** - * Converts this OperationMetadata to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @instance - * @returns {Object.} JSON object - */ - OperationMetadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for OperationMetadata - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.OperationMetadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - OperationMetadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.OperationMetadata"; - }; - - return OperationMetadata; - })(); - - v1.BackupPlan = (function() { - - /** - * Properties of a BackupPlan. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupPlan - * @property {string|null} [name] BackupPlan name - * @property {string|null} [description] BackupPlan description - * @property {Object.|null} [labels] BackupPlan labels - * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlan createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlan updateTime - * @property {Array.|null} [backupRules] BackupPlan backupRules - * @property {google.cloud.backupdr.v1.BackupPlan.State|null} [state] BackupPlan state - * @property {string|null} [resourceType] BackupPlan resourceType - * @property {string|null} [etag] BackupPlan etag - * @property {string|null} [backupVault] BackupPlan backupVault - * @property {string|null} [backupVaultServiceAccount] BackupPlan backupVaultServiceAccount - * @property {number|Long|null} [logRetentionDays] BackupPlan logRetentionDays - * @property {Array.|null} [supportedResourceTypes] BackupPlan supportedResourceTypes - * @property {string|null} [revisionId] BackupPlan revisionId - * @property {string|null} [revisionName] BackupPlan revisionName - */ - - /** - * Constructs a new BackupPlan. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupPlan. - * @implements IBackupPlan - * @constructor - * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set - */ - function BackupPlan(properties) { - this.labels = {}; - this.backupRules = []; - this.supportedResourceTypes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupPlan name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.name = ""; - - /** - * BackupPlan description. - * @member {string} description - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.description = ""; - - /** - * BackupPlan labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.labels = $util.emptyObject; - - /** - * BackupPlan createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.createTime = null; - - /** - * BackupPlan updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.updateTime = null; - - /** - * BackupPlan backupRules. - * @member {Array.} backupRules - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.backupRules = $util.emptyArray; - - /** - * BackupPlan state. - * @member {google.cloud.backupdr.v1.BackupPlan.State} state - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.state = 0; - - /** - * BackupPlan resourceType. - * @member {string} resourceType - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.resourceType = ""; - - /** - * BackupPlan etag. - * @member {string} etag - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.etag = ""; - - /** - * BackupPlan backupVault. - * @member {string} backupVault - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.backupVault = ""; - - /** - * BackupPlan backupVaultServiceAccount. - * @member {string} backupVaultServiceAccount - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.backupVaultServiceAccount = ""; - - /** - * BackupPlan logRetentionDays. - * @member {number|Long} logRetentionDays - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.logRetentionDays = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BackupPlan supportedResourceTypes. - * @member {Array.} supportedResourceTypes - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.supportedResourceTypes = $util.emptyArray; - - /** - * BackupPlan revisionId. - * @member {string} revisionId - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.revisionId = ""; - - /** - * BackupPlan revisionName. - * @member {string} revisionName - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - */ - BackupPlan.prototype.revisionName = ""; - - /** - * Creates a new BackupPlan instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {google.cloud.backupdr.v1.IBackupPlan=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan instance - */ - BackupPlan.create = function create(properties) { - return new BackupPlan(properties); - }; - - /** - * Encodes the specified BackupPlan message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupPlan.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); - 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.backupRules != null && message.backupRules.length) - for (var i = 0; i < message.backupRules.length; ++i) - $root.google.cloud.backupdr.v1.BackupRule.encode(message.backupRules[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.resourceType); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.backupVault); - if (message.backupVaultServiceAccount != null && Object.hasOwnProperty.call(message, "backupVaultServiceAccount")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.backupVaultServiceAccount); - if (message.logRetentionDays != null && Object.hasOwnProperty.call(message, "logRetentionDays")) - writer.uint32(/* id 12, wireType 0 =*/96).int64(message.logRetentionDays); - if (message.supportedResourceTypes != null && message.supportedResourceTypes.length) - for (var i = 0; i < message.supportedResourceTypes.length; ++i) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.supportedResourceTypes[i]); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.revisionId); - if (message.revisionName != null && Object.hasOwnProperty.call(message, "revisionName")) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.revisionName); - return writer; - }; - - /** - * Encodes the specified BackupPlan message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlan.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {google.cloud.backupdr.v1.IBackupPlan} message BackupPlan message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupPlan.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupPlan message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupPlan.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlan(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - 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.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.backupRules && message.backupRules.length)) - message.backupRules = []; - message.backupRules.push($root.google.cloud.backupdr.v1.BackupRule.decode(reader, reader.uint32())); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - message.resourceType = reader.string(); - break; - } - case 9: { - message.etag = reader.string(); - break; - } - case 10: { - message.backupVault = reader.string(); - break; - } - case 11: { - message.backupVaultServiceAccount = reader.string(); - break; - } - case 12: { - message.logRetentionDays = reader.int64(); - break; - } - case 13: { - if (!(message.supportedResourceTypes && message.supportedResourceTypes.length)) - message.supportedResourceTypes = []; - message.supportedResourceTypes.push(reader.string()); - break; - } - case 14: { - message.revisionId = reader.string(); - break; - } - case 15: { - message.revisionName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupPlan message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupPlan.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupPlan message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupPlan.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.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.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.backupRules != null && message.hasOwnProperty("backupRules")) { - if (!Array.isArray(message.backupRules)) - return "backupRules: array expected"; - for (var i = 0; i < message.backupRules.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupRule.verify(message.backupRules[i]); - if (error) - return "backupRules." + 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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.backupVault != null && message.hasOwnProperty("backupVault")) - if (!$util.isString(message.backupVault)) - return "backupVault: string expected"; - if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) - if (!$util.isString(message.backupVaultServiceAccount)) - return "backupVaultServiceAccount: string expected"; - if (message.logRetentionDays != null && message.hasOwnProperty("logRetentionDays")) - if (!$util.isInteger(message.logRetentionDays) && !(message.logRetentionDays && $util.isInteger(message.logRetentionDays.low) && $util.isInteger(message.logRetentionDays.high))) - return "logRetentionDays: integer|Long expected"; - if (message.supportedResourceTypes != null && message.hasOwnProperty("supportedResourceTypes")) { - if (!Array.isArray(message.supportedResourceTypes)) - return "supportedResourceTypes: array expected"; - for (var i = 0; i < message.supportedResourceTypes.length; ++i) - if (!$util.isString(message.supportedResourceTypes[i])) - return "supportedResourceTypes: string[] expected"; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.revisionName != null && message.hasOwnProperty("revisionName")) - if (!$util.isString(message.revisionName)) - return "revisionName: string expected"; - return null; - }; - - /** - * Creates a BackupPlan message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupPlan} BackupPlan - */ - BackupPlan.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupPlan) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupPlan(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlan.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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlan.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.backupdr.v1.BackupPlan.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.backupRules) { - if (!Array.isArray(object.backupRules)) - throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: array expected"); - message.backupRules = []; - for (var i = 0; i < object.backupRules.length; ++i) { - if (typeof object.backupRules[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlan.backupRules: object expected"); - message.backupRules[i] = $root.google.cloud.backupdr.v1.BackupRule.fromObject(object.backupRules[i]); - } - } - switch (object.state) { - default: - if (typeof object.state === "number") { - message.state = object.state; - break; - } - break; - case "STATE_UNSPECIFIED": - case 0: - message.state = 0; - break; - case "CREATING": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "DELETING": - case 3: - message.state = 3; - break; - case "INACTIVE": - case 4: - message.state = 4; - break; - case "UPDATING": - case 5: - message.state = 5; - break; - } - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.etag != null) - message.etag = String(object.etag); - if (object.backupVault != null) - message.backupVault = String(object.backupVault); - if (object.backupVaultServiceAccount != null) - message.backupVaultServiceAccount = String(object.backupVaultServiceAccount); - if (object.logRetentionDays != null) - if ($util.Long) - (message.logRetentionDays = $util.Long.fromValue(object.logRetentionDays)).unsigned = false; - else if (typeof object.logRetentionDays === "string") - message.logRetentionDays = parseInt(object.logRetentionDays, 10); - else if (typeof object.logRetentionDays === "number") - message.logRetentionDays = object.logRetentionDays; - else if (typeof object.logRetentionDays === "object") - message.logRetentionDays = new $util.LongBits(object.logRetentionDays.low >>> 0, object.logRetentionDays.high >>> 0).toNumber(); - if (object.supportedResourceTypes) { - if (!Array.isArray(object.supportedResourceTypes)) - throw TypeError(".google.cloud.backupdr.v1.BackupPlan.supportedResourceTypes: array expected"); - message.supportedResourceTypes = []; - for (var i = 0; i < object.supportedResourceTypes.length; ++i) - message.supportedResourceTypes[i] = String(object.supportedResourceTypes[i]); - } - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - if (object.revisionName != null) - message.revisionName = String(object.revisionName); - return message; - }; - - /** - * Creates a plain object from a BackupPlan message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {google.cloud.backupdr.v1.BackupPlan} message BackupPlan - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupPlan.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backupRules = []; - object.supportedResourceTypes = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.resourceType = ""; - object.etag = ""; - object.backupVault = ""; - object.backupVaultServiceAccount = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.logRetentionDays = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.logRetentionDays = options.longs === String ? "0" : 0; - object.revisionId = ""; - object.revisionName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.backupRules && message.backupRules.length) { - object.backupRules = []; - for (var j = 0; j < message.backupRules.length; ++j) - object.backupRules[j] = $root.google.cloud.backupdr.v1.BackupRule.toObject(message.backupRules[j], options); - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlan.State[message.state] : message.state; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.backupVault != null && message.hasOwnProperty("backupVault")) - object.backupVault = message.backupVault; - if (message.backupVaultServiceAccount != null && message.hasOwnProperty("backupVaultServiceAccount")) - object.backupVaultServiceAccount = message.backupVaultServiceAccount; - if (message.logRetentionDays != null && message.hasOwnProperty("logRetentionDays")) - if (typeof message.logRetentionDays === "number") - object.logRetentionDays = options.longs === String ? String(message.logRetentionDays) : message.logRetentionDays; - else - object.logRetentionDays = options.longs === String ? $util.Long.prototype.toString.call(message.logRetentionDays) : options.longs === Number ? new $util.LongBits(message.logRetentionDays.low >>> 0, message.logRetentionDays.high >>> 0).toNumber() : message.logRetentionDays; - if (message.supportedResourceTypes && message.supportedResourceTypes.length) { - object.supportedResourceTypes = []; - for (var j = 0; j < message.supportedResourceTypes.length; ++j) - object.supportedResourceTypes[j] = message.supportedResourceTypes[j]; - } - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.revisionName != null && message.hasOwnProperty("revisionName")) - object.revisionName = message.revisionName; - return object; - }; - - /** - * Converts this BackupPlan to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupPlan - * @instance - * @returns {Object.} JSON object - */ - BackupPlan.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupPlan - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupPlan - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupPlan.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlan"; - }; - - /** - * State enum. - * @name google.cloud.backupdr.v1.BackupPlan.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} DELETING=3 DELETING value - * @property {number} INACTIVE=4 INACTIVE value - * @property {number} UPDATING=5 UPDATING value - */ - BackupPlan.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] = "DELETING"] = 3; - values[valuesById[4] = "INACTIVE"] = 4; - values[valuesById[5] = "UPDATING"] = 5; - return values; - })(); - - return BackupPlan; - })(); - - v1.BackupRule = (function() { - - /** - * Properties of a BackupRule. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupRule - * @property {string|null} [ruleId] BackupRule ruleId - * @property {number|null} [backupRetentionDays] BackupRule backupRetentionDays - * @property {google.cloud.backupdr.v1.IStandardSchedule|null} [standardSchedule] BackupRule standardSchedule - */ - - /** - * Constructs a new BackupRule. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupRule. - * @implements IBackupRule - * @constructor - * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set - */ - function BackupRule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupRule ruleId. - * @member {string} ruleId - * @memberof google.cloud.backupdr.v1.BackupRule - * @instance - */ - BackupRule.prototype.ruleId = ""; - - /** - * BackupRule backupRetentionDays. - * @member {number} backupRetentionDays - * @memberof google.cloud.backupdr.v1.BackupRule - * @instance - */ - BackupRule.prototype.backupRetentionDays = 0; - - /** - * BackupRule standardSchedule. - * @member {google.cloud.backupdr.v1.IStandardSchedule|null|undefined} standardSchedule - * @memberof google.cloud.backupdr.v1.BackupRule - * @instance - */ - BackupRule.prototype.standardSchedule = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupRule backupScheduleOneof. - * @member {"standardSchedule"|undefined} backupScheduleOneof - * @memberof google.cloud.backupdr.v1.BackupRule - * @instance - */ - Object.defineProperty(BackupRule.prototype, "backupScheduleOneof", { - get: $util.oneOfGetter($oneOfFields = ["standardSchedule"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupRule instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {google.cloud.backupdr.v1.IBackupRule=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule instance - */ - BackupRule.create = function create(properties) { - return new BackupRule(properties); - }; - - /** - * Encodes the specified BackupRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); - if (message.backupRetentionDays != null && Object.hasOwnProperty.call(message, "backupRetentionDays")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.backupRetentionDays); - if (message.standardSchedule != null && Object.hasOwnProperty.call(message, "standardSchedule")) - $root.google.cloud.backupdr.v1.StandardSchedule.encode(message.standardSchedule, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {google.cloud.backupdr.v1.IBackupRule} message BackupRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupRule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ruleId = reader.string(); - break; - } - case 4: { - message.backupRetentionDays = reader.int32(); - break; - } - case 5: { - message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupRule message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - if (!$util.isString(message.ruleId)) - return "ruleId: string expected"; - if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) - if (!$util.isInteger(message.backupRetentionDays)) - return "backupRetentionDays: integer expected"; - if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { - properties.backupScheduleOneof = 1; - { - var error = $root.google.cloud.backupdr.v1.StandardSchedule.verify(message.standardSchedule); - if (error) - return "standardSchedule." + error; - } - } - return null; - }; - - /** - * Creates a BackupRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupRule} BackupRule - */ - BackupRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupRule) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupRule(); - if (object.ruleId != null) - message.ruleId = String(object.ruleId); - if (object.backupRetentionDays != null) - message.backupRetentionDays = object.backupRetentionDays | 0; - if (object.standardSchedule != null) { - if (typeof object.standardSchedule !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupRule.standardSchedule: object expected"); - message.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.fromObject(object.standardSchedule); - } - return message; - }; - - /** - * Creates a plain object from a BackupRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {google.cloud.backupdr.v1.BackupRule} message BackupRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ruleId = ""; - object.backupRetentionDays = 0; - } - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - object.ruleId = message.ruleId; - if (message.backupRetentionDays != null && message.hasOwnProperty("backupRetentionDays")) - object.backupRetentionDays = message.backupRetentionDays; - if (message.standardSchedule != null && message.hasOwnProperty("standardSchedule")) { - object.standardSchedule = $root.google.cloud.backupdr.v1.StandardSchedule.toObject(message.standardSchedule, options); - if (options.oneofs) - object.backupScheduleOneof = "standardSchedule"; - } - return object; - }; - - /** - * Converts this BackupRule to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupRule - * @instance - * @returns {Object.} JSON object - */ - BackupRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupRule - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupRule"; - }; - - return BackupRule; - })(); - - v1.StandardSchedule = (function() { - - /** - * Properties of a StandardSchedule. - * @memberof google.cloud.backupdr.v1 - * @interface IStandardSchedule - * @property {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType|null} [recurrenceType] StandardSchedule recurrenceType - * @property {number|null} [hourlyFrequency] StandardSchedule hourlyFrequency - * @property {Array.|null} [daysOfWeek] StandardSchedule daysOfWeek - * @property {Array.|null} [daysOfMonth] StandardSchedule daysOfMonth - * @property {google.cloud.backupdr.v1.IWeekDayOfMonth|null} [weekDayOfMonth] StandardSchedule weekDayOfMonth - * @property {Array.|null} [months] StandardSchedule months - * @property {google.cloud.backupdr.v1.IBackupWindow|null} [backupWindow] StandardSchedule backupWindow - * @property {string|null} [timeZone] StandardSchedule timeZone - */ - - /** - * Constructs a new StandardSchedule. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a StandardSchedule. - * @implements IStandardSchedule - * @constructor - * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set - */ - function StandardSchedule(properties) { - this.daysOfWeek = []; - this.daysOfMonth = []; - this.months = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * StandardSchedule recurrenceType. - * @member {google.cloud.backupdr.v1.StandardSchedule.RecurrenceType} recurrenceType - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.recurrenceType = 0; - - /** - * StandardSchedule hourlyFrequency. - * @member {number} hourlyFrequency - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.hourlyFrequency = 0; - - /** - * StandardSchedule daysOfWeek. - * @member {Array.} daysOfWeek - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.daysOfWeek = $util.emptyArray; - - /** - * StandardSchedule daysOfMonth. - * @member {Array.} daysOfMonth - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.daysOfMonth = $util.emptyArray; - - /** - * StandardSchedule weekDayOfMonth. - * @member {google.cloud.backupdr.v1.IWeekDayOfMonth|null|undefined} weekDayOfMonth - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.weekDayOfMonth = null; - - /** - * StandardSchedule months. - * @member {Array.} months - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.months = $util.emptyArray; - - /** - * StandardSchedule backupWindow. - * @member {google.cloud.backupdr.v1.IBackupWindow|null|undefined} backupWindow - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.backupWindow = null; - - /** - * StandardSchedule timeZone. - * @member {string} timeZone - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - */ - StandardSchedule.prototype.timeZone = ""; - - /** - * Creates a new StandardSchedule instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {google.cloud.backupdr.v1.IStandardSchedule=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule instance - */ - StandardSchedule.create = function create(properties) { - return new StandardSchedule(properties); - }; - - /** - * Encodes the specified StandardSchedule message. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StandardSchedule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.recurrenceType != null && Object.hasOwnProperty.call(message, "recurrenceType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.recurrenceType); - if (message.hourlyFrequency != null && Object.hasOwnProperty.call(message, "hourlyFrequency")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.hourlyFrequency); - if (message.daysOfWeek != null && message.daysOfWeek.length) { - writer.uint32(/* id 3, wireType 2 =*/26).fork(); - for (var i = 0; i < message.daysOfWeek.length; ++i) - writer.int32(message.daysOfWeek[i]); - writer.ldelim(); - } - if (message.daysOfMonth != null && message.daysOfMonth.length) { - writer.uint32(/* id 4, wireType 2 =*/34).fork(); - for (var i = 0; i < message.daysOfMonth.length; ++i) - writer.int32(message.daysOfMonth[i]); - writer.ldelim(); - } - if (message.weekDayOfMonth != null && Object.hasOwnProperty.call(message, "weekDayOfMonth")) - $root.google.cloud.backupdr.v1.WeekDayOfMonth.encode(message.weekDayOfMonth, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.months != null && message.months.length) { - writer.uint32(/* id 6, wireType 2 =*/50).fork(); - for (var i = 0; i < message.months.length; ++i) - writer.int32(message.months[i]); - writer.ldelim(); - } - if (message.backupWindow != null && Object.hasOwnProperty.call(message, "backupWindow")) - $root.google.cloud.backupdr.v1.BackupWindow.encode(message.backupWindow, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.timeZone != null && Object.hasOwnProperty.call(message, "timeZone")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.timeZone); - return writer; - }; - - /** - * Encodes the specified StandardSchedule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.StandardSchedule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {google.cloud.backupdr.v1.IStandardSchedule} message StandardSchedule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - StandardSchedule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a StandardSchedule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StandardSchedule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.StandardSchedule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.recurrenceType = reader.int32(); - break; - } - case 2: { - message.hourlyFrequency = reader.int32(); - break; - } - case 3: { - if (!(message.daysOfWeek && message.daysOfWeek.length)) - message.daysOfWeek = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfWeek.push(reader.int32()); - } else - message.daysOfWeek.push(reader.int32()); - break; - } - case 4: { - if (!(message.daysOfMonth && message.daysOfMonth.length)) - message.daysOfMonth = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.daysOfMonth.push(reader.int32()); - } else - message.daysOfMonth.push(reader.int32()); - break; - } - case 5: { - message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.decode(reader, reader.uint32()); - break; - } - case 6: { - if (!(message.months && message.months.length)) - message.months = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.months.push(reader.int32()); - } else - message.months.push(reader.int32()); - break; - } - case 7: { - message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.decode(reader, reader.uint32()); - break; - } - case 8: { - message.timeZone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a StandardSchedule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - StandardSchedule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a StandardSchedule message. - * @function verify - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - StandardSchedule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) - switch (message.recurrenceType) { - default: - return "recurrenceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) - if (!$util.isInteger(message.hourlyFrequency)) - return "hourlyFrequency: integer expected"; - if (message.daysOfWeek != null && message.hasOwnProperty("daysOfWeek")) { - if (!Array.isArray(message.daysOfWeek)) - return "daysOfWeek: array expected"; - for (var i = 0; i < message.daysOfWeek.length; ++i) - switch (message.daysOfWeek[i]) { - default: - return "daysOfWeek: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - } - if (message.daysOfMonth != null && message.hasOwnProperty("daysOfMonth")) { - if (!Array.isArray(message.daysOfMonth)) - return "daysOfMonth: array expected"; - for (var i = 0; i < message.daysOfMonth.length; ++i) - if (!$util.isInteger(message.daysOfMonth[i])) - return "daysOfMonth: integer[] expected"; - } - if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) { - var error = $root.google.cloud.backupdr.v1.WeekDayOfMonth.verify(message.weekDayOfMonth); - if (error) - return "weekDayOfMonth." + error; - } - if (message.months != null && message.hasOwnProperty("months")) { - if (!Array.isArray(message.months)) - return "months: array expected"; - for (var i = 0; i < message.months.length; ++i) - switch (message.months[i]) { - default: - return "months: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - break; - } - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) { - var error = $root.google.cloud.backupdr.v1.BackupWindow.verify(message.backupWindow); - if (error) - return "backupWindow." + error; - } - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - if (!$util.isString(message.timeZone)) - return "timeZone: string expected"; - return null; - }; - - /** - * Creates a StandardSchedule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.StandardSchedule} StandardSchedule - */ - StandardSchedule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.StandardSchedule) - return object; - var message = new $root.google.cloud.backupdr.v1.StandardSchedule(); - switch (object.recurrenceType) { - default: - if (typeof object.recurrenceType === "number") { - message.recurrenceType = object.recurrenceType; - break; - } - break; - case "RECURRENCE_TYPE_UNSPECIFIED": - case 0: - message.recurrenceType = 0; - break; - case "HOURLY": - case 1: - message.recurrenceType = 1; - break; - case "DAILY": - case 2: - message.recurrenceType = 2; - break; - case "WEEKLY": - case 3: - message.recurrenceType = 3; - break; - case "MONTHLY": - case 4: - message.recurrenceType = 4; - break; - case "YEARLY": - case 5: - message.recurrenceType = 5; - break; - } - if (object.hourlyFrequency != null) - message.hourlyFrequency = object.hourlyFrequency | 0; - if (object.daysOfWeek) { - if (!Array.isArray(object.daysOfWeek)) - throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfWeek: array expected"); - message.daysOfWeek = []; - for (var i = 0; i < object.daysOfWeek.length; ++i) - switch (object.daysOfWeek[i]) { - default: - if (typeof object.daysOfWeek[i] === "number") { - message.daysOfWeek[i] = object.daysOfWeek[i]; - break; - } - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.daysOfWeek[i] = 0; - break; - case "MONDAY": - case 1: - message.daysOfWeek[i] = 1; - break; - case "TUESDAY": - case 2: - message.daysOfWeek[i] = 2; - break; - case "WEDNESDAY": - case 3: - message.daysOfWeek[i] = 3; - break; - case "THURSDAY": - case 4: - message.daysOfWeek[i] = 4; - break; - case "FRIDAY": - case 5: - message.daysOfWeek[i] = 5; - break; - case "SATURDAY": - case 6: - message.daysOfWeek[i] = 6; - break; - case "SUNDAY": - case 7: - message.daysOfWeek[i] = 7; - break; - } - } - if (object.daysOfMonth) { - if (!Array.isArray(object.daysOfMonth)) - throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.daysOfMonth: array expected"); - message.daysOfMonth = []; - for (var i = 0; i < object.daysOfMonth.length; ++i) - message.daysOfMonth[i] = object.daysOfMonth[i] | 0; - } - if (object.weekDayOfMonth != null) { - if (typeof object.weekDayOfMonth !== "object") - throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.weekDayOfMonth: object expected"); - message.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.fromObject(object.weekDayOfMonth); - } - if (object.months) { - if (!Array.isArray(object.months)) - throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.months: array expected"); - message.months = []; - for (var i = 0; i < object.months.length; ++i) - switch (object.months[i]) { - default: - if (typeof object.months[i] === "number") { - message.months[i] = object.months[i]; - break; - } - case "MONTH_UNSPECIFIED": - case 0: - message.months[i] = 0; - break; - case "JANUARY": - case 1: - message.months[i] = 1; - break; - case "FEBRUARY": - case 2: - message.months[i] = 2; - break; - case "MARCH": - case 3: - message.months[i] = 3; - break; - case "APRIL": - case 4: - message.months[i] = 4; - break; - case "MAY": - case 5: - message.months[i] = 5; - break; - case "JUNE": - case 6: - message.months[i] = 6; - break; - case "JULY": - case 7: - message.months[i] = 7; - break; - case "AUGUST": - case 8: - message.months[i] = 8; - break; - case "SEPTEMBER": - case 9: - message.months[i] = 9; - break; - case "OCTOBER": - case 10: - message.months[i] = 10; - break; - case "NOVEMBER": - case 11: - message.months[i] = 11; - break; - case "DECEMBER": - case 12: - message.months[i] = 12; - break; - } - } - if (object.backupWindow != null) { - if (typeof object.backupWindow !== "object") - throw TypeError(".google.cloud.backupdr.v1.StandardSchedule.backupWindow: object expected"); - message.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.fromObject(object.backupWindow); - } - if (object.timeZone != null) - message.timeZone = String(object.timeZone); - return message; - }; - - /** - * Creates a plain object from a StandardSchedule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {google.cloud.backupdr.v1.StandardSchedule} message StandardSchedule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - StandardSchedule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.daysOfWeek = []; - object.daysOfMonth = []; - object.months = []; - } - if (options.defaults) { - object.recurrenceType = options.enums === String ? "RECURRENCE_TYPE_UNSPECIFIED" : 0; - object.hourlyFrequency = 0; - object.weekDayOfMonth = null; - object.backupWindow = null; - object.timeZone = ""; - } - if (message.recurrenceType != null && message.hasOwnProperty("recurrenceType")) - object.recurrenceType = options.enums === String ? $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] === undefined ? message.recurrenceType : $root.google.cloud.backupdr.v1.StandardSchedule.RecurrenceType[message.recurrenceType] : message.recurrenceType; - if (message.hourlyFrequency != null && message.hasOwnProperty("hourlyFrequency")) - object.hourlyFrequency = message.hourlyFrequency; - if (message.daysOfWeek && message.daysOfWeek.length) { - object.daysOfWeek = []; - for (var j = 0; j < message.daysOfWeek.length; ++j) - object.daysOfWeek[j] = options.enums === String ? $root.google.type.DayOfWeek[message.daysOfWeek[j]] === undefined ? message.daysOfWeek[j] : $root.google.type.DayOfWeek[message.daysOfWeek[j]] : message.daysOfWeek[j]; - } - if (message.daysOfMonth && message.daysOfMonth.length) { - object.daysOfMonth = []; - for (var j = 0; j < message.daysOfMonth.length; ++j) - object.daysOfMonth[j] = message.daysOfMonth[j]; - } - if (message.weekDayOfMonth != null && message.hasOwnProperty("weekDayOfMonth")) - object.weekDayOfMonth = $root.google.cloud.backupdr.v1.WeekDayOfMonth.toObject(message.weekDayOfMonth, options); - if (message.months && message.months.length) { - object.months = []; - for (var j = 0; j < message.months.length; ++j) - object.months[j] = options.enums === String ? $root.google.type.Month[message.months[j]] === undefined ? message.months[j] : $root.google.type.Month[message.months[j]] : message.months[j]; - } - if (message.backupWindow != null && message.hasOwnProperty("backupWindow")) - object.backupWindow = $root.google.cloud.backupdr.v1.BackupWindow.toObject(message.backupWindow, options); - if (message.timeZone != null && message.hasOwnProperty("timeZone")) - object.timeZone = message.timeZone; - return object; - }; - - /** - * Converts this StandardSchedule to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @instance - * @returns {Object.} JSON object - */ - StandardSchedule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for StandardSchedule - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.StandardSchedule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - StandardSchedule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.StandardSchedule"; - }; - - /** - * RecurrenceType enum. - * @name google.cloud.backupdr.v1.StandardSchedule.RecurrenceType - * @enum {number} - * @property {number} RECURRENCE_TYPE_UNSPECIFIED=0 RECURRENCE_TYPE_UNSPECIFIED value - * @property {number} HOURLY=1 HOURLY value - * @property {number} DAILY=2 DAILY value - * @property {number} WEEKLY=3 WEEKLY value - * @property {number} MONTHLY=4 MONTHLY value - * @property {number} YEARLY=5 YEARLY value - */ - StandardSchedule.RecurrenceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RECURRENCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "HOURLY"] = 1; - values[valuesById[2] = "DAILY"] = 2; - values[valuesById[3] = "WEEKLY"] = 3; - values[valuesById[4] = "MONTHLY"] = 4; - values[valuesById[5] = "YEARLY"] = 5; - return values; - })(); - - return StandardSchedule; - })(); - - v1.BackupWindow = (function() { - - /** - * Properties of a BackupWindow. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupWindow - * @property {number|null} [startHourOfDay] BackupWindow startHourOfDay - * @property {number|null} [endHourOfDay] BackupWindow endHourOfDay - */ - - /** - * Constructs a new BackupWindow. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupWindow. - * @implements IBackupWindow - * @constructor - * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set - */ - function BackupWindow(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupWindow startHourOfDay. - * @member {number} startHourOfDay - * @memberof google.cloud.backupdr.v1.BackupWindow - * @instance - */ - BackupWindow.prototype.startHourOfDay = 0; - - /** - * BackupWindow endHourOfDay. - * @member {number} endHourOfDay - * @memberof google.cloud.backupdr.v1.BackupWindow - * @instance - */ - BackupWindow.prototype.endHourOfDay = 0; - - /** - * Creates a new BackupWindow instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {google.cloud.backupdr.v1.IBackupWindow=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow instance - */ - BackupWindow.create = function create(properties) { - return new BackupWindow(properties); - }; - - /** - * Encodes the specified BackupWindow message. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupWindow.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.startHourOfDay != null && Object.hasOwnProperty.call(message, "startHourOfDay")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.startHourOfDay); - if (message.endHourOfDay != null && Object.hasOwnProperty.call(message, "endHourOfDay")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.endHourOfDay); - return writer; - }; - - /** - * Encodes the specified BackupWindow message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupWindow.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {google.cloud.backupdr.v1.IBackupWindow} message BackupWindow message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupWindow.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupWindow message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupWindow.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupWindow(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.startHourOfDay = reader.int32(); - break; - } - case 2: { - message.endHourOfDay = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupWindow message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupWindow.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupWindow message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupWindow.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) - if (!$util.isInteger(message.startHourOfDay)) - return "startHourOfDay: integer expected"; - if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) - if (!$util.isInteger(message.endHourOfDay)) - return "endHourOfDay: integer expected"; - return null; - }; - - /** - * Creates a BackupWindow message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupWindow} BackupWindow - */ - BackupWindow.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupWindow) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupWindow(); - if (object.startHourOfDay != null) - message.startHourOfDay = object.startHourOfDay | 0; - if (object.endHourOfDay != null) - message.endHourOfDay = object.endHourOfDay | 0; - return message; - }; - - /** - * Creates a plain object from a BackupWindow message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {google.cloud.backupdr.v1.BackupWindow} message BackupWindow - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupWindow.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.startHourOfDay = 0; - object.endHourOfDay = 0; - } - if (message.startHourOfDay != null && message.hasOwnProperty("startHourOfDay")) - object.startHourOfDay = message.startHourOfDay; - if (message.endHourOfDay != null && message.hasOwnProperty("endHourOfDay")) - object.endHourOfDay = message.endHourOfDay; - return object; - }; - - /** - * Converts this BackupWindow to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupWindow - * @instance - * @returns {Object.} JSON object - */ - BackupWindow.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupWindow - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupWindow - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupWindow.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupWindow"; - }; - - return BackupWindow; - })(); - - v1.WeekDayOfMonth = (function() { - - /** - * Properties of a WeekDayOfMonth. - * @memberof google.cloud.backupdr.v1 - * @interface IWeekDayOfMonth - * @property {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth|null} [weekOfMonth] WeekDayOfMonth weekOfMonth - * @property {google.type.DayOfWeek|null} [dayOfWeek] WeekDayOfMonth dayOfWeek - */ - - /** - * Constructs a new WeekDayOfMonth. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a WeekDayOfMonth. - * @implements IWeekDayOfMonth - * @constructor - * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set - */ - function WeekDayOfMonth(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * WeekDayOfMonth weekOfMonth. - * @member {google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth} weekOfMonth - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @instance - */ - WeekDayOfMonth.prototype.weekOfMonth = 0; - - /** - * WeekDayOfMonth dayOfWeek. - * @member {google.type.DayOfWeek} dayOfWeek - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @instance - */ - WeekDayOfMonth.prototype.dayOfWeek = 0; - - /** - * Creates a new WeekDayOfMonth instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {google.cloud.backupdr.v1.IWeekDayOfMonth=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth instance - */ - WeekDayOfMonth.create = function create(properties) { - return new WeekDayOfMonth(properties); - }; - - /** - * Encodes the specified WeekDayOfMonth message. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeekDayOfMonth.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.weekOfMonth != null && Object.hasOwnProperty.call(message, "weekOfMonth")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.weekOfMonth); - if (message.dayOfWeek != null && Object.hasOwnProperty.call(message, "dayOfWeek")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.dayOfWeek); - return writer; - }; - - /** - * Encodes the specified WeekDayOfMonth message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.WeekDayOfMonth.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {google.cloud.backupdr.v1.IWeekDayOfMonth} message WeekDayOfMonth message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - WeekDayOfMonth.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a WeekDayOfMonth message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeekDayOfMonth.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.weekOfMonth = reader.int32(); - break; - } - case 2: { - message.dayOfWeek = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a WeekDayOfMonth message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - WeekDayOfMonth.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a WeekDayOfMonth message. - * @function verify - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - WeekDayOfMonth.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) - switch (message.weekOfMonth) { - default: - return "weekOfMonth: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - break; - } - if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) - switch (message.dayOfWeek) { - default: - return "dayOfWeek: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - break; - } - return null; - }; - - /** - * Creates a WeekDayOfMonth message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.WeekDayOfMonth} WeekDayOfMonth - */ - WeekDayOfMonth.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.WeekDayOfMonth) - return object; - var message = new $root.google.cloud.backupdr.v1.WeekDayOfMonth(); - switch (object.weekOfMonth) { - default: - if (typeof object.weekOfMonth === "number") { - message.weekOfMonth = object.weekOfMonth; - break; - } - break; - case "WEEK_OF_MONTH_UNSPECIFIED": - case 0: - message.weekOfMonth = 0; - break; - case "FIRST": - case 1: - message.weekOfMonth = 1; - break; - case "SECOND": - case 2: - message.weekOfMonth = 2; - break; - case "THIRD": - case 3: - message.weekOfMonth = 3; - break; - case "FOURTH": - case 4: - message.weekOfMonth = 4; - break; - case "LAST": - case 5: - message.weekOfMonth = 5; - break; - } - switch (object.dayOfWeek) { - default: - if (typeof object.dayOfWeek === "number") { - message.dayOfWeek = object.dayOfWeek; - break; - } - break; - case "DAY_OF_WEEK_UNSPECIFIED": - case 0: - message.dayOfWeek = 0; - break; - case "MONDAY": - case 1: - message.dayOfWeek = 1; - break; - case "TUESDAY": - case 2: - message.dayOfWeek = 2; - break; - case "WEDNESDAY": - case 3: - message.dayOfWeek = 3; - break; - case "THURSDAY": - case 4: - message.dayOfWeek = 4; - break; - case "FRIDAY": - case 5: - message.dayOfWeek = 5; - break; - case "SATURDAY": - case 6: - message.dayOfWeek = 6; - break; - case "SUNDAY": - case 7: - message.dayOfWeek = 7; - break; - } - return message; - }; - - /** - * Creates a plain object from a WeekDayOfMonth message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {google.cloud.backupdr.v1.WeekDayOfMonth} message WeekDayOfMonth - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - WeekDayOfMonth.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.weekOfMonth = options.enums === String ? "WEEK_OF_MONTH_UNSPECIFIED" : 0; - object.dayOfWeek = options.enums === String ? "DAY_OF_WEEK_UNSPECIFIED" : 0; - } - if (message.weekOfMonth != null && message.hasOwnProperty("weekOfMonth")) - object.weekOfMonth = options.enums === String ? $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] === undefined ? message.weekOfMonth : $root.google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth[message.weekOfMonth] : message.weekOfMonth; - if (message.dayOfWeek != null && message.hasOwnProperty("dayOfWeek")) - object.dayOfWeek = options.enums === String ? $root.google.type.DayOfWeek[message.dayOfWeek] === undefined ? message.dayOfWeek : $root.google.type.DayOfWeek[message.dayOfWeek] : message.dayOfWeek; - return object; - }; - - /** - * Converts this WeekDayOfMonth to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @instance - * @returns {Object.} JSON object - */ - WeekDayOfMonth.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for WeekDayOfMonth - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.WeekDayOfMonth - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - WeekDayOfMonth.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.WeekDayOfMonth"; - }; - - /** - * WeekOfMonth enum. - * @name google.cloud.backupdr.v1.WeekDayOfMonth.WeekOfMonth - * @enum {number} - * @property {number} WEEK_OF_MONTH_UNSPECIFIED=0 WEEK_OF_MONTH_UNSPECIFIED value - * @property {number} FIRST=1 FIRST value - * @property {number} SECOND=2 SECOND value - * @property {number} THIRD=3 THIRD value - * @property {number} FOURTH=4 FOURTH value - * @property {number} LAST=5 LAST value - */ - WeekDayOfMonth.WeekOfMonth = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "WEEK_OF_MONTH_UNSPECIFIED"] = 0; - values[valuesById[1] = "FIRST"] = 1; - values[valuesById[2] = "SECOND"] = 2; - values[valuesById[3] = "THIRD"] = 3; - values[valuesById[4] = "FOURTH"] = 4; - values[valuesById[5] = "LAST"] = 5; - return values; - })(); - - return WeekDayOfMonth; - })(); - - v1.CreateBackupPlanRequest = (function() { - - /** - * Properties of a CreateBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @interface ICreateBackupPlanRequest - * @property {string|null} [parent] CreateBackupPlanRequest parent - * @property {string|null} [backupPlanId] CreateBackupPlanRequest backupPlanId - * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlan] CreateBackupPlanRequest backupPlan - * @property {string|null} [requestId] CreateBackupPlanRequest requestId - */ - - /** - * Constructs a new CreateBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CreateBackupPlanRequest. - * @implements ICreateBackupPlanRequest - * @constructor - * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set - */ - function CreateBackupPlanRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupPlanRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @instance - */ - CreateBackupPlanRequest.prototype.parent = ""; - - /** - * CreateBackupPlanRequest backupPlanId. - * @member {string} backupPlanId - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @instance - */ - CreateBackupPlanRequest.prototype.backupPlanId = ""; - - /** - * CreateBackupPlanRequest backupPlan. - * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlan - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @instance - */ - CreateBackupPlanRequest.prototype.backupPlan = null; - - /** - * CreateBackupPlanRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @instance - */ - CreateBackupPlanRequest.prototype.requestId = ""; - - /** - * Creates a new CreateBackupPlanRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest instance - */ - CreateBackupPlanRequest.create = function create(properties) { - return new CreateBackupPlanRequest(properties); - }; - - /** - * Encodes the specified CreateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupPlanRequest.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.backupPlanId != null && Object.hasOwnProperty.call(message, "backupPlanId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanId); - if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) - $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupPlanRequest} message CreateBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupPlanRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupPlanRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); - 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.backupPlanId = reader.string(); - break; - } - case 3: { - message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupPlanRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupPlanRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupPlanRequest.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.backupPlanId != null && message.hasOwnProperty("backupPlanId")) - if (!$util.isString(message.backupPlanId)) - return "backupPlanId: string expected"; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) { - var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlan); - if (error) - return "backupPlan." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CreateBackupPlanRequest} CreateBackupPlanRequest - */ - CreateBackupPlanRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupPlanId != null) - message.backupPlanId = String(object.backupPlanId); - if (object.backupPlan != null) { - if (typeof object.backupPlan !== "object") - throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanRequest.backupPlan: object expected"); - message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlan); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateBackupPlanRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.CreateBackupPlanRequest} message CreateBackupPlanRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupPlanRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupPlanId = ""; - object.backupPlan = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupPlanId != null && message.hasOwnProperty("backupPlanId")) - object.backupPlanId = message.backupPlanId; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - object.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlan, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateBackupPlanRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupPlanRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupPlanRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CreateBackupPlanRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanRequest"; - }; - - return CreateBackupPlanRequest; - })(); - - v1.ListBackupPlansRequest = (function() { - - /** - * Properties of a ListBackupPlansRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupPlansRequest - * @property {string|null} [parent] ListBackupPlansRequest parent - * @property {number|null} [pageSize] ListBackupPlansRequest pageSize - * @property {string|null} [pageToken] ListBackupPlansRequest pageToken - * @property {string|null} [filter] ListBackupPlansRequest filter - * @property {string|null} [orderBy] ListBackupPlansRequest orderBy - */ - - /** - * Constructs a new ListBackupPlansRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupPlansRequest. - * @implements IListBackupPlansRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set - */ - function ListBackupPlansRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupPlansRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @instance - */ - ListBackupPlansRequest.prototype.parent = ""; - - /** - * ListBackupPlansRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @instance - */ - ListBackupPlansRequest.prototype.pageSize = 0; - - /** - * ListBackupPlansRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @instance - */ - ListBackupPlansRequest.prototype.pageToken = ""; - - /** - * ListBackupPlansRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @instance - */ - ListBackupPlansRequest.prototype.filter = ""; - - /** - * ListBackupPlansRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @instance - */ - ListBackupPlansRequest.prototype.orderBy = ""; - - /** - * Creates a new ListBackupPlansRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlansRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest instance - */ - ListBackupPlansRequest.create = function create(properties) { - return new ListBackupPlansRequest(properties); - }; - - /** - * Encodes the specified ListBackupPlansRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlansRequest.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 ListBackupPlansRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlansRequest} message ListBackupPlansRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlansRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupPlansRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlansRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); - 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 ListBackupPlansRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlansRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupPlansRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupPlansRequest.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 ListBackupPlansRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupPlansRequest} ListBackupPlansRequest - */ - ListBackupPlansRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupPlansRequest(); - 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 ListBackupPlansRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {google.cloud.backupdr.v1.ListBackupPlansRequest} message ListBackupPlansRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupPlansRequest.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 ListBackupPlansRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupPlansRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupPlansRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupPlansRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupPlansRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansRequest"; - }; - - return ListBackupPlansRequest; - })(); - - v1.ListBackupPlansResponse = (function() { - - /** - * Properties of a ListBackupPlansResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupPlansResponse - * @property {Array.|null} [backupPlans] ListBackupPlansResponse backupPlans - * @property {string|null} [nextPageToken] ListBackupPlansResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupPlansResponse unreachable - */ - - /** - * Constructs a new ListBackupPlansResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupPlansResponse. - * @implements IListBackupPlansResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set - */ - function ListBackupPlansResponse(properties) { - this.backupPlans = []; - 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]]; - } - - /** - * ListBackupPlansResponse backupPlans. - * @member {Array.} backupPlans - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @instance - */ - ListBackupPlansResponse.prototype.backupPlans = $util.emptyArray; - - /** - * ListBackupPlansResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @instance - */ - ListBackupPlansResponse.prototype.nextPageToken = ""; - - /** - * ListBackupPlansResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @instance - */ - ListBackupPlansResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupPlansResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlansResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse instance - */ - ListBackupPlansResponse.create = function create(properties) { - return new ListBackupPlansResponse(properties); - }; - - /** - * Encodes the specified ListBackupPlansResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlansResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlans != null && message.backupPlans.length) - for (var i = 0; i < message.backupPlans.length; ++i) - $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlans[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 ListBackupPlansResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlansResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlansResponse} message ListBackupPlansResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlansResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupPlansResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlansResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupPlans && message.backupPlans.length)) - message.backupPlans = []; - message.backupPlans.push($root.google.cloud.backupdr.v1.BackupPlan.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 ListBackupPlansResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlansResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupPlansResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupPlansResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlans != null && message.hasOwnProperty("backupPlans")) { - if (!Array.isArray(message.backupPlans)) - return "backupPlans: array expected"; - for (var i = 0; i < message.backupPlans.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlans[i]); - if (error) - return "backupPlans." + 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 ListBackupPlansResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupPlansResponse} ListBackupPlansResponse - */ - ListBackupPlansResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlansResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupPlansResponse(); - if (object.backupPlans) { - if (!Array.isArray(object.backupPlans)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: array expected"); - message.backupPlans = []; - for (var i = 0; i < object.backupPlans.length; ++i) { - if (typeof object.backupPlans[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.backupPlans: object expected"); - message.backupPlans[i] = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlans[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlansResponse.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 ListBackupPlansResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {google.cloud.backupdr.v1.ListBackupPlansResponse} message ListBackupPlansResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupPlansResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backupPlans = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backupPlans && message.backupPlans.length) { - object.backupPlans = []; - for (var j = 0; j < message.backupPlans.length; ++j) - object.backupPlans[j] = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlans[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 ListBackupPlansResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupPlansResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupPlansResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupPlansResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupPlansResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlansResponse"; - }; - - return ListBackupPlansResponse; - })(); - - v1.GetBackupPlanRequest = (function() { - - /** - * Properties of a GetBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetBackupPlanRequest - * @property {string|null} [name] GetBackupPlanRequest name - */ - - /** - * Constructs a new GetBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetBackupPlanRequest. - * @implements IGetBackupPlanRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set - */ - function GetBackupPlanRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupPlanRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @instance - */ - GetBackupPlanRequest.prototype.name = ""; - - /** - * Creates a new GetBackupPlanRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest instance - */ - GetBackupPlanRequest.create = function create(properties) { - return new GetBackupPlanRequest(properties); - }; - - /** - * Encodes the specified GetBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupPlanRequest.encode = function encode(message, writer) { - 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 GetBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanRequest} message GetBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupPlanRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupPlanRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); - 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 GetBackupPlanRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupPlanRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupPlanRequest.verify = function verify(message) { - if (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 GetBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetBackupPlanRequest} GetBackupPlanRequest - */ - GetBackupPlanRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetBackupPlanRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupPlanRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.GetBackupPlanRequest} message GetBackupPlanRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupPlanRequest.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 GetBackupPlanRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupPlanRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupPlanRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetBackupPlanRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanRequest"; - }; - - return GetBackupPlanRequest; - })(); - - v1.DeleteBackupPlanRequest = (function() { - - /** - * Properties of a DeleteBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IDeleteBackupPlanRequest - * @property {string|null} [name] DeleteBackupPlanRequest name - * @property {string|null} [requestId] DeleteBackupPlanRequest requestId - */ - - /** - * Constructs a new DeleteBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DeleteBackupPlanRequest. - * @implements IDeleteBackupPlanRequest - * @constructor - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set - */ - function DeleteBackupPlanRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupPlanRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @instance - */ - DeleteBackupPlanRequest.prototype.name = ""; - - /** - * DeleteBackupPlanRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @instance - */ - DeleteBackupPlanRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteBackupPlanRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest instance - */ - DeleteBackupPlanRequest.create = function create(properties) { - return new DeleteBackupPlanRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupPlanRequest.encode = function encode(message, writer) { - if (!writer) - 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 DeleteBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanRequest} message DeleteBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupPlanRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupPlanRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); - 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 DeleteBackupPlanRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupPlanRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupPlanRequest.verify = function verify(message) { - if (typeof message !== "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 DeleteBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanRequest} DeleteBackupPlanRequest - */ - DeleteBackupPlanRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanRequest(); - 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 DeleteBackupPlanRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.DeleteBackupPlanRequest} message DeleteBackupPlanRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupPlanRequest.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 DeleteBackupPlanRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupPlanRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupPlanRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanRequest"; - }; - - return DeleteBackupPlanRequest; - })(); - - v1.UpdateBackupPlanRequest = (function() { - - /** - * Properties of an UpdateBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IUpdateBackupPlanRequest - * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlan] UpdateBackupPlanRequest backupPlan - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupPlanRequest updateMask - * @property {string|null} [requestId] UpdateBackupPlanRequest requestId - */ - - /** - * Constructs a new UpdateBackupPlanRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an UpdateBackupPlanRequest. - * @implements IUpdateBackupPlanRequest - * @constructor - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest=} [properties] Properties to set - */ - function UpdateBackupPlanRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupPlanRequest backupPlan. - * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlan - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @instance - */ - UpdateBackupPlanRequest.prototype.backupPlan = null; - - /** - * UpdateBackupPlanRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @instance - */ - UpdateBackupPlanRequest.prototype.updateMask = null; - - /** - * UpdateBackupPlanRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @instance - */ - UpdateBackupPlanRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateBackupPlanRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest instance - */ - UpdateBackupPlanRequest.create = function create(properties) { - return new UpdateBackupPlanRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupPlanRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} message UpdateBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupPlanRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) - $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlan, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateBackupPlanRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanRequest} message UpdateBackupPlanRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupPlanRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupPlanRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupPlanRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupPlanRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupPlanRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupPlanRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) { - var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlan); - if (error) - return "backupPlan." + 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 UpdateBackupPlanRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanRequest} UpdateBackupPlanRequest - */ - UpdateBackupPlanRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanRequest(); - if (object.backupPlan != null) { - if (typeof object.backupPlan !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanRequest.backupPlan: object expected"); - message.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlan); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanRequest.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 UpdateBackupPlanRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {google.cloud.backupdr.v1.UpdateBackupPlanRequest} message UpdateBackupPlanRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupPlanRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupPlan = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - object.backupPlan = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlan, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateBackupPlanRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupPlanRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupPlanRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupPlanRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupPlanRequest"; - }; - - return UpdateBackupPlanRequest; - })(); - - v1.BackupPlanRevision = (function() { - - /** - * Properties of a BackupPlanRevision. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupPlanRevision - * @property {string|null} [name] BackupPlanRevision name - * @property {string|null} [revisionId] BackupPlanRevision revisionId - * @property {google.cloud.backupdr.v1.BackupPlanRevision.State|null} [state] BackupPlanRevision state - * @property {google.cloud.backupdr.v1.IBackupPlan|null} [backupPlanSnapshot] BackupPlanRevision backupPlanSnapshot - * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlanRevision createTime - */ - - /** - * Constructs a new BackupPlanRevision. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupPlanRevision. - * @implements IBackupPlanRevision - * @constructor - * @param {google.cloud.backupdr.v1.IBackupPlanRevision=} [properties] Properties to set - */ - function BackupPlanRevision(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupPlanRevision name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @instance - */ - BackupPlanRevision.prototype.name = ""; - - /** - * BackupPlanRevision revisionId. - * @member {string} revisionId - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @instance - */ - BackupPlanRevision.prototype.revisionId = ""; - - /** - * BackupPlanRevision state. - * @member {google.cloud.backupdr.v1.BackupPlanRevision.State} state - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @instance - */ - BackupPlanRevision.prototype.state = 0; - - /** - * BackupPlanRevision backupPlanSnapshot. - * @member {google.cloud.backupdr.v1.IBackupPlan|null|undefined} backupPlanSnapshot - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @instance - */ - BackupPlanRevision.prototype.backupPlanSnapshot = null; - - /** - * BackupPlanRevision createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @instance - */ - BackupPlanRevision.prototype.createTime = null; - - /** - * Creates a new BackupPlanRevision instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {google.cloud.backupdr.v1.IBackupPlanRevision=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision instance - */ - BackupPlanRevision.create = function create(properties) { - return new BackupPlanRevision(properties); - }; - - /** - * Encodes the specified BackupPlanRevision message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {google.cloud.backupdr.v1.IBackupPlanRevision} message BackupPlanRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupPlanRevision.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.revisionId != null && Object.hasOwnProperty.call(message, "revisionId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.revisionId); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.state); - if (message.backupPlanSnapshot != null && Object.hasOwnProperty.call(message, "backupPlanSnapshot")) - $root.google.cloud.backupdr.v1.BackupPlan.encode(message.backupPlanSnapshot, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupPlanRevision message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanRevision.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {google.cloud.backupdr.v1.IBackupPlanRevision} message BackupPlanRevision message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupPlanRevision.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupPlanRevision message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupPlanRevision.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlanRevision(); - 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.revisionId = reader.string(); - break; - } - case 3: { - message.state = reader.int32(); - break; - } - case 4: { - message.backupPlanSnapshot = $root.google.cloud.backupdr.v1.BackupPlan.decode(reader, reader.uint32()); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupPlanRevision message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupPlanRevision.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupPlanRevision message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupPlanRevision.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - if (!$util.isString(message.revisionId)) - return "revisionId: string expected"; - if (message.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.backupPlanSnapshot != null && message.hasOwnProperty("backupPlanSnapshot")) { - var error = $root.google.cloud.backupdr.v1.BackupPlan.verify(message.backupPlanSnapshot); - if (error) - return "backupPlanSnapshot." + error; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - return null; - }; - - /** - * Creates a BackupPlanRevision message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupPlanRevision} BackupPlanRevision - */ - BackupPlanRevision.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupPlanRevision) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupPlanRevision(); - if (object.name != null) - message.name = String(object.name); - if (object.revisionId != null) - message.revisionId = String(object.revisionId); - 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 "DELETING": - case 3: - message.state = 3; - break; - case "INACTIVE": - case 4: - message.state = 4; - break; - } - if (object.backupPlanSnapshot != null) { - if (typeof object.backupPlanSnapshot !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlanRevision.backupPlanSnapshot: object expected"); - message.backupPlanSnapshot = $root.google.cloud.backupdr.v1.BackupPlan.fromObject(object.backupPlanSnapshot); - } - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlanRevision.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupPlanRevision message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {google.cloud.backupdr.v1.BackupPlanRevision} message BackupPlanRevision - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupPlanRevision.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.revisionId = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.backupPlanSnapshot = null; - object.createTime = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.revisionId != null && message.hasOwnProperty("revisionId")) - object.revisionId = message.revisionId; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlanRevision.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlanRevision.State[message.state] : message.state; - if (message.backupPlanSnapshot != null && message.hasOwnProperty("backupPlanSnapshot")) - object.backupPlanSnapshot = $root.google.cloud.backupdr.v1.BackupPlan.toObject(message.backupPlanSnapshot, options); - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - return object; - }; - - /** - * Converts this BackupPlanRevision to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @instance - * @returns {Object.} JSON object - */ - BackupPlanRevision.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupPlanRevision - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupPlanRevision - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupPlanRevision.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlanRevision"; - }; - - /** - * State enum. - * @name google.cloud.backupdr.v1.BackupPlanRevision.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} DELETING=3 DELETING value - * @property {number} INACTIVE=4 INACTIVE value - */ - BackupPlanRevision.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] = "DELETING"] = 3; - values[valuesById[4] = "INACTIVE"] = 4; - return values; - })(); - - return BackupPlanRevision; - })(); - - v1.GetBackupPlanRevisionRequest = (function() { - - /** - * Properties of a GetBackupPlanRevisionRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetBackupPlanRevisionRequest - * @property {string|null} [name] GetBackupPlanRevisionRequest name - */ - - /** - * Constructs a new GetBackupPlanRevisionRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetBackupPlanRevisionRequest. - * @implements IGetBackupPlanRevisionRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest=} [properties] Properties to set - */ - function GetBackupPlanRevisionRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupPlanRevisionRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @instance - */ - GetBackupPlanRevisionRequest.prototype.name = ""; - - /** - * Creates a new GetBackupPlanRevisionRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest instance - */ - GetBackupPlanRevisionRequest.create = function create(properties) { - return new GetBackupPlanRevisionRequest(properties); - }; - - /** - * Encodes the specified GetBackupPlanRevisionRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} message GetBackupPlanRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupPlanRevisionRequest.encode = function encode(message, writer) { - 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 GetBackupPlanRevisionRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanRevisionRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest} message GetBackupPlanRevisionRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupPlanRevisionRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupPlanRevisionRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupPlanRevisionRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest(); - 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 GetBackupPlanRevisionRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupPlanRevisionRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupPlanRevisionRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupPlanRevisionRequest.verify = function verify(message) { - if (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 GetBackupPlanRevisionRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} GetBackupPlanRevisionRequest - */ - GetBackupPlanRevisionRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupPlanRevisionRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {google.cloud.backupdr.v1.GetBackupPlanRevisionRequest} message GetBackupPlanRevisionRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupPlanRevisionRequest.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 GetBackupPlanRevisionRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupPlanRevisionRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupPlanRevisionRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetBackupPlanRevisionRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupPlanRevisionRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanRevisionRequest"; - }; - - return GetBackupPlanRevisionRequest; - })(); - - v1.ListBackupPlanRevisionsRequest = (function() { - - /** - * Properties of a ListBackupPlanRevisionsRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupPlanRevisionsRequest - * @property {string|null} [parent] ListBackupPlanRevisionsRequest parent - * @property {number|null} [pageSize] ListBackupPlanRevisionsRequest pageSize - * @property {string|null} [pageToken] ListBackupPlanRevisionsRequest pageToken - */ - - /** - * Constructs a new ListBackupPlanRevisionsRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupPlanRevisionsRequest. - * @implements IListBackupPlanRevisionsRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest=} [properties] Properties to set - */ - function ListBackupPlanRevisionsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupPlanRevisionsRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @instance - */ - ListBackupPlanRevisionsRequest.prototype.parent = ""; - - /** - * ListBackupPlanRevisionsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @instance - */ - ListBackupPlanRevisionsRequest.prototype.pageSize = 0; - - /** - * ListBackupPlanRevisionsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @instance - */ - ListBackupPlanRevisionsRequest.prototype.pageToken = ""; - - /** - * Creates a new ListBackupPlanRevisionsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest instance - */ - ListBackupPlanRevisionsRequest.create = function create(properties) { - return new ListBackupPlanRevisionsRequest(properties); - }; - - /** - * Encodes the specified ListBackupPlanRevisionsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} message ListBackupPlanRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanRevisionsRequest.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 ListBackupPlanRevisionsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest} message ListBackupPlanRevisionsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanRevisionsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupPlanRevisionsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanRevisionsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest(); - 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 ListBackupPlanRevisionsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanRevisionsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupPlanRevisionsRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupPlanRevisionsRequest.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 ListBackupPlanRevisionsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} ListBackupPlanRevisionsRequest - */ - ListBackupPlanRevisionsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest(); - 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 ListBackupPlanRevisionsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest} message ListBackupPlanRevisionsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupPlanRevisionsRequest.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 ListBackupPlanRevisionsRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupPlanRevisionsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupPlanRevisionsRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupPlanRevisionsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest"; - }; - - return ListBackupPlanRevisionsRequest; - })(); - - v1.ListBackupPlanRevisionsResponse = (function() { - - /** - * Properties of a ListBackupPlanRevisionsResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupPlanRevisionsResponse - * @property {Array.|null} [backupPlanRevisions] ListBackupPlanRevisionsResponse backupPlanRevisions - * @property {string|null} [nextPageToken] ListBackupPlanRevisionsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupPlanRevisionsResponse unreachable - */ - - /** - * Constructs a new ListBackupPlanRevisionsResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupPlanRevisionsResponse. - * @implements IListBackupPlanRevisionsResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse=} [properties] Properties to set - */ - function ListBackupPlanRevisionsResponse(properties) { - this.backupPlanRevisions = []; - 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]]; - } - - /** - * ListBackupPlanRevisionsResponse backupPlanRevisions. - * @member {Array.} backupPlanRevisions - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @instance - */ - ListBackupPlanRevisionsResponse.prototype.backupPlanRevisions = $util.emptyArray; - - /** - * ListBackupPlanRevisionsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @instance - */ - ListBackupPlanRevisionsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupPlanRevisionsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @instance - */ - ListBackupPlanRevisionsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupPlanRevisionsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse instance - */ - ListBackupPlanRevisionsResponse.create = function create(properties) { - return new ListBackupPlanRevisionsResponse(properties); - }; - - /** - * Encodes the specified ListBackupPlanRevisionsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse} message ListBackupPlanRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanRevisionsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlanRevisions != null && message.backupPlanRevisions.length) - for (var i = 0; i < message.backupPlanRevisions.length; ++i) - $root.google.cloud.backupdr.v1.BackupPlanRevision.encode(message.backupPlanRevisions[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 ListBackupPlanRevisionsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse} message ListBackupPlanRevisionsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanRevisionsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupPlanRevisionsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanRevisionsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupPlanRevisions && message.backupPlanRevisions.length)) - message.backupPlanRevisions = []; - message.backupPlanRevisions.push($root.google.cloud.backupdr.v1.BackupPlanRevision.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 ListBackupPlanRevisionsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanRevisionsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupPlanRevisionsResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupPlanRevisionsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlanRevisions != null && message.hasOwnProperty("backupPlanRevisions")) { - if (!Array.isArray(message.backupPlanRevisions)) - return "backupPlanRevisions: array expected"; - for (var i = 0; i < message.backupPlanRevisions.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupPlanRevision.verify(message.backupPlanRevisions[i]); - if (error) - return "backupPlanRevisions." + 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 ListBackupPlanRevisionsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} ListBackupPlanRevisionsResponse - */ - ListBackupPlanRevisionsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse(); - if (object.backupPlanRevisions) { - if (!Array.isArray(object.backupPlanRevisions)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.backupPlanRevisions: array expected"); - message.backupPlanRevisions = []; - for (var i = 0; i < object.backupPlanRevisions.length; ++i) { - if (typeof object.backupPlanRevisions[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.backupPlanRevisions: object expected"); - message.backupPlanRevisions[i] = $root.google.cloud.backupdr.v1.BackupPlanRevision.fromObject(object.backupPlanRevisions[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse.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 ListBackupPlanRevisionsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse} message ListBackupPlanRevisionsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupPlanRevisionsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backupPlanRevisions = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backupPlanRevisions && message.backupPlanRevisions.length) { - object.backupPlanRevisions = []; - for (var j = 0; j < message.backupPlanRevisions.length; ++j) - object.backupPlanRevisions[j] = $root.google.cloud.backupdr.v1.BackupPlanRevision.toObject(message.backupPlanRevisions[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 ListBackupPlanRevisionsResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupPlanRevisionsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupPlanRevisionsResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupPlanRevisionsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse"; - }; - - return ListBackupPlanRevisionsResponse; - })(); - - v1.BackupPlanAssociation = (function() { - - /** - * Properties of a BackupPlanAssociation. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupPlanAssociation - * @property {string|null} [name] BackupPlanAssociation name - * @property {string|null} [resourceType] BackupPlanAssociation resourceType - * @property {string|null} [resource] BackupPlanAssociation resource - * @property {string|null} [backupPlan] BackupPlanAssociation backupPlan - * @property {google.protobuf.ITimestamp|null} [createTime] BackupPlanAssociation createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] BackupPlanAssociation updateTime - * @property {google.cloud.backupdr.v1.BackupPlanAssociation.State|null} [state] BackupPlanAssociation state - * @property {Array.|null} [rulesConfigInfo] BackupPlanAssociation rulesConfigInfo - * @property {string|null} [dataSource] BackupPlanAssociation dataSource - * @property {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null} [cloudSqlInstanceBackupPlanAssociationProperties] BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties - * @property {string|null} [backupPlanRevisionId] BackupPlanAssociation backupPlanRevisionId - * @property {string|null} [backupPlanRevisionName] BackupPlanAssociation backupPlanRevisionName - */ - - /** - * Constructs a new BackupPlanAssociation. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupPlanAssociation. - * @implements IBackupPlanAssociation - * @constructor - * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set - */ - function BackupPlanAssociation(properties) { - this.rulesConfigInfo = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupPlanAssociation name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.name = ""; - - /** - * BackupPlanAssociation resourceType. - * @member {string} resourceType - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.resourceType = ""; - - /** - * BackupPlanAssociation resource. - * @member {string} resource - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.resource = ""; - - /** - * BackupPlanAssociation backupPlan. - * @member {string} backupPlan - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.backupPlan = ""; - - /** - * BackupPlanAssociation createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.createTime = null; - - /** - * BackupPlanAssociation updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.updateTime = null; - - /** - * BackupPlanAssociation state. - * @member {google.cloud.backupdr.v1.BackupPlanAssociation.State} state - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.state = 0; - - /** - * BackupPlanAssociation rulesConfigInfo. - * @member {Array.} rulesConfigInfo - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.rulesConfigInfo = $util.emptyArray; - - /** - * BackupPlanAssociation dataSource. - * @member {string} dataSource - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.dataSource = ""; - - /** - * BackupPlanAssociation cloudSqlInstanceBackupPlanAssociationProperties. - * @member {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties|null|undefined} cloudSqlInstanceBackupPlanAssociationProperties - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.cloudSqlInstanceBackupPlanAssociationProperties = null; - - /** - * BackupPlanAssociation backupPlanRevisionId. - * @member {string} backupPlanRevisionId - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.backupPlanRevisionId = ""; - - /** - * BackupPlanAssociation backupPlanRevisionName. - * @member {string} backupPlanRevisionName - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - BackupPlanAssociation.prototype.backupPlanRevisionName = ""; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupPlanAssociation resourceProperties. - * @member {"cloudSqlInstanceBackupPlanAssociationProperties"|undefined} resourceProperties - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - */ - Object.defineProperty(BackupPlanAssociation.prototype, "resourceProperties", { - get: $util.oneOfGetter($oneOfFields = ["cloudSqlInstanceBackupPlanAssociationProperties"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupPlanAssociation instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {google.cloud.backupdr.v1.IBackupPlanAssociation=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation instance - */ - BackupPlanAssociation.create = function create(properties) { - return new BackupPlanAssociation(properties); - }; - - /** - * Encodes the specified BackupPlanAssociation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupPlanAssociation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.resource != null && Object.hasOwnProperty.call(message, "resource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.resource); - if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlan); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.state); - if (message.rulesConfigInfo != null && message.rulesConfigInfo.length) - for (var i = 0; i < message.rulesConfigInfo.length; ++i) - $root.google.cloud.backupdr.v1.RuleConfigInfo.encode(message.rulesConfigInfo[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.dataSource); - if (message.cloudSqlInstanceBackupPlanAssociationProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceBackupPlanAssociationProperties")) - $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.encode(message.cloudSqlInstanceBackupPlanAssociationProperties, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.backupPlanRevisionId != null && Object.hasOwnProperty.call(message, "backupPlanRevisionId")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.backupPlanRevisionId); - if (message.backupPlanRevisionName != null && Object.hasOwnProperty.call(message, "backupPlanRevisionName")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.backupPlanRevisionName); - return writer; - }; - - /** - * Encodes the specified BackupPlanAssociation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupPlanAssociation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {google.cloud.backupdr.v1.IBackupPlanAssociation} message BackupPlanAssociation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupPlanAssociation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupPlanAssociation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupPlanAssociation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); - 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.resourceType = reader.string(); - break; - } - case 3: { - message.resource = reader.string(); - break; - } - case 4: { - message.backupPlan = reader.string(); - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.state = reader.int32(); - break; - } - case 8: { - if (!(message.rulesConfigInfo && message.rulesConfigInfo.length)) - message.rulesConfigInfo = []; - message.rulesConfigInfo.push($root.google.cloud.backupdr.v1.RuleConfigInfo.decode(reader, reader.uint32())); - break; - } - case 9: { - message.dataSource = reader.string(); - break; - } - case 10: { - message.cloudSqlInstanceBackupPlanAssociationProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.decode(reader, reader.uint32()); - break; - } - case 11: { - message.backupPlanRevisionId = reader.string(); - break; - } - case 12: { - message.backupPlanRevisionName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupPlanAssociation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupPlanAssociation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupPlanAssociation message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupPlanAssociation.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: string expected"; - if (message.resource != null && message.hasOwnProperty("resource")) - if (!$util.isString(message.resource)) - return "resource: string expected"; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - if (!$util.isString(message.backupPlan)) - return "backupPlan: string expected"; - if (message.createTime != null && message.hasOwnProperty("createTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - if (message.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.rulesConfigInfo != null && message.hasOwnProperty("rulesConfigInfo")) { - if (!Array.isArray(message.rulesConfigInfo)) - return "rulesConfigInfo: array expected"; - for (var i = 0; i < message.rulesConfigInfo.length; ++i) { - var error = $root.google.cloud.backupdr.v1.RuleConfigInfo.verify(message.rulesConfigInfo[i]); - if (error) - return "rulesConfigInfo." + error; - } - } - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - if (!$util.isString(message.dataSource)) - return "dataSource: string expected"; - if (message.cloudSqlInstanceBackupPlanAssociationProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupPlanAssociationProperties")) { - properties.resourceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify(message.cloudSqlInstanceBackupPlanAssociationProperties); - if (error) - return "cloudSqlInstanceBackupPlanAssociationProperties." + error; - } - } - if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) - if (!$util.isString(message.backupPlanRevisionId)) - return "backupPlanRevisionId: string expected"; - if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) - if (!$util.isString(message.backupPlanRevisionName)) - return "backupPlanRevisionName: string expected"; - return null; - }; - - /** - * Creates a BackupPlanAssociation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupPlanAssociation} BackupPlanAssociation - */ - BackupPlanAssociation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupPlanAssociation) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupPlanAssociation(); - if (object.name != null) - message.name = String(object.name); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - if (object.resource != null) - message.resource = String(object.resource); - if (object.backupPlan != null) - message.backupPlan = String(object.backupPlan); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.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.backupdr.v1.BackupPlanAssociation.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - 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 "DELETING": - case 3: - message.state = 3; - break; - case "INACTIVE": - case 4: - message.state = 4; - break; - case "UPDATING": - case 5: - message.state = 5; - break; - } - if (object.rulesConfigInfo) { - if (!Array.isArray(object.rulesConfigInfo)) - throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: array expected"); - message.rulesConfigInfo = []; - for (var i = 0; i < object.rulesConfigInfo.length; ++i) { - if (typeof object.rulesConfigInfo[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.rulesConfigInfo: object expected"); - message.rulesConfigInfo[i] = $root.google.cloud.backupdr.v1.RuleConfigInfo.fromObject(object.rulesConfigInfo[i]); - } - } - if (object.dataSource != null) - message.dataSource = String(object.dataSource); - if (object.cloudSqlInstanceBackupPlanAssociationProperties != null) { - if (typeof object.cloudSqlInstanceBackupPlanAssociationProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupPlanAssociation.cloudSqlInstanceBackupPlanAssociationProperties: object expected"); - message.cloudSqlInstanceBackupPlanAssociationProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.fromObject(object.cloudSqlInstanceBackupPlanAssociationProperties); - } - if (object.backupPlanRevisionId != null) - message.backupPlanRevisionId = String(object.backupPlanRevisionId); - if (object.backupPlanRevisionName != null) - message.backupPlanRevisionName = String(object.backupPlanRevisionName); - return message; - }; - - /** - * Creates a plain object from a BackupPlanAssociation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {google.cloud.backupdr.v1.BackupPlanAssociation} message BackupPlanAssociation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupPlanAssociation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rulesConfigInfo = []; - if (options.defaults) { - object.name = ""; - object.resourceType = ""; - object.resource = ""; - object.backupPlan = ""; - object.createTime = null; - object.updateTime = null; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.dataSource = ""; - object.backupPlanRevisionId = ""; - object.backupPlanRevisionName = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - if (message.resource != null && message.hasOwnProperty("resource")) - object.resource = message.resource; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - object.backupPlan = message.backupPlan; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.updateTime != null && message.hasOwnProperty("updateTime")) - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupPlanAssociation.State[message.state] : message.state; - if (message.rulesConfigInfo && message.rulesConfigInfo.length) { - object.rulesConfigInfo = []; - for (var j = 0; j < message.rulesConfigInfo.length; ++j) - object.rulesConfigInfo[j] = $root.google.cloud.backupdr.v1.RuleConfigInfo.toObject(message.rulesConfigInfo[j], options); - } - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - object.dataSource = message.dataSource; - if (message.cloudSqlInstanceBackupPlanAssociationProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupPlanAssociationProperties")) { - object.cloudSqlInstanceBackupPlanAssociationProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.toObject(message.cloudSqlInstanceBackupPlanAssociationProperties, options); - if (options.oneofs) - object.resourceProperties = "cloudSqlInstanceBackupPlanAssociationProperties"; - } - if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) - object.backupPlanRevisionId = message.backupPlanRevisionId; - if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) - object.backupPlanRevisionName = message.backupPlanRevisionName; - return object; - }; - - /** - * Converts this BackupPlanAssociation to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @instance - * @returns {Object.} JSON object - */ - BackupPlanAssociation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupPlanAssociation - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupPlanAssociation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupPlanAssociation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupPlanAssociation"; - }; - - /** - * State enum. - * @name google.cloud.backupdr.v1.BackupPlanAssociation.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} DELETING=3 DELETING value - * @property {number} INACTIVE=4 INACTIVE value - * @property {number} UPDATING=5 UPDATING value - */ - BackupPlanAssociation.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] = "DELETING"] = 3; - values[valuesById[4] = "INACTIVE"] = 4; - values[valuesById[5] = "UPDATING"] = 5; - return values; - })(); - - return BackupPlanAssociation; - })(); - - v1.RuleConfigInfo = (function() { - - /** - * Properties of a RuleConfigInfo. - * @memberof google.cloud.backupdr.v1 - * @interface IRuleConfigInfo - * @property {string|null} [ruleId] RuleConfigInfo ruleId - * @property {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState|null} [lastBackupState] RuleConfigInfo lastBackupState - * @property {google.rpc.IStatus|null} [lastBackupError] RuleConfigInfo lastBackupError - * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] RuleConfigInfo lastSuccessfulBackupConsistencyTime - */ - - /** - * Constructs a new RuleConfigInfo. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a RuleConfigInfo. - * @implements IRuleConfigInfo - * @constructor - * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set - */ - function RuleConfigInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RuleConfigInfo ruleId. - * @member {string} ruleId - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @instance - */ - RuleConfigInfo.prototype.ruleId = ""; - - /** - * RuleConfigInfo lastBackupState. - * @member {google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState} lastBackupState - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @instance - */ - RuleConfigInfo.prototype.lastBackupState = 0; - - /** - * RuleConfigInfo lastBackupError. - * @member {google.rpc.IStatus|null|undefined} lastBackupError - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @instance - */ - RuleConfigInfo.prototype.lastBackupError = null; - - /** - * RuleConfigInfo lastSuccessfulBackupConsistencyTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @instance - */ - RuleConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; - - /** - * Creates a new RuleConfigInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IRuleConfigInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo instance - */ - RuleConfigInfo.create = function create(properties) { - return new RuleConfigInfo(properties); - }; - - /** - * Encodes the specified RuleConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleConfigInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); - if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.lastBackupState); - if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) - $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) - $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RuleConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RuleConfigInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IRuleConfigInfo} message RuleConfigInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RuleConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RuleConfigInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleConfigInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ruleId = reader.string(); - break; - } - case 3: { - message.lastBackupState = reader.int32(); - break; - } - case 4: { - message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 5: { - message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RuleConfigInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RuleConfigInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RuleConfigInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RuleConfigInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - if (!$util.isString(message.ruleId)) - return "ruleId: string expected"; - if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) - switch (message.lastBackupState) { - default: - return "lastBackupState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { - var error = $root.google.rpc.Status.verify(message.lastBackupError); - if (error) - return "lastBackupError." + error; - } - if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); - if (error) - return "lastSuccessfulBackupConsistencyTime." + error; - } - return null; - }; - - /** - * Creates a RuleConfigInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.RuleConfigInfo} RuleConfigInfo - */ - RuleConfigInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.RuleConfigInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.RuleConfigInfo(); - if (object.ruleId != null) - message.ruleId = String(object.ruleId); - switch (object.lastBackupState) { - default: - if (typeof object.lastBackupState === "number") { - message.lastBackupState = object.lastBackupState; - break; - } - break; - case "LAST_BACKUP_STATE_UNSPECIFIED": - case 0: - message.lastBackupState = 0; - break; - case "FIRST_BACKUP_PENDING": - case 1: - message.lastBackupState = 1; - break; - case "PERMISSION_DENIED": - case 2: - message.lastBackupState = 2; - break; - case "SUCCEEDED": - case 3: - message.lastBackupState = 3; - break; - case "FAILED": - case 4: - message.lastBackupState = 4; - break; - } - if (object.lastBackupError != null) { - if (typeof object.lastBackupError !== "object") - throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastBackupError: object expected"); - message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); - } - if (object.lastSuccessfulBackupConsistencyTime != null) { - if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.RuleConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); - message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); - } - return message; - }; - - /** - * Creates a plain object from a RuleConfigInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {google.cloud.backupdr.v1.RuleConfigInfo} message RuleConfigInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RuleConfigInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ruleId = ""; - object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; - object.lastBackupError = null; - object.lastSuccessfulBackupConsistencyTime = null; - } - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - object.ruleId = message.ruleId; - if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) - object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; - if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) - object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); - if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) - object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); - return object; - }; - - /** - * Converts this RuleConfigInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @instance - * @returns {Object.} JSON object - */ - RuleConfigInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RuleConfigInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.RuleConfigInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RuleConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.RuleConfigInfo"; - }; - - /** - * LastBackupState enum. - * @name google.cloud.backupdr.v1.RuleConfigInfo.LastBackupState - * @enum {number} - * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value - * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value - * @property {number} PERMISSION_DENIED=2 PERMISSION_DENIED value - * @property {number} SUCCEEDED=3 SUCCEEDED value - * @property {number} FAILED=4 FAILED value - */ - RuleConfigInfo.LastBackupState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; - values[valuesById[2] = "PERMISSION_DENIED"] = 2; - values[valuesById[3] = "SUCCEEDED"] = 3; - values[valuesById[4] = "FAILED"] = 4; - return values; - })(); - - return RuleConfigInfo; - })(); - - v1.CreateBackupPlanAssociationRequest = (function() { - - /** - * Properties of a CreateBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @interface ICreateBackupPlanAssociationRequest - * @property {string|null} [parent] CreateBackupPlanAssociationRequest parent - * @property {string|null} [backupPlanAssociationId] CreateBackupPlanAssociationRequest backupPlanAssociationId - * @property {google.cloud.backupdr.v1.IBackupPlanAssociation|null} [backupPlanAssociation] CreateBackupPlanAssociationRequest backupPlanAssociation - * @property {string|null} [requestId] CreateBackupPlanAssociationRequest requestId - */ - - /** - * Constructs a new CreateBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CreateBackupPlanAssociationRequest. - * @implements ICreateBackupPlanAssociationRequest - * @constructor - * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set - */ - function CreateBackupPlanAssociationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupPlanAssociationRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @instance - */ - CreateBackupPlanAssociationRequest.prototype.parent = ""; - - /** - * CreateBackupPlanAssociationRequest backupPlanAssociationId. - * @member {string} backupPlanAssociationId - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @instance - */ - CreateBackupPlanAssociationRequest.prototype.backupPlanAssociationId = ""; - - /** - * CreateBackupPlanAssociationRequest backupPlanAssociation. - * @member {google.cloud.backupdr.v1.IBackupPlanAssociation|null|undefined} backupPlanAssociation - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @instance - */ - CreateBackupPlanAssociationRequest.prototype.backupPlanAssociation = null; - - /** - * CreateBackupPlanAssociationRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @instance - */ - CreateBackupPlanAssociationRequest.prototype.requestId = ""; - - /** - * Creates a new CreateBackupPlanAssociationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest instance - */ - CreateBackupPlanAssociationRequest.create = function create(properties) { - return new CreateBackupPlanAssociationRequest(properties); - }; - - /** - * Encodes the specified CreateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupPlanAssociationRequest.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.backupPlanAssociationId != null && Object.hasOwnProperty.call(message, "backupPlanAssociationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanAssociationId); - if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) - $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociation, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified CreateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupPlanAssociationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); - 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.backupPlanAssociationId = reader.string(); - break; - } - case 3: { - message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupPlanAssociationRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupPlanAssociationRequest.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.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) - if (!$util.isString(message.backupPlanAssociationId)) - return "backupPlanAssociationId: string expected"; - if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) { - var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociation); - if (error) - return "backupPlanAssociation." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a CreateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} CreateBackupPlanAssociationRequest - */ - CreateBackupPlanAssociationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupPlanAssociationId != null) - message.backupPlanAssociationId = String(object.backupPlanAssociationId); - if (object.backupPlanAssociation != null) { - if (typeof object.backupPlanAssociation !== "object") - throw TypeError(".google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest.backupPlanAssociation: object expected"); - message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociation); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a CreateBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest} message CreateBackupPlanAssociationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupPlanAssociationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupPlanAssociationId = ""; - object.backupPlanAssociation = null; - object.requestId = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupPlanAssociationId != null && message.hasOwnProperty("backupPlanAssociationId")) - object.backupPlanAssociationId = message.backupPlanAssociationId; - if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) - object.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociation, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this CreateBackupPlanAssociationRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupPlanAssociationRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest"; - }; - - return CreateBackupPlanAssociationRequest; - })(); - - v1.ListBackupPlanAssociationsRequest = (function() { - - /** - * Properties of a ListBackupPlanAssociationsRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupPlanAssociationsRequest - * @property {string|null} [parent] ListBackupPlanAssociationsRequest parent - * @property {number|null} [pageSize] ListBackupPlanAssociationsRequest pageSize - * @property {string|null} [pageToken] ListBackupPlanAssociationsRequest pageToken - * @property {string|null} [filter] ListBackupPlanAssociationsRequest filter - */ - - /** - * Constructs a new ListBackupPlanAssociationsRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupPlanAssociationsRequest. - * @implements IListBackupPlanAssociationsRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set - */ - function ListBackupPlanAssociationsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupPlanAssociationsRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @instance - */ - ListBackupPlanAssociationsRequest.prototype.parent = ""; - - /** - * ListBackupPlanAssociationsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @instance - */ - ListBackupPlanAssociationsRequest.prototype.pageSize = 0; - - /** - * ListBackupPlanAssociationsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @instance - */ - ListBackupPlanAssociationsRequest.prototype.pageToken = ""; - - /** - * ListBackupPlanAssociationsRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @instance - */ - ListBackupPlanAssociationsRequest.prototype.filter = ""; - - /** - * Creates a new ListBackupPlanAssociationsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest instance - */ - ListBackupPlanAssociationsRequest.create = function create(properties) { - return new ListBackupPlanAssociationsRequest(properties); - }; - - /** - * Encodes the specified ListBackupPlanAssociationsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanAssociationsRequest.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 ListBackupPlanAssociationsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanAssociationsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupPlanAssociationsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanAssociationsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); - 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 ListBackupPlanAssociationsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanAssociationsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupPlanAssociationsRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupPlanAssociationsRequest.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 ListBackupPlanAssociationsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} ListBackupPlanAssociationsRequest - */ - ListBackupPlanAssociationsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest(); - 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 ListBackupPlanAssociationsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest} message ListBackupPlanAssociationsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupPlanAssociationsRequest.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 ListBackupPlanAssociationsRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupPlanAssociationsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupPlanAssociationsRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupPlanAssociationsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest"; - }; - - return ListBackupPlanAssociationsRequest; - })(); - - v1.ListBackupPlanAssociationsResponse = (function() { - - /** - * Properties of a ListBackupPlanAssociationsResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupPlanAssociationsResponse - * @property {Array.|null} [backupPlanAssociations] ListBackupPlanAssociationsResponse backupPlanAssociations - * @property {string|null} [nextPageToken] ListBackupPlanAssociationsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupPlanAssociationsResponse unreachable - */ - - /** - * Constructs a new ListBackupPlanAssociationsResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupPlanAssociationsResponse. - * @implements IListBackupPlanAssociationsResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set - */ - function ListBackupPlanAssociationsResponse(properties) { - this.backupPlanAssociations = []; - 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]]; - } - - /** - * ListBackupPlanAssociationsResponse backupPlanAssociations. - * @member {Array.} backupPlanAssociations - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @instance - */ - ListBackupPlanAssociationsResponse.prototype.backupPlanAssociations = $util.emptyArray; - - /** - * ListBackupPlanAssociationsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @instance - */ - ListBackupPlanAssociationsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupPlanAssociationsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @instance - */ - ListBackupPlanAssociationsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupPlanAssociationsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse instance - */ - ListBackupPlanAssociationsResponse.create = function create(properties) { - return new ListBackupPlanAssociationsResponse(properties); - }; - - /** - * Encodes the specified ListBackupPlanAssociationsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanAssociationsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlanAssociations != null && message.backupPlanAssociations.length) - for (var i = 0; i < message.backupPlanAssociations.length; ++i) - $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociations[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 ListBackupPlanAssociationsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupPlanAssociationsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupPlanAssociationsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanAssociationsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupPlanAssociations && message.backupPlanAssociations.length)) - message.backupPlanAssociations = []; - message.backupPlanAssociations.push($root.google.cloud.backupdr.v1.BackupPlanAssociation.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 ListBackupPlanAssociationsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupPlanAssociationsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupPlanAssociationsResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupPlanAssociationsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlanAssociations != null && message.hasOwnProperty("backupPlanAssociations")) { - if (!Array.isArray(message.backupPlanAssociations)) - return "backupPlanAssociations: array expected"; - for (var i = 0; i < message.backupPlanAssociations.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociations[i]); - if (error) - return "backupPlanAssociations." + 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 ListBackupPlanAssociationsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} ListBackupPlanAssociationsResponse - */ - ListBackupPlanAssociationsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse(); - if (object.backupPlanAssociations) { - if (!Array.isArray(object.backupPlanAssociations)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: array expected"); - message.backupPlanAssociations = []; - for (var i = 0; i < object.backupPlanAssociations.length; ++i) { - if (typeof object.backupPlanAssociations[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.backupPlanAssociations: object expected"); - message.backupPlanAssociations[i] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse.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 ListBackupPlanAssociationsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse} message ListBackupPlanAssociationsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupPlanAssociationsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backupPlanAssociations = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backupPlanAssociations && message.backupPlanAssociations.length) { - object.backupPlanAssociations = []; - for (var j = 0; j < message.backupPlanAssociations.length; ++j) - object.backupPlanAssociations[j] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociations[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 ListBackupPlanAssociationsResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupPlanAssociationsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupPlanAssociationsResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupPlanAssociationsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupPlanAssociationsResponse"; - }; - - return ListBackupPlanAssociationsResponse; - })(); - - v1.FetchBackupPlanAssociationsForResourceTypeRequest = (function() { - - /** - * Properties of a FetchBackupPlanAssociationsForResourceTypeRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchBackupPlanAssociationsForResourceTypeRequest - * @property {string|null} [parent] FetchBackupPlanAssociationsForResourceTypeRequest parent - * @property {string|null} [resourceType] FetchBackupPlanAssociationsForResourceTypeRequest resourceType - * @property {number|null} [pageSize] FetchBackupPlanAssociationsForResourceTypeRequest pageSize - * @property {string|null} [pageToken] FetchBackupPlanAssociationsForResourceTypeRequest pageToken - * @property {string|null} [filter] FetchBackupPlanAssociationsForResourceTypeRequest filter - * @property {string|null} [orderBy] FetchBackupPlanAssociationsForResourceTypeRequest orderBy - */ - - /** - * Constructs a new FetchBackupPlanAssociationsForResourceTypeRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchBackupPlanAssociationsForResourceTypeRequest. - * @implements IFetchBackupPlanAssociationsForResourceTypeRequest - * @constructor - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest=} [properties] Properties to set - */ - function FetchBackupPlanAssociationsForResourceTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchBackupPlanAssociationsForResourceTypeRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.parent = ""; - - /** - * FetchBackupPlanAssociationsForResourceTypeRequest resourceType. - * @member {string} resourceType - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.resourceType = ""; - - /** - * FetchBackupPlanAssociationsForResourceTypeRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.pageSize = 0; - - /** - * FetchBackupPlanAssociationsForResourceTypeRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.pageToken = ""; - - /** - * FetchBackupPlanAssociationsForResourceTypeRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.filter = ""; - - /** - * FetchBackupPlanAssociationsForResourceTypeRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.orderBy = ""; - - /** - * Creates a new FetchBackupPlanAssociationsForResourceTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest instance - */ - FetchBackupPlanAssociationsForResourceTypeRequest.create = function create(properties) { - return new FetchBackupPlanAssociationsForResourceTypeRequest(properties); - }; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupPlanAssociationsForResourceTypeRequest.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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest} message FetchBackupPlanAssociationsForResourceTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupPlanAssociationsForResourceTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupPlanAssociationsForResourceTypeRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest(); - 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.resourceType = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.filter = reader.string(); - break; - } - case 6: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupPlanAssociationsForResourceTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchBackupPlanAssociationsForResourceTypeRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchBackupPlanAssociationsForResourceTypeRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: 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 FetchBackupPlanAssociationsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} FetchBackupPlanAssociationsForResourceTypeRequest - */ - FetchBackupPlanAssociationsForResourceTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - 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 FetchBackupPlanAssociationsForResourceTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest} message FetchBackupPlanAssociationsForResourceTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchBackupPlanAssociationsForResourceTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceType = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - 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 FetchBackupPlanAssociationsForResourceTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @instance - * @returns {Object.} JSON object - */ - FetchBackupPlanAssociationsForResourceTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchBackupPlanAssociationsForResourceTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest"; - }; - - return FetchBackupPlanAssociationsForResourceTypeRequest; - })(); - - v1.FetchBackupPlanAssociationsForResourceTypeResponse = (function() { - - /** - * Properties of a FetchBackupPlanAssociationsForResourceTypeResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchBackupPlanAssociationsForResourceTypeResponse - * @property {Array.|null} [backupPlanAssociations] FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations - * @property {string|null} [nextPageToken] FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken - */ - - /** - * Constructs a new FetchBackupPlanAssociationsForResourceTypeResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchBackupPlanAssociationsForResourceTypeResponse. - * @implements IFetchBackupPlanAssociationsForResourceTypeResponse - * @constructor - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse=} [properties] Properties to set - */ - function FetchBackupPlanAssociationsForResourceTypeResponse(properties) { - this.backupPlanAssociations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchBackupPlanAssociationsForResourceTypeResponse backupPlanAssociations. - * @member {Array.} backupPlanAssociations - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeResponse.prototype.backupPlanAssociations = $util.emptyArray; - - /** - * FetchBackupPlanAssociationsForResourceTypeResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @instance - */ - FetchBackupPlanAssociationsForResourceTypeResponse.prototype.nextPageToken = ""; - - /** - * Creates a new FetchBackupPlanAssociationsForResourceTypeResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse instance - */ - FetchBackupPlanAssociationsForResourceTypeResponse.create = function create(properties) { - return new FetchBackupPlanAssociationsForResourceTypeResponse(properties); - }; - - /** - * Encodes the specified FetchBackupPlanAssociationsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse} message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupPlanAssociationsForResourceTypeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlanAssociations != null && message.backupPlanAssociations.length) - for (var i = 0; i < message.backupPlanAssociations.length; ++i) - $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociations[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 FetchBackupPlanAssociationsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse} message FetchBackupPlanAssociationsForResourceTypeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupPlanAssociationsForResourceTypeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupPlanAssociationsForResourceTypeResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupPlanAssociations && message.backupPlanAssociations.length)) - message.backupPlanAssociations = []; - message.backupPlanAssociations.push($root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchBackupPlanAssociationsForResourceTypeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupPlanAssociationsForResourceTypeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchBackupPlanAssociationsForResourceTypeResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchBackupPlanAssociationsForResourceTypeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlanAssociations != null && message.hasOwnProperty("backupPlanAssociations")) { - if (!Array.isArray(message.backupPlanAssociations)) - return "backupPlanAssociations: array expected"; - for (var i = 0; i < message.backupPlanAssociations.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociations[i]); - if (error) - return "backupPlanAssociations." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a FetchBackupPlanAssociationsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} FetchBackupPlanAssociationsForResourceTypeResponse - */ - FetchBackupPlanAssociationsForResourceTypeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse(); - if (object.backupPlanAssociations) { - if (!Array.isArray(object.backupPlanAssociations)) - throw TypeError(".google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.backupPlanAssociations: array expected"); - message.backupPlanAssociations = []; - for (var i = 0; i < object.backupPlanAssociations.length; ++i) { - if (typeof object.backupPlanAssociations[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse.backupPlanAssociations: object expected"); - message.backupPlanAssociations[i] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociations[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a FetchBackupPlanAssociationsForResourceTypeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse} message FetchBackupPlanAssociationsForResourceTypeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchBackupPlanAssociationsForResourceTypeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupPlanAssociations = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.backupPlanAssociations && message.backupPlanAssociations.length) { - object.backupPlanAssociations = []; - for (var j = 0; j < message.backupPlanAssociations.length; ++j) - object.backupPlanAssociations[j] = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociations[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this FetchBackupPlanAssociationsForResourceTypeResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @instance - * @returns {Object.} JSON object - */ - FetchBackupPlanAssociationsForResourceTypeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchBackupPlanAssociationsForResourceTypeResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchBackupPlanAssociationsForResourceTypeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse"; - }; - - return FetchBackupPlanAssociationsForResourceTypeResponse; - })(); - - v1.GetBackupPlanAssociationRequest = (function() { - - /** - * Properties of a GetBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetBackupPlanAssociationRequest - * @property {string|null} [name] GetBackupPlanAssociationRequest name - */ - - /** - * Constructs a new GetBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetBackupPlanAssociationRequest. - * @implements IGetBackupPlanAssociationRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set - */ - function GetBackupPlanAssociationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupPlanAssociationRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @instance - */ - GetBackupPlanAssociationRequest.prototype.name = ""; - - /** - * Creates a new GetBackupPlanAssociationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest instance - */ - GetBackupPlanAssociationRequest.create = function create(properties) { - return new GetBackupPlanAssociationRequest(properties); - }; - - /** - * Encodes the specified GetBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupPlanAssociationRequest.encode = function encode(message, writer) { - 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 GetBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupPlanAssociationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupPlanAssociationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupPlanAssociationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); - 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 GetBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupPlanAssociationRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupPlanAssociationRequest.verify = function verify(message) { - if (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 GetBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} GetBackupPlanAssociationRequest - */ - GetBackupPlanAssociationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.GetBackupPlanAssociationRequest} message GetBackupPlanAssociationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupPlanAssociationRequest.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 GetBackupPlanAssociationRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupPlanAssociationRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetBackupPlanAssociationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupPlanAssociationRequest"; - }; - - return GetBackupPlanAssociationRequest; - })(); - - v1.DeleteBackupPlanAssociationRequest = (function() { - - /** - * Properties of a DeleteBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IDeleteBackupPlanAssociationRequest - * @property {string|null} [name] DeleteBackupPlanAssociationRequest name - * @property {string|null} [requestId] DeleteBackupPlanAssociationRequest requestId - */ - - /** - * Constructs a new DeleteBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DeleteBackupPlanAssociationRequest. - * @implements IDeleteBackupPlanAssociationRequest - * @constructor - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set - */ - function DeleteBackupPlanAssociationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupPlanAssociationRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @instance - */ - DeleteBackupPlanAssociationRequest.prototype.name = ""; - - /** - * DeleteBackupPlanAssociationRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @instance - */ - DeleteBackupPlanAssociationRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteBackupPlanAssociationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest instance - */ - DeleteBackupPlanAssociationRequest.create = function create(properties) { - return new DeleteBackupPlanAssociationRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupPlanAssociationRequest.encode = function encode(message, writer) { - if (!writer) - 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 DeleteBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupPlanAssociationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupPlanAssociationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); - 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 DeleteBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupPlanAssociationRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupPlanAssociationRequest.verify = function verify(message) { - if (typeof message !== "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 DeleteBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} DeleteBackupPlanAssociationRequest - */ - DeleteBackupPlanAssociationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest(); - 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 DeleteBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest} message DeleteBackupPlanAssociationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupPlanAssociationRequest.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 DeleteBackupPlanAssociationRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupPlanAssociationRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest"; - }; - - return DeleteBackupPlanAssociationRequest; - })(); - - v1.UpdateBackupPlanAssociationRequest = (function() { - - /** - * Properties of an UpdateBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IUpdateBackupPlanAssociationRequest - * @property {google.cloud.backupdr.v1.IBackupPlanAssociation|null} [backupPlanAssociation] UpdateBackupPlanAssociationRequest backupPlanAssociation - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupPlanAssociationRequest updateMask - * @property {string|null} [requestId] UpdateBackupPlanAssociationRequest requestId - */ - - /** - * Constructs a new UpdateBackupPlanAssociationRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an UpdateBackupPlanAssociationRequest. - * @implements IUpdateBackupPlanAssociationRequest - * @constructor - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest=} [properties] Properties to set - */ - function UpdateBackupPlanAssociationRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupPlanAssociationRequest backupPlanAssociation. - * @member {google.cloud.backupdr.v1.IBackupPlanAssociation|null|undefined} backupPlanAssociation - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @instance - */ - UpdateBackupPlanAssociationRequest.prototype.backupPlanAssociation = null; - - /** - * UpdateBackupPlanAssociationRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @instance - */ - UpdateBackupPlanAssociationRequest.prototype.updateMask = null; - - /** - * UpdateBackupPlanAssociationRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @instance - */ - UpdateBackupPlanAssociationRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateBackupPlanAssociationRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest instance - */ - UpdateBackupPlanAssociationRequest.create = function create(properties) { - return new UpdateBackupPlanAssociationRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupPlanAssociationRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} message UpdateBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupPlanAssociationRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) - $root.google.cloud.backupdr.v1.BackupPlanAssociation.encode(message.backupPlanAssociation, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified UpdateBackupPlanAssociationRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest} message UpdateBackupPlanAssociationRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupPlanAssociationRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupPlanAssociationRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.decode(reader, reader.uint32()); - break; - } - case 2: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupPlanAssociationRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupPlanAssociationRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupPlanAssociationRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupPlanAssociationRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) { - var error = $root.google.cloud.backupdr.v1.BackupPlanAssociation.verify(message.backupPlanAssociation); - if (error) - return "backupPlanAssociation." + 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 UpdateBackupPlanAssociationRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} UpdateBackupPlanAssociationRequest - */ - UpdateBackupPlanAssociationRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest(); - if (object.backupPlanAssociation != null) { - if (typeof object.backupPlanAssociation !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.backupPlanAssociation: object expected"); - message.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.fromObject(object.backupPlanAssociation); - } - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest.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 UpdateBackupPlanAssociationRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest} message UpdateBackupPlanAssociationRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupPlanAssociationRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupPlanAssociation = null; - object.updateMask = null; - object.requestId = ""; - } - if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) - object.backupPlanAssociation = $root.google.cloud.backupdr.v1.BackupPlanAssociation.toObject(message.backupPlanAssociation, options); - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateBackupPlanAssociationRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupPlanAssociationRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupPlanAssociationRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupPlanAssociationRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest"; - }; - - return UpdateBackupPlanAssociationRequest; - })(); - - v1.TriggerBackupRequest = (function() { - - /** - * Properties of a TriggerBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @interface ITriggerBackupRequest - * @property {string|null} [name] TriggerBackupRequest name - * @property {string|null} [ruleId] TriggerBackupRequest ruleId - * @property {string|null} [requestId] TriggerBackupRequest requestId - */ - - /** - * Constructs a new TriggerBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a TriggerBackupRequest. - * @implements ITriggerBackupRequest - * @constructor - * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set - */ - function TriggerBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TriggerBackupRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @instance - */ - TriggerBackupRequest.prototype.name = ""; - - /** - * TriggerBackupRequest ruleId. - * @member {string} ruleId - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @instance - */ - TriggerBackupRequest.prototype.ruleId = ""; - - /** - * TriggerBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @instance - */ - TriggerBackupRequest.prototype.requestId = ""; - - /** - * Creates a new TriggerBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {google.cloud.backupdr.v1.ITriggerBackupRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest instance - */ - TriggerBackupRequest.create = function create(properties) { - return new TriggerBackupRequest(properties); - }; - - /** - * Encodes the specified TriggerBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TriggerBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ruleId); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.requestId); - return writer; - }; - - /** - * Encodes the specified TriggerBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TriggerBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {google.cloud.backupdr.v1.ITriggerBackupRequest} message TriggerBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TriggerBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TriggerBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TriggerBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); - 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.ruleId = reader.string(); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TriggerBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TriggerBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TriggerBackupRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TriggerBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - if (!$util.isString(message.ruleId)) - return "ruleId: string expected"; - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates a TriggerBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.TriggerBackupRequest} TriggerBackupRequest - */ - TriggerBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.TriggerBackupRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.TriggerBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.ruleId != null) - message.ruleId = String(object.ruleId); - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from a TriggerBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {google.cloud.backupdr.v1.TriggerBackupRequest} message TriggerBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TriggerBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.ruleId = ""; - object.requestId = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - object.ruleId = message.ruleId; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this TriggerBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @instance - * @returns {Object.} JSON object - */ - TriggerBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TriggerBackupRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.TriggerBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TriggerBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.TriggerBackupRequest"; - }; - - return TriggerBackupRequest; - })(); - - v1.CloudSqlInstanceDataSourceProperties = (function() { - - /** - * Properties of a CloudSqlInstanceDataSourceProperties. - * @memberof google.cloud.backupdr.v1 - * @interface ICloudSqlInstanceDataSourceProperties - * @property {string|null} [name] CloudSqlInstanceDataSourceProperties name - * @property {string|null} [databaseInstalledVersion] CloudSqlInstanceDataSourceProperties databaseInstalledVersion - * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceDataSourceProperties instanceCreateTime - * @property {string|null} [instanceTier] CloudSqlInstanceDataSourceProperties instanceTier - */ - - /** - * Constructs a new CloudSqlInstanceDataSourceProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CloudSqlInstanceDataSourceProperties. - * @implements ICloudSqlInstanceDataSourceProperties - * @constructor - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties=} [properties] Properties to set - */ - function CloudSqlInstanceDataSourceProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSqlInstanceDataSourceProperties name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @instance - */ - CloudSqlInstanceDataSourceProperties.prototype.name = ""; - - /** - * CloudSqlInstanceDataSourceProperties databaseInstalledVersion. - * @member {string} databaseInstalledVersion - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @instance - */ - CloudSqlInstanceDataSourceProperties.prototype.databaseInstalledVersion = ""; - - /** - * CloudSqlInstanceDataSourceProperties instanceCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @instance - */ - CloudSqlInstanceDataSourceProperties.prototype.instanceCreateTime = null; - - /** - * CloudSqlInstanceDataSourceProperties instanceTier. - * @member {string} instanceTier - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @instance - */ - CloudSqlInstanceDataSourceProperties.prototype.instanceTier = ""; - - /** - * Creates a new CloudSqlInstanceDataSourceProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties instance - */ - CloudSqlInstanceDataSourceProperties.create = function create(properties) { - return new CloudSqlInstanceDataSourceProperties(properties); - }; - - /** - * Encodes the specified CloudSqlInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties} message CloudSqlInstanceDataSourceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceDataSourceProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseInstalledVersion); - if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) - $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.instanceTier != null && Object.hasOwnProperty.call(message, "instanceTier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.instanceTier); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties} message CloudSqlInstanceDataSourceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceDataSourceProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties(); - 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.databaseInstalledVersion = reader.string(); - break; - } - case 3: { - message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.instanceTier = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstanceDataSourceProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstanceDataSourceProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstanceDataSourceProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) - if (!$util.isString(message.databaseInstalledVersion)) - return "databaseInstalledVersion: string expected"; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); - if (error) - return "instanceCreateTime." + error; - } - if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) - if (!$util.isString(message.instanceTier)) - return "instanceTier: string expected"; - return null; - }; - - /** - * Creates a CloudSqlInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} CloudSqlInstanceDataSourceProperties - */ - CloudSqlInstanceDataSourceProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties(); - if (object.name != null) - message.name = String(object.name); - if (object.databaseInstalledVersion != null) - message.databaseInstalledVersion = String(object.databaseInstalledVersion); - if (object.instanceCreateTime != null) { - if (typeof object.instanceCreateTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.instanceCreateTime: object expected"); - message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); - } - if (object.instanceTier != null) - message.instanceTier = String(object.instanceTier); - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstanceDataSourceProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties} message CloudSqlInstanceDataSourceProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstanceDataSourceProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.databaseInstalledVersion = ""; - object.instanceCreateTime = null; - object.instanceTier = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) - object.databaseInstalledVersion = message.databaseInstalledVersion; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) - object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); - if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) - object.instanceTier = message.instanceTier; - return object; - }; - - /** - * Converts this CloudSqlInstanceDataSourceProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstanceDataSourceProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstanceDataSourceProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstanceDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties"; - }; - - return CloudSqlInstanceDataSourceProperties; - })(); - - v1.CloudSqlInstanceBackupProperties = (function() { - - /** - * Properties of a CloudSqlInstanceBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @interface ICloudSqlInstanceBackupProperties - * @property {string|null} [databaseInstalledVersion] CloudSqlInstanceBackupProperties databaseInstalledVersion - * @property {boolean|null} [finalBackup] CloudSqlInstanceBackupProperties finalBackup - * @property {string|null} [sourceInstance] CloudSqlInstanceBackupProperties sourceInstance - * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceBackupProperties instanceCreateTime - * @property {string|null} [instanceTier] CloudSqlInstanceBackupProperties instanceTier - * @property {google.protobuf.ITimestamp|null} [instanceDeleteTime] CloudSqlInstanceBackupProperties instanceDeleteTime - */ - - /** - * Constructs a new CloudSqlInstanceBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CloudSqlInstanceBackupProperties. - * @implements ICloudSqlInstanceBackupProperties - * @constructor - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties=} [properties] Properties to set - */ - function CloudSqlInstanceBackupProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSqlInstanceBackupProperties databaseInstalledVersion. - * @member {string} databaseInstalledVersion - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - */ - CloudSqlInstanceBackupProperties.prototype.databaseInstalledVersion = ""; - - /** - * CloudSqlInstanceBackupProperties finalBackup. - * @member {boolean} finalBackup - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - */ - CloudSqlInstanceBackupProperties.prototype.finalBackup = false; - - /** - * CloudSqlInstanceBackupProperties sourceInstance. - * @member {string} sourceInstance - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - */ - CloudSqlInstanceBackupProperties.prototype.sourceInstance = ""; - - /** - * CloudSqlInstanceBackupProperties instanceCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - */ - CloudSqlInstanceBackupProperties.prototype.instanceCreateTime = null; - - /** - * CloudSqlInstanceBackupProperties instanceTier. - * @member {string} instanceTier - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - */ - CloudSqlInstanceBackupProperties.prototype.instanceTier = ""; - - /** - * CloudSqlInstanceBackupProperties instanceDeleteTime. - * @member {google.protobuf.ITimestamp|null|undefined} instanceDeleteTime - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - */ - CloudSqlInstanceBackupProperties.prototype.instanceDeleteTime = null; - - /** - * Creates a new CloudSqlInstanceBackupProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties instance - */ - CloudSqlInstanceBackupProperties.create = function create(properties) { - return new CloudSqlInstanceBackupProperties(properties); - }; - - /** - * Encodes the specified CloudSqlInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties} message CloudSqlInstanceBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceBackupProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseInstalledVersion); - if (message.finalBackup != null && Object.hasOwnProperty.call(message, "finalBackup")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.finalBackup); - if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.sourceInstance); - if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) - $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.instanceTier != null && Object.hasOwnProperty.call(message, "instanceTier")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.instanceTier); - if (message.instanceDeleteTime != null && Object.hasOwnProperty.call(message, "instanceDeleteTime")) - $root.google.protobuf.Timestamp.encode(message.instanceDeleteTime, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties} message CloudSqlInstanceBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceBackupProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 2: { - message.databaseInstalledVersion = reader.string(); - break; - } - case 3: { - message.finalBackup = reader.bool(); - break; - } - case 4: { - message.sourceInstance = reader.string(); - break; - } - case 5: { - message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.instanceTier = reader.string(); - break; - } - case 8: { - message.instanceDeleteTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstanceBackupProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceBackupProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstanceBackupProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstanceBackupProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) - if (!$util.isString(message.databaseInstalledVersion)) - return "databaseInstalledVersion: string expected"; - if (message.finalBackup != null && message.hasOwnProperty("finalBackup")) - if (typeof message.finalBackup !== "boolean") - return "finalBackup: boolean expected"; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) - if (!$util.isString(message.sourceInstance)) - return "sourceInstance: string expected"; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); - if (error) - return "instanceCreateTime." + error; - } - if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) - if (!$util.isString(message.instanceTier)) - return "instanceTier: string expected"; - if (message.instanceDeleteTime != null && message.hasOwnProperty("instanceDeleteTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceDeleteTime); - if (error) - return "instanceDeleteTime." + error; - } - return null; - }; - - /** - * Creates a CloudSqlInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} CloudSqlInstanceBackupProperties - */ - CloudSqlInstanceBackupProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties(); - if (object.databaseInstalledVersion != null) - message.databaseInstalledVersion = String(object.databaseInstalledVersion); - if (object.finalBackup != null) - message.finalBackup = Boolean(object.finalBackup); - if (object.sourceInstance != null) - message.sourceInstance = String(object.sourceInstance); - if (object.instanceCreateTime != null) { - if (typeof object.instanceCreateTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.instanceCreateTime: object expected"); - message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); - } - if (object.instanceTier != null) - message.instanceTier = String(object.instanceTier); - if (object.instanceDeleteTime != null) { - if (typeof object.instanceDeleteTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.instanceDeleteTime: object expected"); - message.instanceDeleteTime = $root.google.protobuf.Timestamp.fromObject(object.instanceDeleteTime); - } - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstanceBackupProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties} message CloudSqlInstanceBackupProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstanceBackupProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.databaseInstalledVersion = ""; - object.finalBackup = false; - object.sourceInstance = ""; - object.instanceCreateTime = null; - object.instanceTier = ""; - object.instanceDeleteTime = null; - } - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) - object.databaseInstalledVersion = message.databaseInstalledVersion; - if (message.finalBackup != null && message.hasOwnProperty("finalBackup")) - object.finalBackup = message.finalBackup; - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) - object.sourceInstance = message.sourceInstance; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) - object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); - if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) - object.instanceTier = message.instanceTier; - if (message.instanceDeleteTime != null && message.hasOwnProperty("instanceDeleteTime")) - object.instanceDeleteTime = $root.google.protobuf.Timestamp.toObject(message.instanceDeleteTime, options); - return object; - }; - - /** - * Converts this CloudSqlInstanceBackupProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstanceBackupProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstanceBackupProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstanceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties"; - }; - - return CloudSqlInstanceBackupProperties; - })(); - - v1.CloudSqlInstanceDataSourceReferenceProperties = (function() { - - /** - * Properties of a CloudSqlInstanceDataSourceReferenceProperties. - * @memberof google.cloud.backupdr.v1 - * @interface ICloudSqlInstanceDataSourceReferenceProperties - * @property {string|null} [name] CloudSqlInstanceDataSourceReferenceProperties name - * @property {string|null} [databaseInstalledVersion] CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion - * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime - * @property {string|null} [instanceTier] CloudSqlInstanceDataSourceReferenceProperties instanceTier - */ - - /** - * Constructs a new CloudSqlInstanceDataSourceReferenceProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CloudSqlInstanceDataSourceReferenceProperties. - * @implements ICloudSqlInstanceDataSourceReferenceProperties - * @constructor - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties=} [properties] Properties to set - */ - function CloudSqlInstanceDataSourceReferenceProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSqlInstanceDataSourceReferenceProperties name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @instance - */ - CloudSqlInstanceDataSourceReferenceProperties.prototype.name = ""; - - /** - * CloudSqlInstanceDataSourceReferenceProperties databaseInstalledVersion. - * @member {string} databaseInstalledVersion - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @instance - */ - CloudSqlInstanceDataSourceReferenceProperties.prototype.databaseInstalledVersion = ""; - - /** - * CloudSqlInstanceDataSourceReferenceProperties instanceCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @instance - */ - CloudSqlInstanceDataSourceReferenceProperties.prototype.instanceCreateTime = null; - - /** - * CloudSqlInstanceDataSourceReferenceProperties instanceTier. - * @member {string} instanceTier - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @instance - */ - CloudSqlInstanceDataSourceReferenceProperties.prototype.instanceTier = ""; - - /** - * Creates a new CloudSqlInstanceDataSourceReferenceProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties instance - */ - CloudSqlInstanceDataSourceReferenceProperties.create = function create(properties) { - return new CloudSqlInstanceDataSourceReferenceProperties(properties); - }; - - /** - * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties} message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceDataSourceReferenceProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.databaseInstalledVersion != null && Object.hasOwnProperty.call(message, "databaseInstalledVersion")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.databaseInstalledVersion); - if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) - $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.instanceTier != null && Object.hasOwnProperty.call(message, "instanceTier")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.instanceTier); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstanceDataSourceReferenceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties} message CloudSqlInstanceDataSourceReferenceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceDataSourceReferenceProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceDataSourceReferenceProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties(); - 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.databaseInstalledVersion = reader.string(); - break; - } - case 3: { - message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.instanceTier = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstanceDataSourceReferenceProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceDataSourceReferenceProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstanceDataSourceReferenceProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstanceDataSourceReferenceProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) - if (!$util.isString(message.databaseInstalledVersion)) - return "databaseInstalledVersion: string expected"; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); - if (error) - return "instanceCreateTime." + error; - } - if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) - if (!$util.isString(message.instanceTier)) - return "instanceTier: string expected"; - return null; - }; - - /** - * Creates a CloudSqlInstanceDataSourceReferenceProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} CloudSqlInstanceDataSourceReferenceProperties - */ - CloudSqlInstanceDataSourceReferenceProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties(); - if (object.name != null) - message.name = String(object.name); - if (object.databaseInstalledVersion != null) - message.databaseInstalledVersion = String(object.databaseInstalledVersion); - if (object.instanceCreateTime != null) { - if (typeof object.instanceCreateTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.instanceCreateTime: object expected"); - message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); - } - if (object.instanceTier != null) - message.instanceTier = String(object.instanceTier); - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstanceDataSourceReferenceProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties} message CloudSqlInstanceDataSourceReferenceProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstanceDataSourceReferenceProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.databaseInstalledVersion = ""; - object.instanceCreateTime = null; - object.instanceTier = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.databaseInstalledVersion != null && message.hasOwnProperty("databaseInstalledVersion")) - object.databaseInstalledVersion = message.databaseInstalledVersion; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) - object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); - if (message.instanceTier != null && message.hasOwnProperty("instanceTier")) - object.instanceTier = message.instanceTier; - return object; - }; - - /** - * Converts this CloudSqlInstanceDataSourceReferenceProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstanceDataSourceReferenceProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstanceDataSourceReferenceProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstanceDataSourceReferenceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties"; - }; - - return CloudSqlInstanceDataSourceReferenceProperties; - })(); - - v1.CloudSqlInstanceInitializationConfig = (function() { - - /** - * Properties of a CloudSqlInstanceInitializationConfig. - * @memberof google.cloud.backupdr.v1 - * @interface ICloudSqlInstanceInitializationConfig - * @property {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition|null} [edition] CloudSqlInstanceInitializationConfig edition - */ - - /** - * Constructs a new CloudSqlInstanceInitializationConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CloudSqlInstanceInitializationConfig. - * @implements ICloudSqlInstanceInitializationConfig - * @constructor - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig=} [properties] Properties to set - */ - function CloudSqlInstanceInitializationConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSqlInstanceInitializationConfig edition. - * @member {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition} edition - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @instance - */ - CloudSqlInstanceInitializationConfig.prototype.edition = 0; - - /** - * Creates a new CloudSqlInstanceInitializationConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig instance - */ - CloudSqlInstanceInitializationConfig.create = function create(properties) { - return new CloudSqlInstanceInitializationConfig(properties); - }; - - /** - * Encodes the specified CloudSqlInstanceInitializationConfig message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig} message CloudSqlInstanceInitializationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceInitializationConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstanceInitializationConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceInitializationConfig} message CloudSqlInstanceInitializationConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceInitializationConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceInitializationConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.edition = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstanceInitializationConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceInitializationConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstanceInitializationConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstanceInitializationConfig.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 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a CloudSqlInstanceInitializationConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} CloudSqlInstanceInitializationConfig - */ - CloudSqlInstanceInitializationConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig(); - switch (object.edition) { - default: - if (typeof object.edition === "number") { - message.edition = object.edition; - break; - } - break; - case "EDITION_UNSPECIFIED": - case 0: - message.edition = 0; - break; - case "ENTERPRISE": - case 1: - message.edition = 1; - break; - case "ENTERPRISE_PLUS": - case 2: - message.edition = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstanceInitializationConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} message CloudSqlInstanceInitializationConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstanceInitializationConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.edition = options.enums === String ? "EDITION_UNSPECIFIED" : 0; - if (message.edition != null && message.hasOwnProperty("edition")) - object.edition = options.enums === String ? $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition[message.edition] === undefined ? message.edition : $root.google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition[message.edition] : message.edition; - return object; - }; - - /** - * Converts this CloudSqlInstanceInitializationConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstanceInitializationConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstanceInitializationConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstanceInitializationConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig"; - }; - - /** - * Edition enum. - * @name google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig.Edition - * @enum {number} - * @property {number} EDITION_UNSPECIFIED=0 EDITION_UNSPECIFIED value - * @property {number} ENTERPRISE=1 ENTERPRISE value - * @property {number} ENTERPRISE_PLUS=2 ENTERPRISE_PLUS value - */ - CloudSqlInstanceInitializationConfig.Edition = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "EDITION_UNSPECIFIED"] = 0; - values[valuesById[1] = "ENTERPRISE"] = 1; - values[valuesById[2] = "ENTERPRISE_PLUS"] = 2; - return values; - })(); - - return CloudSqlInstanceInitializationConfig; - })(); - - v1.CloudSqlInstanceBackupPlanAssociationProperties = (function() { - - /** - * Properties of a CloudSqlInstanceBackupPlanAssociationProperties. - * @memberof google.cloud.backupdr.v1 - * @interface ICloudSqlInstanceBackupPlanAssociationProperties - * @property {google.protobuf.ITimestamp|null} [instanceCreateTime] CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime - */ - - /** - * Constructs a new CloudSqlInstanceBackupPlanAssociationProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CloudSqlInstanceBackupPlanAssociationProperties. - * @implements ICloudSqlInstanceBackupPlanAssociationProperties - * @constructor - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties=} [properties] Properties to set - */ - function CloudSqlInstanceBackupPlanAssociationProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CloudSqlInstanceBackupPlanAssociationProperties instanceCreateTime. - * @member {google.protobuf.ITimestamp|null|undefined} instanceCreateTime - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @instance - */ - CloudSqlInstanceBackupPlanAssociationProperties.prototype.instanceCreateTime = null; - - /** - * Creates a new CloudSqlInstanceBackupPlanAssociationProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties instance - */ - CloudSqlInstanceBackupPlanAssociationProperties.create = function create(properties) { - return new CloudSqlInstanceBackupPlanAssociationProperties(properties); - }; - - /** - * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties} message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceBackupPlanAssociationProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.instanceCreateTime != null && Object.hasOwnProperty.call(message, "instanceCreateTime")) - $root.google.protobuf.Timestamp.encode(message.instanceCreateTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified CloudSqlInstanceBackupPlanAssociationProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {google.cloud.backupdr.v1.ICloudSqlInstanceBackupPlanAssociationProperties} message CloudSqlInstanceBackupPlanAssociationProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CloudSqlInstanceBackupPlanAssociationProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceBackupPlanAssociationProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.instanceCreateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CloudSqlInstanceBackupPlanAssociationProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CloudSqlInstanceBackupPlanAssociationProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CloudSqlInstanceBackupPlanAssociationProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CloudSqlInstanceBackupPlanAssociationProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.instanceCreateTime); - if (error) - return "instanceCreateTime." + error; - } - return null; - }; - - /** - * Creates a CloudSqlInstanceBackupPlanAssociationProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} CloudSqlInstanceBackupPlanAssociationProperties - */ - CloudSqlInstanceBackupPlanAssociationProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties(); - if (object.instanceCreateTime != null) { - if (typeof object.instanceCreateTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties.instanceCreateTime: object expected"); - message.instanceCreateTime = $root.google.protobuf.Timestamp.fromObject(object.instanceCreateTime); - } - return message; - }; - - /** - * Creates a plain object from a CloudSqlInstanceBackupPlanAssociationProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties} message CloudSqlInstanceBackupPlanAssociationProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CloudSqlInstanceBackupPlanAssociationProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.instanceCreateTime = null; - if (message.instanceCreateTime != null && message.hasOwnProperty("instanceCreateTime")) - object.instanceCreateTime = $root.google.protobuf.Timestamp.toObject(message.instanceCreateTime, options); - return object; - }; - - /** - * Converts this CloudSqlInstanceBackupPlanAssociationProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @instance - * @returns {Object.} JSON object - */ - CloudSqlInstanceBackupPlanAssociationProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CloudSqlInstanceBackupPlanAssociationProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CloudSqlInstanceBackupPlanAssociationProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CloudSqlInstanceBackupPlanAssociationProperties"; - }; - - return CloudSqlInstanceBackupPlanAssociationProperties; - })(); - - v1.BackupVault = (function() { - - /** - * Properties of a BackupVault. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupVault - * @property {string|null} [name] BackupVault name - * @property {string|null} [description] BackupVault description - * @property {Object.|null} [labels] BackupVault labels - * @property {google.protobuf.ITimestamp|null} [createTime] BackupVault createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] BackupVault updateTime - * @property {google.protobuf.IDuration|null} [backupMinimumEnforcedRetentionDuration] BackupVault backupMinimumEnforcedRetentionDuration - * @property {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null} [backupRetentionInheritance] BackupVault backupRetentionInheritance - * @property {boolean|null} [deletable] BackupVault deletable - * @property {string|null} [etag] BackupVault etag - * @property {google.cloud.backupdr.v1.BackupVault.State|null} [state] BackupVault state - * @property {google.protobuf.ITimestamp|null} [effectiveTime] BackupVault effectiveTime - * @property {number|Long|null} [backupCount] BackupVault backupCount - * @property {string|null} [serviceAccount] BackupVault serviceAccount - * @property {number|Long|null} [totalStoredBytes] BackupVault totalStoredBytes - * @property {string|null} [uid] BackupVault uid - * @property {Object.|null} [annotations] BackupVault annotations - * @property {google.cloud.backupdr.v1.BackupVault.AccessRestriction|null} [accessRestriction] BackupVault accessRestriction - * @property {google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null} [encryptionConfig] BackupVault encryptionConfig - */ - - /** - * Constructs a new BackupVault. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupVault. - * @implements IBackupVault - * @constructor - * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set - */ - function BackupVault(properties) { - this.labels = {}; - this.annotations = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupVault name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.name = ""; - - /** - * BackupVault description. - * @member {string|null|undefined} description - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.description = null; - - /** - * BackupVault labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.labels = $util.emptyObject; - - /** - * BackupVault createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.createTime = null; - - /** - * BackupVault updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.updateTime = null; - - /** - * BackupVault backupMinimumEnforcedRetentionDuration. - * @member {google.protobuf.IDuration|null|undefined} backupMinimumEnforcedRetentionDuration - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.backupMinimumEnforcedRetentionDuration = null; - - /** - * BackupVault backupRetentionInheritance. - * @member {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null|undefined} backupRetentionInheritance - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.backupRetentionInheritance = null; - - /** - * BackupVault deletable. - * @member {boolean|null|undefined} deletable - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.deletable = null; - - /** - * BackupVault etag. - * @member {string|null|undefined} etag - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.etag = null; - - /** - * BackupVault state. - * @member {google.cloud.backupdr.v1.BackupVault.State} state - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.state = 0; - - /** - * BackupVault effectiveTime. - * @member {google.protobuf.ITimestamp|null|undefined} effectiveTime - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.effectiveTime = null; - - /** - * BackupVault backupCount. - * @member {number|Long} backupCount - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.backupCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BackupVault serviceAccount. - * @member {string} serviceAccount - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.serviceAccount = ""; - - /** - * BackupVault totalStoredBytes. - * @member {number|Long} totalStoredBytes - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.totalStoredBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BackupVault uid. - * @member {string} uid - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.uid = ""; - - /** - * BackupVault annotations. - * @member {Object.} annotations - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.annotations = $util.emptyObject; - - /** - * BackupVault accessRestriction. - * @member {google.cloud.backupdr.v1.BackupVault.AccessRestriction} accessRestriction - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.accessRestriction = 0; - - /** - * BackupVault encryptionConfig. - * @member {google.cloud.backupdr.v1.BackupVault.IEncryptionConfig|null|undefined} encryptionConfig - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - */ - BackupVault.prototype.encryptionConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_description", { - get: $util.oneOfGetter($oneOfFields = ["description"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_createTime", { - get: $util.oneOfGetter($oneOfFields = ["createTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_updateTime", { - get: $util.oneOfGetter($oneOfFields = ["updateTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_backupMinimumEnforcedRetentionDuration", { - get: $util.oneOfGetter($oneOfFields = ["backupMinimumEnforcedRetentionDuration"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_backupRetentionInheritance", { - get: $util.oneOfGetter($oneOfFields = ["backupRetentionInheritance"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_deletable", { - get: $util.oneOfGetter($oneOfFields = ["deletable"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_etag", { - get: $util.oneOfGetter($oneOfFields = ["etag"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_effectiveTime", { - get: $util.oneOfGetter($oneOfFields = ["effectiveTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupVault.prototype, "_encryptionConfig", { - get: $util.oneOfGetter($oneOfFields = ["encryptionConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupVault instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {google.cloud.backupdr.v1.IBackupVault=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault instance - */ - BackupVault.create = function create(properties) { - return new BackupVault(properties); - }; - - /** - * Encodes the specified BackupVault message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupVault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), 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.labels[keys[i]]).ldelim(); - 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.deletable != null && Object.hasOwnProperty.call(message, "deletable")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.deletable); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.etag); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.state); - if (message.effectiveTime != null && Object.hasOwnProperty.call(message, "effectiveTime")) - $root.google.protobuf.Timestamp.encode(message.effectiveTime, writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) - writer.uint32(/* id 17, wireType 0 =*/136).int64(message.backupCount); - if (message.serviceAccount != null && Object.hasOwnProperty.call(message, "serviceAccount")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.serviceAccount); - if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) - writer.uint32(/* id 19, wireType 0 =*/152).int64(message.totalStoredBytes); - if (message.backupMinimumEnforcedRetentionDuration != null && Object.hasOwnProperty.call(message, "backupMinimumEnforcedRetentionDuration")) - $root.google.protobuf.Duration.encode(message.backupMinimumEnforcedRetentionDuration, writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 21, wireType 2 =*/170).string(message.uid); - if (message.annotations != null && Object.hasOwnProperty.call(message, "annotations")) - for (var keys = Object.keys(message.annotations), i = 0; i < keys.length; ++i) - writer.uint32(/* id 22, wireType 2 =*/178).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.annotations[keys[i]]).ldelim(); - if (message.accessRestriction != null && Object.hasOwnProperty.call(message, "accessRestriction")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.accessRestriction); - if (message.backupRetentionInheritance != null && Object.hasOwnProperty.call(message, "backupRetentionInheritance")) - writer.uint32(/* id 27, wireType 0 =*/216).int32(message.backupRetentionInheritance); - if (message.encryptionConfig != null && Object.hasOwnProperty.call(message, "encryptionConfig")) - $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.encode(message.encryptionConfig, writer.uint32(/* id 29, wireType 2 =*/234).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupVault message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {google.cloud.backupdr.v1.IBackupVault} message BackupVault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupVault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupVault message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupVault.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupVault(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - 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.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 20: { - message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.decode(reader, reader.uint32()); - break; - } - case 27: { - message.backupRetentionInheritance = reader.int32(); - break; - } - case 8: { - message.deletable = reader.bool(); - break; - } - case 9: { - message.etag = reader.string(); - break; - } - case 10: { - message.state = reader.int32(); - break; - } - case 12: { - message.effectiveTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 17: { - message.backupCount = reader.int64(); - break; - } - case 18: { - message.serviceAccount = reader.string(); - break; - } - case 19: { - message.totalStoredBytes = reader.int64(); - break; - } - case 21: { - message.uid = reader.string(); - break; - } - case 22: { - if (message.annotations === $util.emptyObject) - message.annotations = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.annotations[key] = value; - break; - } - case 24: { - message.accessRestriction = reader.int32(); - break; - } - case 29: { - message.encryptionConfig = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupVault message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupVault.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupVault message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupVault.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")) { - properties._description = 1; - 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.createTime != null && message.hasOwnProperty("createTime")) { - properties._createTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - properties._updateTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - } - if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { - properties._backupMinimumEnforcedRetentionDuration = 1; - { - var error = $root.google.protobuf.Duration.verify(message.backupMinimumEnforcedRetentionDuration); - if (error) - return "backupMinimumEnforcedRetentionDuration." + error; - } - } - if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { - properties._backupRetentionInheritance = 1; - switch (message.backupRetentionInheritance) { - default: - return "backupRetentionInheritance: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.deletable != null && message.hasOwnProperty("deletable")) { - properties._deletable = 1; - if (typeof message.deletable !== "boolean") - return "deletable: boolean expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) { - properties._etag = 1; - if (!$util.isString(message.etag)) - return "etag: 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.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { - properties._effectiveTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.effectiveTime); - if (error) - return "effectiveTime." + error; - } - } - if (message.backupCount != null && message.hasOwnProperty("backupCount")) - if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) - return "backupCount: integer|Long expected"; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - if (!$util.isString(message.serviceAccount)) - return "serviceAccount: string expected"; - if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) - if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) - return "totalStoredBytes: integer|Long expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.annotations != null && message.hasOwnProperty("annotations")) { - if (!$util.isObject(message.annotations)) - return "annotations: object expected"; - var key = Object.keys(message.annotations); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.annotations[key[i]])) - return "annotations: string{k:string} expected"; - } - if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) - switch (message.accessRestriction) { - default: - return "accessRestriction: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - properties._encryptionConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.verify(message.encryptionConfig); - if (error) - return "encryptionConfig." + error; - } - } - return null; - }; - - /** - * Creates a BackupVault message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupVault} BackupVault - */ - BackupVault.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupVault) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupVault(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupVault.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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.backupMinimumEnforcedRetentionDuration != null) { - if (typeof object.backupMinimumEnforcedRetentionDuration !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupVault.backupMinimumEnforcedRetentionDuration: object expected"); - message.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.fromObject(object.backupMinimumEnforcedRetentionDuration); - } - switch (object.backupRetentionInheritance) { - default: - if (typeof object.backupRetentionInheritance === "number") { - message.backupRetentionInheritance = object.backupRetentionInheritance; - break; - } - break; - case "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED": - case 0: - message.backupRetentionInheritance = 0; - break; - case "INHERIT_VAULT_RETENTION": - case 1: - message.backupRetentionInheritance = 1; - break; - case "MATCH_BACKUP_EXPIRE_TIME": - case 2: - message.backupRetentionInheritance = 2; - break; - } - if (object.deletable != null) - message.deletable = Boolean(object.deletable); - if (object.etag != null) - message.etag = String(object.etag); - 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 "DELETING": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - case "UPDATING": - case 5: - message.state = 5; - break; - } - if (object.effectiveTime != null) { - if (typeof object.effectiveTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupVault.effectiveTime: object expected"); - message.effectiveTime = $root.google.protobuf.Timestamp.fromObject(object.effectiveTime); - } - if (object.backupCount != null) - if ($util.Long) - (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; - else if (typeof object.backupCount === "string") - message.backupCount = parseInt(object.backupCount, 10); - else if (typeof object.backupCount === "number") - message.backupCount = object.backupCount; - else if (typeof object.backupCount === "object") - message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); - if (object.serviceAccount != null) - message.serviceAccount = String(object.serviceAccount); - if (object.totalStoredBytes != null) - if ($util.Long) - (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; - else if (typeof object.totalStoredBytes === "string") - message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); - else if (typeof object.totalStoredBytes === "number") - message.totalStoredBytes = object.totalStoredBytes; - else if (typeof object.totalStoredBytes === "object") - message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); - if (object.uid != null) - message.uid = String(object.uid); - if (object.annotations) { - if (typeof object.annotations !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupVault.annotations: object expected"); - message.annotations = {}; - for (var keys = Object.keys(object.annotations), i = 0; i < keys.length; ++i) - message.annotations[keys[i]] = String(object.annotations[keys[i]]); - } - switch (object.accessRestriction) { - default: - if (typeof object.accessRestriction === "number") { - message.accessRestriction = object.accessRestriction; - break; - } - break; - case "ACCESS_RESTRICTION_UNSPECIFIED": - case 0: - message.accessRestriction = 0; - break; - case "WITHIN_PROJECT": - case 1: - message.accessRestriction = 1; - break; - case "WITHIN_ORGANIZATION": - case 2: - message.accessRestriction = 2; - break; - case "UNRESTRICTED": - case 3: - message.accessRestriction = 3; - break; - case "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA": - case 4: - message.accessRestriction = 4; - break; - } - if (object.encryptionConfig != null) { - if (typeof object.encryptionConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupVault.encryptionConfig: object expected"); - message.encryptionConfig = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.fromObject(object.encryptionConfig); - } - return message; - }; - - /** - * Creates a plain object from a BackupVault message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {google.cloud.backupdr.v1.BackupVault} message BackupVault - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupVault.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) { - object.labels = {}; - object.annotations = {}; - } - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.backupCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backupCount = options.longs === String ? "0" : 0; - object.serviceAccount = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalStoredBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalStoredBytes = options.longs === String ? "0" : 0; - object.uid = ""; - object.accessRestriction = options.enums === String ? "ACCESS_RESTRICTION_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) { - object.description = message.description; - if (options.oneofs) - object._description = "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.createTime != null && message.hasOwnProperty("createTime")) { - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (options.oneofs) - object._createTime = "createTime"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object._updateTime = "updateTime"; - } - if (message.deletable != null && message.hasOwnProperty("deletable")) { - object.deletable = message.deletable; - if (options.oneofs) - object._deletable = "deletable"; - } - if (message.etag != null && message.hasOwnProperty("etag")) { - object.etag = message.etag; - if (options.oneofs) - object._etag = "etag"; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupVault.State[message.state] : message.state; - if (message.effectiveTime != null && message.hasOwnProperty("effectiveTime")) { - object.effectiveTime = $root.google.protobuf.Timestamp.toObject(message.effectiveTime, options); - if (options.oneofs) - object._effectiveTime = "effectiveTime"; - } - if (message.backupCount != null && message.hasOwnProperty("backupCount")) - if (typeof message.backupCount === "number") - object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; - else - object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) - object.serviceAccount = message.serviceAccount; - if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) - if (typeof message.totalStoredBytes === "number") - object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; - else - object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; - if (message.backupMinimumEnforcedRetentionDuration != null && message.hasOwnProperty("backupMinimumEnforcedRetentionDuration")) { - object.backupMinimumEnforcedRetentionDuration = $root.google.protobuf.Duration.toObject(message.backupMinimumEnforcedRetentionDuration, options); - if (options.oneofs) - object._backupMinimumEnforcedRetentionDuration = "backupMinimumEnforcedRetentionDuration"; - } - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.annotations && (keys2 = Object.keys(message.annotations)).length) { - object.annotations = {}; - for (var j = 0; j < keys2.length; ++j) - object.annotations[keys2[j]] = message.annotations[keys2[j]]; - } - if (message.accessRestriction != null && message.hasOwnProperty("accessRestriction")) - object.accessRestriction = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] === undefined ? message.accessRestriction : $root.google.cloud.backupdr.v1.BackupVault.AccessRestriction[message.accessRestriction] : message.accessRestriction; - if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { - object.backupRetentionInheritance = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] === undefined ? message.backupRetentionInheritance : $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] : message.backupRetentionInheritance; - if (options.oneofs) - object._backupRetentionInheritance = "backupRetentionInheritance"; - } - if (message.encryptionConfig != null && message.hasOwnProperty("encryptionConfig")) { - object.encryptionConfig = $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig.toObject(message.encryptionConfig, options); - if (options.oneofs) - object._encryptionConfig = "encryptionConfig"; - } - return object; - }; - - /** - * Converts this BackupVault to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupVault - * @instance - * @returns {Object.} JSON object - */ - BackupVault.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupVault - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupVault - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupVault.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupVault"; - }; - - /** - * BackupRetentionInheritance enum. - * @name google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance - * @enum {number} - * @property {number} BACKUP_RETENTION_INHERITANCE_UNSPECIFIED=0 BACKUP_RETENTION_INHERITANCE_UNSPECIFIED value - * @property {number} INHERIT_VAULT_RETENTION=1 INHERIT_VAULT_RETENTION value - * @property {number} MATCH_BACKUP_EXPIRE_TIME=2 MATCH_BACKUP_EXPIRE_TIME value - */ - BackupVault.BackupRetentionInheritance = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "INHERIT_VAULT_RETENTION"] = 1; - values[valuesById[2] = "MATCH_BACKUP_EXPIRE_TIME"] = 2; - return values; - })(); - - /** - * State enum. - * @name google.cloud.backupdr.v1.BackupVault.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} DELETING=3 DELETING value - * @property {number} ERROR=4 ERROR value - * @property {number} UPDATING=5 UPDATING value - */ - BackupVault.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] = "DELETING"] = 3; - values[valuesById[4] = "ERROR"] = 4; - values[valuesById[5] = "UPDATING"] = 5; - return values; - })(); - - /** - * AccessRestriction enum. - * @name google.cloud.backupdr.v1.BackupVault.AccessRestriction - * @enum {number} - * @property {number} ACCESS_RESTRICTION_UNSPECIFIED=0 ACCESS_RESTRICTION_UNSPECIFIED value - * @property {number} WITHIN_PROJECT=1 WITHIN_PROJECT value - * @property {number} WITHIN_ORGANIZATION=2 WITHIN_ORGANIZATION value - * @property {number} UNRESTRICTED=3 UNRESTRICTED value - * @property {number} WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA=4 WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA value - */ - BackupVault.AccessRestriction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACCESS_RESTRICTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "WITHIN_PROJECT"] = 1; - values[valuesById[2] = "WITHIN_ORGANIZATION"] = 2; - values[valuesById[3] = "UNRESTRICTED"] = 3; - values[valuesById[4] = "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA"] = 4; - return values; - })(); - - BackupVault.EncryptionConfig = (function() { - - /** - * Properties of an EncryptionConfig. - * @memberof google.cloud.backupdr.v1.BackupVault - * @interface IEncryptionConfig - * @property {string|null} [kmsKeyName] EncryptionConfig kmsKeyName - */ - - /** - * Constructs a new EncryptionConfig. - * @memberof google.cloud.backupdr.v1.BackupVault - * @classdesc Represents an EncryptionConfig. - * @implements IEncryptionConfig - * @constructor - * @param {google.cloud.backupdr.v1.BackupVault.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 kmsKeyName. - * @member {string|null|undefined} kmsKeyName - * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig - * @instance - */ - EncryptionConfig.prototype.kmsKeyName = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(EncryptionConfig.prototype, "_kmsKeyName", { - get: $util.oneOfGetter($oneOfFields = ["kmsKeyName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new EncryptionConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {google.cloud.backupdr.v1.BackupVault.IEncryptionConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupVault.EncryptionConfig} EncryptionConfig instance - */ - EncryptionConfig.create = function create(properties) { - return new EncryptionConfig(properties); - }; - - /** - * Encodes the specified EncryptionConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.EncryptionConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {google.cloud.backupdr.v1.BackupVault.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.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.kmsKeyName); - return writer; - }; - - /** - * Encodes the specified EncryptionConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupVault.EncryptionConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.EncryptionConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.kmsKeyName = 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.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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"; - var properties = {}; - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { - properties._kmsKeyName = 1; - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: 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.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupVault.EncryptionConfig} EncryptionConfig - */ - EncryptionConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupVault.EncryptionConfig(); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - return message; - }; - - /** - * Creates a plain object from an EncryptionConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupVault.EncryptionConfig - * @static - * @param {google.cloud.backupdr.v1.BackupVault.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 (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { - object.kmsKeyName = message.kmsKeyName; - if (options.oneofs) - object._kmsKeyName = "kmsKeyName"; - } - return object; - }; - - /** - * Converts this EncryptionConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.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.backupdr.v1.BackupVault.EncryptionConfig"; - }; - - return EncryptionConfig; - })(); - - return BackupVault; - })(); - - v1.DataSource = (function() { - - /** - * Properties of a DataSource. - * @memberof google.cloud.backupdr.v1 - * @interface IDataSource - * @property {string|null} [name] DataSource name - * @property {google.cloud.backupdr.v1.DataSource.State|null} [state] DataSource state - * @property {Object.|null} [labels] DataSource labels - * @property {google.protobuf.ITimestamp|null} [createTime] DataSource createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] DataSource updateTime - * @property {number|Long|null} [backupCount] DataSource backupCount - * @property {string|null} [etag] DataSource etag - * @property {number|Long|null} [totalStoredBytes] DataSource totalStoredBytes - * @property {google.cloud.backupdr.v1.BackupConfigState|null} [configState] DataSource configState - * @property {google.cloud.backupdr.v1.IBackupConfigInfo|null} [backupConfigInfo] DataSource backupConfigInfo - * @property {google.cloud.backupdr.v1.IDataSourceGcpResource|null} [dataSourceGcpResource] DataSource dataSourceGcpResource - * @property {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null} [dataSourceBackupApplianceApplication] DataSource dataSourceBackupApplianceApplication - * @property {boolean|null} [backupBlockedByVaultAccessRestriction] DataSource backupBlockedByVaultAccessRestriction - */ - - /** - * Constructs a new DataSource. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DataSource. - * @implements IDataSource - * @constructor - * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set - */ - function DataSource(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]]; - } - - /** - * DataSource name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.name = ""; - - /** - * DataSource state. - * @member {google.cloud.backupdr.v1.DataSource.State} state - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.state = 0; - - /** - * DataSource labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.labels = $util.emptyObject; - - /** - * DataSource createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.createTime = null; - - /** - * DataSource updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.updateTime = null; - - /** - * DataSource backupCount. - * @member {number|Long|null|undefined} backupCount - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.backupCount = null; - - /** - * DataSource etag. - * @member {string|null|undefined} etag - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.etag = null; - - /** - * DataSource totalStoredBytes. - * @member {number|Long|null|undefined} totalStoredBytes - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.totalStoredBytes = null; - - /** - * DataSource configState. - * @member {google.cloud.backupdr.v1.BackupConfigState} configState - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.configState = 0; - - /** - * DataSource backupConfigInfo. - * @member {google.cloud.backupdr.v1.IBackupConfigInfo|null|undefined} backupConfigInfo - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.backupConfigInfo = null; - - /** - * DataSource dataSourceGcpResource. - * @member {google.cloud.backupdr.v1.IDataSourceGcpResource|null|undefined} dataSourceGcpResource - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.dataSourceGcpResource = null; - - /** - * DataSource dataSourceBackupApplianceApplication. - * @member {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication|null|undefined} dataSourceBackupApplianceApplication - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.dataSourceBackupApplianceApplication = null; - - /** - * DataSource backupBlockedByVaultAccessRestriction. - * @member {boolean} backupBlockedByVaultAccessRestriction - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - DataSource.prototype.backupBlockedByVaultAccessRestriction = false; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataSource.prototype, "_createTime", { - get: $util.oneOfGetter($oneOfFields = ["createTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataSource.prototype, "_updateTime", { - get: $util.oneOfGetter($oneOfFields = ["updateTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataSource.prototype, "_backupCount", { - get: $util.oneOfGetter($oneOfFields = ["backupCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataSource.prototype, "_etag", { - get: $util.oneOfGetter($oneOfFields = ["etag"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataSource.prototype, "_totalStoredBytes", { - get: $util.oneOfGetter($oneOfFields = ["totalStoredBytes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * DataSource sourceResource. - * @member {"dataSourceGcpResource"|"dataSourceBackupApplianceApplication"|undefined} sourceResource - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - */ - Object.defineProperty(DataSource.prototype, "sourceResource", { - get: $util.oneOfGetter($oneOfFields = ["dataSourceGcpResource", "dataSourceBackupApplianceApplication"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DataSource instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {google.cloud.backupdr.v1.IDataSource=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DataSource} DataSource instance - */ - DataSource.create = function create(properties) { - return new DataSource(properties); - }; - - /** - * Encodes the specified DataSource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.createTime != null && Object.hasOwnProperty.call(message, "createTime")) - $root.google.protobuf.Timestamp.encode(message.createTime, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.backupCount != null && Object.hasOwnProperty.call(message, "backupCount")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.backupCount); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.etag); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 21, wireType 0 =*/168).int32(message.state); - if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) - writer.uint32(/* id 23, wireType 0 =*/184).int64(message.totalStoredBytes); - if (message.configState != null && Object.hasOwnProperty.call(message, "configState")) - writer.uint32(/* id 24, wireType 0 =*/192).int32(message.configState); - if (message.backupConfigInfo != null && Object.hasOwnProperty.call(message, "backupConfigInfo")) - $root.google.cloud.backupdr.v1.BackupConfigInfo.encode(message.backupConfigInfo, writer.uint32(/* id 25, wireType 2 =*/202).fork()).ldelim(); - if (message.dataSourceGcpResource != null && Object.hasOwnProperty.call(message, "dataSourceGcpResource")) - $root.google.cloud.backupdr.v1.DataSourceGcpResource.encode(message.dataSourceGcpResource, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.dataSourceBackupApplianceApplication != null && Object.hasOwnProperty.call(message, "dataSourceBackupApplianceApplication")) - $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.encode(message.dataSourceBackupApplianceApplication, writer.uint32(/* id 27, wireType 2 =*/218).fork()).ldelim(); - if (message.backupBlockedByVaultAccessRestriction != null && Object.hasOwnProperty.call(message, "backupBlockedByVaultAccessRestriction")) - writer.uint32(/* id 28, wireType 0 =*/224).bool(message.backupBlockedByVaultAccessRestriction); - return writer; - }; - - /** - * Encodes the specified DataSource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {google.cloud.backupdr.v1.IDataSource} message DataSource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataSource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DataSource} DataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSource(), 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 21: { - message.state = reader.int32(); - break; - } - case 4: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 5: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 6: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.backupCount = reader.int64(); - break; - } - case 14: { - message.etag = reader.string(); - break; - } - case 23: { - message.totalStoredBytes = reader.int64(); - break; - } - case 24: { - message.configState = reader.int32(); - break; - } - case 25: { - message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.decode(reader, reader.uint32()); - break; - } - case 26: { - message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.decode(reader, reader.uint32()); - break; - } - case 27: { - message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.decode(reader, reader.uint32()); - break; - } - case 28: { - message.backupBlockedByVaultAccessRestriction = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataSource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DataSource} DataSource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataSource message. - * @function verify - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataSource.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.state != null && message.hasOwnProperty("state")) - switch (message.state) { - default: - return "state: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.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.createTime != null && message.hasOwnProperty("createTime")) { - properties._createTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - properties._updateTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.updateTime); - if (error) - return "updateTime." + error; - } - } - if (message.backupCount != null && message.hasOwnProperty("backupCount")) { - properties._backupCount = 1; - if (!$util.isInteger(message.backupCount) && !(message.backupCount && $util.isInteger(message.backupCount.low) && $util.isInteger(message.backupCount.high))) - return "backupCount: integer|Long expected"; - } - if (message.etag != null && message.hasOwnProperty("etag")) { - properties._etag = 1; - if (!$util.isString(message.etag)) - return "etag: string expected"; - } - if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { - properties._totalStoredBytes = 1; - if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) - return "totalStoredBytes: integer|Long expected"; - } - if (message.configState != null && message.hasOwnProperty("configState")) - switch (message.configState) { - default: - return "configState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) { - var error = $root.google.cloud.backupdr.v1.BackupConfigInfo.verify(message.backupConfigInfo); - if (error) - return "backupConfigInfo." + error; - } - if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { - properties.sourceResource = 1; - { - var error = $root.google.cloud.backupdr.v1.DataSourceGcpResource.verify(message.dataSourceGcpResource); - if (error) - return "dataSourceGcpResource." + error; - } - } - if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { - if (properties.sourceResource === 1) - return "sourceResource: multiple values"; - properties.sourceResource = 1; - { - var error = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify(message.dataSourceBackupApplianceApplication); - if (error) - return "dataSourceBackupApplianceApplication." + error; - } - } - if (message.backupBlockedByVaultAccessRestriction != null && message.hasOwnProperty("backupBlockedByVaultAccessRestriction")) - if (typeof message.backupBlockedByVaultAccessRestriction !== "boolean") - return "backupBlockedByVaultAccessRestriction: boolean expected"; - return null; - }; - - /** - * Creates a DataSource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DataSource} DataSource - */ - DataSource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DataSource) - return object; - var message = new $root.google.cloud.backupdr.v1.DataSource(); - 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 "CREATING": - case 1: - message.state = 1; - break; - case "ACTIVE": - case 2: - message.state = 2; - break; - case "DELETING": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSource.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.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSource.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.backupdr.v1.DataSource.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.backupCount != null) - if ($util.Long) - (message.backupCount = $util.Long.fromValue(object.backupCount)).unsigned = false; - else if (typeof object.backupCount === "string") - message.backupCount = parseInt(object.backupCount, 10); - else if (typeof object.backupCount === "number") - message.backupCount = object.backupCount; - else if (typeof object.backupCount === "object") - message.backupCount = new $util.LongBits(object.backupCount.low >>> 0, object.backupCount.high >>> 0).toNumber(); - if (object.etag != null) - message.etag = String(object.etag); - if (object.totalStoredBytes != null) - if ($util.Long) - (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; - else if (typeof object.totalStoredBytes === "string") - message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); - else if (typeof object.totalStoredBytes === "number") - message.totalStoredBytes = object.totalStoredBytes; - else if (typeof object.totalStoredBytes === "object") - message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); - switch (object.configState) { - default: - if (typeof object.configState === "number") { - message.configState = object.configState; - break; - } - break; - case "BACKUP_CONFIG_STATE_UNSPECIFIED": - case 0: - message.configState = 0; - break; - case "ACTIVE": - case 1: - message.configState = 1; - break; - case "PASSIVE": - case 2: - message.configState = 2; - break; - } - if (object.backupConfigInfo != null) { - if (typeof object.backupConfigInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSource.backupConfigInfo: object expected"); - message.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.fromObject(object.backupConfigInfo); - } - if (object.dataSourceGcpResource != null) { - if (typeof object.dataSourceGcpResource !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceGcpResource: object expected"); - message.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.fromObject(object.dataSourceGcpResource); - } - if (object.dataSourceBackupApplianceApplication != null) { - if (typeof object.dataSourceBackupApplianceApplication !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSource.dataSourceBackupApplianceApplication: object expected"); - message.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.fromObject(object.dataSourceBackupApplianceApplication); - } - if (object.backupBlockedByVaultAccessRestriction != null) - message.backupBlockedByVaultAccessRestriction = Boolean(object.backupBlockedByVaultAccessRestriction); - return message; - }; - - /** - * Creates a plain object from a DataSource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {google.cloud.backupdr.v1.DataSource} message DataSource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataSource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.configState = options.enums === String ? "BACKUP_CONFIG_STATE_UNSPECIFIED" : 0; - object.backupConfigInfo = null; - object.backupBlockedByVaultAccessRestriction = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - 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.createTime != null && message.hasOwnProperty("createTime")) { - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (options.oneofs) - object._createTime = "createTime"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object._updateTime = "updateTime"; - } - if (message.backupCount != null && message.hasOwnProperty("backupCount")) { - if (typeof message.backupCount === "number") - object.backupCount = options.longs === String ? String(message.backupCount) : message.backupCount; - else - object.backupCount = options.longs === String ? $util.Long.prototype.toString.call(message.backupCount) : options.longs === Number ? new $util.LongBits(message.backupCount.low >>> 0, message.backupCount.high >>> 0).toNumber() : message.backupCount; - if (options.oneofs) - object._backupCount = "backupCount"; - } - if (message.etag != null && message.hasOwnProperty("etag")) { - object.etag = message.etag; - if (options.oneofs) - object._etag = "etag"; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.DataSource.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.DataSource.State[message.state] : message.state; - if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { - if (typeof message.totalStoredBytes === "number") - object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; - else - object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; - if (options.oneofs) - object._totalStoredBytes = "totalStoredBytes"; - } - if (message.configState != null && message.hasOwnProperty("configState")) - object.configState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] === undefined ? message.configState : $root.google.cloud.backupdr.v1.BackupConfigState[message.configState] : message.configState; - if (message.backupConfigInfo != null && message.hasOwnProperty("backupConfigInfo")) - object.backupConfigInfo = $root.google.cloud.backupdr.v1.BackupConfigInfo.toObject(message.backupConfigInfo, options); - if (message.dataSourceGcpResource != null && message.hasOwnProperty("dataSourceGcpResource")) { - object.dataSourceGcpResource = $root.google.cloud.backupdr.v1.DataSourceGcpResource.toObject(message.dataSourceGcpResource, options); - if (options.oneofs) - object.sourceResource = "dataSourceGcpResource"; - } - if (message.dataSourceBackupApplianceApplication != null && message.hasOwnProperty("dataSourceBackupApplianceApplication")) { - object.dataSourceBackupApplianceApplication = $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.toObject(message.dataSourceBackupApplianceApplication, options); - if (options.oneofs) - object.sourceResource = "dataSourceBackupApplianceApplication"; - } - if (message.backupBlockedByVaultAccessRestriction != null && message.hasOwnProperty("backupBlockedByVaultAccessRestriction")) - object.backupBlockedByVaultAccessRestriction = message.backupBlockedByVaultAccessRestriction; - return object; - }; - - /** - * Converts this DataSource to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DataSource - * @instance - * @returns {Object.} JSON object - */ - DataSource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataSource - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DataSource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataSource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSource"; - }; - - /** - * State enum. - * @name google.cloud.backupdr.v1.DataSource.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} DELETING=3 DELETING value - * @property {number} ERROR=4 ERROR value - */ - DataSource.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] = "DELETING"] = 3; - values[valuesById[4] = "ERROR"] = 4; - return values; - })(); - - return DataSource; - })(); - - v1.BackupConfigInfo = (function() { - - /** - * Properties of a BackupConfigInfo. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupConfigInfo - * @property {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null} [lastBackupState] BackupConfigInfo lastBackupState - * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] BackupConfigInfo lastSuccessfulBackupConsistencyTime - * @property {google.rpc.IStatus|null} [lastBackupError] BackupConfigInfo lastBackupError - * @property {google.cloud.backupdr.v1.IGcpBackupConfig|null} [gcpBackupConfig] BackupConfigInfo gcpBackupConfig - * @property {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null} [backupApplianceBackupConfig] BackupConfigInfo backupApplianceBackupConfig - */ - - /** - * Constructs a new BackupConfigInfo. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupConfigInfo. - * @implements IBackupConfigInfo - * @constructor - * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set - */ - function BackupConfigInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupConfigInfo lastBackupState. - * @member {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState} lastBackupState - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - */ - BackupConfigInfo.prototype.lastBackupState = 0; - - /** - * BackupConfigInfo lastSuccessfulBackupConsistencyTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - */ - BackupConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; - - /** - * BackupConfigInfo lastBackupError. - * @member {google.rpc.IStatus|null|undefined} lastBackupError - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - */ - BackupConfigInfo.prototype.lastBackupError = null; - - /** - * BackupConfigInfo gcpBackupConfig. - * @member {google.cloud.backupdr.v1.IGcpBackupConfig|null|undefined} gcpBackupConfig - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - */ - BackupConfigInfo.prototype.gcpBackupConfig = null; - - /** - * BackupConfigInfo backupApplianceBackupConfig. - * @member {google.cloud.backupdr.v1.IBackupApplianceBackupConfig|null|undefined} backupApplianceBackupConfig - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - */ - BackupConfigInfo.prototype.backupApplianceBackupConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupConfigInfo backupConfig. - * @member {"gcpBackupConfig"|"backupApplianceBackupConfig"|undefined} backupConfig - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - */ - Object.defineProperty(BackupConfigInfo.prototype, "backupConfig", { - get: $util.oneOfGetter($oneOfFields = ["gcpBackupConfig", "backupApplianceBackupConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupConfigInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IBackupConfigInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo instance - */ - BackupConfigInfo.create = function create(properties) { - return new BackupConfigInfo(properties); - }; - - /** - * Encodes the specified BackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupConfigInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lastBackupState); - if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) - $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.lastBackupError != null && Object.hasOwnProperty.call(message, "lastBackupError")) - $root.google.rpc.Status.encode(message.lastBackupError, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.gcpBackupConfig != null && Object.hasOwnProperty.call(message, "gcpBackupConfig")) - $root.google.cloud.backupdr.v1.GcpBackupConfig.encode(message.gcpBackupConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.backupApplianceBackupConfig != null && Object.hasOwnProperty.call(message, "backupApplianceBackupConfig")) - $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.encode(message.backupApplianceBackupConfig, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IBackupConfigInfo} message BackupConfigInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupConfigInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupConfigInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.lastBackupState = reader.int32(); - break; - } - case 2: { - message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.lastBackupError = $root.google.rpc.Status.decode(reader, reader.uint32()); - break; - } - case 4: { - message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupConfigInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupConfigInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupConfigInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupConfigInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) - switch (message.lastBackupState) { - default: - return "lastBackupState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); - if (error) - return "lastSuccessfulBackupConsistencyTime." + error; - } - if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) { - var error = $root.google.rpc.Status.verify(message.lastBackupError); - if (error) - return "lastBackupError." + error; - } - if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { - properties.backupConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.GcpBackupConfig.verify(message.gcpBackupConfig); - if (error) - return "gcpBackupConfig." + error; - } - } - if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { - if (properties.backupConfig === 1) - return "backupConfig: multiple values"; - properties.backupConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify(message.backupApplianceBackupConfig); - if (error) - return "backupApplianceBackupConfig." + error; - } - } - return null; - }; - - /** - * Creates a BackupConfigInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupConfigInfo} BackupConfigInfo - */ - BackupConfigInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupConfigInfo(); - switch (object.lastBackupState) { - default: - if (typeof object.lastBackupState === "number") { - message.lastBackupState = object.lastBackupState; - break; - } - break; - case "LAST_BACKUP_STATE_UNSPECIFIED": - case 0: - message.lastBackupState = 0; - break; - case "FIRST_BACKUP_PENDING": - case 1: - message.lastBackupState = 1; - break; - case "SUCCEEDED": - case 2: - message.lastBackupState = 2; - break; - case "FAILED": - case 3: - message.lastBackupState = 3; - break; - case "PERMISSION_DENIED": - case 4: - message.lastBackupState = 4; - break; - } - if (object.lastSuccessfulBackupConsistencyTime != null) { - if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); - message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); - } - if (object.lastBackupError != null) { - if (typeof object.lastBackupError !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.lastBackupError: object expected"); - message.lastBackupError = $root.google.rpc.Status.fromObject(object.lastBackupError); - } - if (object.gcpBackupConfig != null) { - if (typeof object.gcpBackupConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.gcpBackupConfig: object expected"); - message.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.fromObject(object.gcpBackupConfig); - } - if (object.backupApplianceBackupConfig != null) { - if (typeof object.backupApplianceBackupConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigInfo.backupApplianceBackupConfig: object expected"); - message.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.fromObject(object.backupApplianceBackupConfig); - } - return message; - }; - - /** - * Creates a plain object from a BackupConfigInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.BackupConfigInfo} message BackupConfigInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupConfigInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; - object.lastSuccessfulBackupConsistencyTime = null; - object.lastBackupError = null; - } - if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) - object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; - if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) - object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); - if (message.lastBackupError != null && message.hasOwnProperty("lastBackupError")) - object.lastBackupError = $root.google.rpc.Status.toObject(message.lastBackupError, options); - if (message.gcpBackupConfig != null && message.hasOwnProperty("gcpBackupConfig")) { - object.gcpBackupConfig = $root.google.cloud.backupdr.v1.GcpBackupConfig.toObject(message.gcpBackupConfig, options); - if (options.oneofs) - object.backupConfig = "gcpBackupConfig"; - } - if (message.backupApplianceBackupConfig != null && message.hasOwnProperty("backupApplianceBackupConfig")) { - object.backupApplianceBackupConfig = $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig.toObject(message.backupApplianceBackupConfig, options); - if (options.oneofs) - object.backupConfig = "backupApplianceBackupConfig"; - } - return object; - }; - - /** - * Converts this BackupConfigInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @instance - * @returns {Object.} JSON object - */ - BackupConfigInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupConfigInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupConfigInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigInfo"; - }; - - /** - * LastBackupState enum. - * @name google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState - * @enum {number} - * @property {number} LAST_BACKUP_STATE_UNSPECIFIED=0 LAST_BACKUP_STATE_UNSPECIFIED value - * @property {number} FIRST_BACKUP_PENDING=1 FIRST_BACKUP_PENDING value - * @property {number} SUCCEEDED=2 SUCCEEDED value - * @property {number} FAILED=3 FAILED value - * @property {number} PERMISSION_DENIED=4 PERMISSION_DENIED value - */ - BackupConfigInfo.LastBackupState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "LAST_BACKUP_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "FIRST_BACKUP_PENDING"] = 1; - values[valuesById[2] = "SUCCEEDED"] = 2; - values[valuesById[3] = "FAILED"] = 3; - values[valuesById[4] = "PERMISSION_DENIED"] = 4; - return values; - })(); - - return BackupConfigInfo; - })(); - - v1.GcpBackupConfig = (function() { - - /** - * Properties of a GcpBackupConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IGcpBackupConfig - * @property {string|null} [backupPlan] GcpBackupConfig backupPlan - * @property {string|null} [backupPlanDescription] GcpBackupConfig backupPlanDescription - * @property {string|null} [backupPlanAssociation] GcpBackupConfig backupPlanAssociation - * @property {Array.|null} [backupPlanRules] GcpBackupConfig backupPlanRules - * @property {string|null} [backupPlanRevisionName] GcpBackupConfig backupPlanRevisionName - * @property {string|null} [backupPlanRevisionId] GcpBackupConfig backupPlanRevisionId - */ - - /** - * Constructs a new GcpBackupConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GcpBackupConfig. - * @implements IGcpBackupConfig - * @constructor - * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set - */ - function GcpBackupConfig(properties) { - this.backupPlanRules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcpBackupConfig backupPlan. - * @member {string} backupPlan - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - */ - GcpBackupConfig.prototype.backupPlan = ""; - - /** - * GcpBackupConfig backupPlanDescription. - * @member {string} backupPlanDescription - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - */ - GcpBackupConfig.prototype.backupPlanDescription = ""; - - /** - * GcpBackupConfig backupPlanAssociation. - * @member {string} backupPlanAssociation - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - */ - GcpBackupConfig.prototype.backupPlanAssociation = ""; - - /** - * GcpBackupConfig backupPlanRules. - * @member {Array.} backupPlanRules - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - */ - GcpBackupConfig.prototype.backupPlanRules = $util.emptyArray; - - /** - * GcpBackupConfig backupPlanRevisionName. - * @member {string} backupPlanRevisionName - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - */ - GcpBackupConfig.prototype.backupPlanRevisionName = ""; - - /** - * GcpBackupConfig backupPlanRevisionId. - * @member {string} backupPlanRevisionId - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - */ - GcpBackupConfig.prototype.backupPlanRevisionId = ""; - - /** - * Creates a new GcpBackupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IGcpBackupConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig instance - */ - GcpBackupConfig.create = function create(properties) { - return new GcpBackupConfig(properties); - }; - - /** - * Encodes the specified GcpBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcpBackupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); - if (message.backupPlanDescription != null && Object.hasOwnProperty.call(message, "backupPlanDescription")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanDescription); - if (message.backupPlanAssociation != null && Object.hasOwnProperty.call(message, "backupPlanAssociation")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanAssociation); - if (message.backupPlanRules != null && message.backupPlanRules.length) - for (var i = 0; i < message.backupPlanRules.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlanRules[i]); - if (message.backupPlanRevisionName != null && Object.hasOwnProperty.call(message, "backupPlanRevisionName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.backupPlanRevisionName); - if (message.backupPlanRevisionId != null && Object.hasOwnProperty.call(message, "backupPlanRevisionId")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.backupPlanRevisionId); - return writer; - }; - - /** - * Encodes the specified GcpBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpBackupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IGcpBackupConfig} message GcpBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcpBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcpBackupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcpBackupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupPlan = reader.string(); - break; - } - case 2: { - message.backupPlanDescription = reader.string(); - break; - } - case 3: { - message.backupPlanAssociation = reader.string(); - break; - } - case 4: { - if (!(message.backupPlanRules && message.backupPlanRules.length)) - message.backupPlanRules = []; - message.backupPlanRules.push(reader.string()); - break; - } - case 5: { - message.backupPlanRevisionName = reader.string(); - break; - } - case 6: { - message.backupPlanRevisionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcpBackupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcpBackupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcpBackupConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcpBackupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - if (!$util.isString(message.backupPlan)) - return "backupPlan: string expected"; - if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) - if (!$util.isString(message.backupPlanDescription)) - return "backupPlanDescription: string expected"; - if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) - if (!$util.isString(message.backupPlanAssociation)) - return "backupPlanAssociation: string expected"; - if (message.backupPlanRules != null && message.hasOwnProperty("backupPlanRules")) { - if (!Array.isArray(message.backupPlanRules)) - return "backupPlanRules: array expected"; - for (var i = 0; i < message.backupPlanRules.length; ++i) - if (!$util.isString(message.backupPlanRules[i])) - return "backupPlanRules: string[] expected"; - } - if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) - if (!$util.isString(message.backupPlanRevisionName)) - return "backupPlanRevisionName: string expected"; - if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) - if (!$util.isString(message.backupPlanRevisionId)) - return "backupPlanRevisionId: string expected"; - return null; - }; - - /** - * Creates a GcpBackupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GcpBackupConfig} GcpBackupConfig - */ - GcpBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GcpBackupConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.GcpBackupConfig(); - if (object.backupPlan != null) - message.backupPlan = String(object.backupPlan); - if (object.backupPlanDescription != null) - message.backupPlanDescription = String(object.backupPlanDescription); - if (object.backupPlanAssociation != null) - message.backupPlanAssociation = String(object.backupPlanAssociation); - if (object.backupPlanRules) { - if (!Array.isArray(object.backupPlanRules)) - throw TypeError(".google.cloud.backupdr.v1.GcpBackupConfig.backupPlanRules: array expected"); - message.backupPlanRules = []; - for (var i = 0; i < object.backupPlanRules.length; ++i) - message.backupPlanRules[i] = String(object.backupPlanRules[i]); - } - if (object.backupPlanRevisionName != null) - message.backupPlanRevisionName = String(object.backupPlanRevisionName); - if (object.backupPlanRevisionId != null) - message.backupPlanRevisionId = String(object.backupPlanRevisionId); - return message; - }; - - /** - * Creates a plain object from a GcpBackupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {google.cloud.backupdr.v1.GcpBackupConfig} message GcpBackupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcpBackupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupPlanRules = []; - if (options.defaults) { - object.backupPlan = ""; - object.backupPlanDescription = ""; - object.backupPlanAssociation = ""; - object.backupPlanRevisionName = ""; - object.backupPlanRevisionId = ""; - } - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - object.backupPlan = message.backupPlan; - if (message.backupPlanDescription != null && message.hasOwnProperty("backupPlanDescription")) - object.backupPlanDescription = message.backupPlanDescription; - if (message.backupPlanAssociation != null && message.hasOwnProperty("backupPlanAssociation")) - object.backupPlanAssociation = message.backupPlanAssociation; - if (message.backupPlanRules && message.backupPlanRules.length) { - object.backupPlanRules = []; - for (var j = 0; j < message.backupPlanRules.length; ++j) - object.backupPlanRules[j] = message.backupPlanRules[j]; - } - if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) - object.backupPlanRevisionName = message.backupPlanRevisionName; - if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) - object.backupPlanRevisionId = message.backupPlanRevisionId; - return object; - }; - - /** - * Converts this GcpBackupConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @instance - * @returns {Object.} JSON object - */ - GcpBackupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcpBackupConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GcpBackupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcpBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpBackupConfig"; - }; - - return GcpBackupConfig; - })(); - - v1.BackupApplianceBackupConfig = (function() { - - /** - * Properties of a BackupApplianceBackupConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupApplianceBackupConfig - * @property {string|null} [backupApplianceName] BackupApplianceBackupConfig backupApplianceName - * @property {number|Long|null} [backupApplianceId] BackupApplianceBackupConfig backupApplianceId - * @property {number|Long|null} [slaId] BackupApplianceBackupConfig slaId - * @property {string|null} [applicationName] BackupApplianceBackupConfig applicationName - * @property {string|null} [hostName] BackupApplianceBackupConfig hostName - * @property {string|null} [sltName] BackupApplianceBackupConfig sltName - * @property {string|null} [slpName] BackupApplianceBackupConfig slpName - */ - - /** - * Constructs a new BackupApplianceBackupConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupApplianceBackupConfig. - * @implements IBackupApplianceBackupConfig - * @constructor - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set - */ - function BackupApplianceBackupConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupApplianceBackupConfig backupApplianceName. - * @member {string} backupApplianceName - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.backupApplianceName = ""; - - /** - * BackupApplianceBackupConfig backupApplianceId. - * @member {number|Long} backupApplianceId - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BackupApplianceBackupConfig slaId. - * @member {number|Long} slaId - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.slaId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BackupApplianceBackupConfig applicationName. - * @member {string} applicationName - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.applicationName = ""; - - /** - * BackupApplianceBackupConfig hostName. - * @member {string} hostName - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.hostName = ""; - - /** - * BackupApplianceBackupConfig sltName. - * @member {string} sltName - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.sltName = ""; - - /** - * BackupApplianceBackupConfig slpName. - * @member {string} slpName - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - */ - BackupApplianceBackupConfig.prototype.slpName = ""; - - /** - * Creates a new BackupApplianceBackupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig instance - */ - BackupApplianceBackupConfig.create = function create(properties) { - return new BackupApplianceBackupConfig(properties); - }; - - /** - * Encodes the specified BackupApplianceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupApplianceBackupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupApplianceName); - if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.backupApplianceId); - if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.slaId); - if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.applicationName); - if (message.hostName != null && Object.hasOwnProperty.call(message, "hostName")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.hostName); - if (message.sltName != null && Object.hasOwnProperty.call(message, "sltName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.sltName); - if (message.slpName != null && Object.hasOwnProperty.call(message, "slpName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.slpName); - return writer; - }; - - /** - * Encodes the specified BackupApplianceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupConfig} message BackupApplianceBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupApplianceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupApplianceBackupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupApplianceName = reader.string(); - break; - } - case 2: { - message.backupApplianceId = reader.int64(); - break; - } - case 3: { - message.slaId = reader.int64(); - break; - } - case 4: { - message.applicationName = reader.string(); - break; - } - case 5: { - message.hostName = reader.string(); - break; - } - case 6: { - message.sltName = reader.string(); - break; - } - case 7: { - message.slpName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupApplianceBackupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupApplianceBackupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupApplianceBackupConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupApplianceBackupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) - if (!$util.isString(message.backupApplianceName)) - return "backupApplianceName: string expected"; - if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) - if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) - return "backupApplianceId: integer|Long expected"; - if (message.slaId != null && message.hasOwnProperty("slaId")) - if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) - return "slaId: integer|Long expected"; - if (message.applicationName != null && message.hasOwnProperty("applicationName")) - if (!$util.isString(message.applicationName)) - return "applicationName: string expected"; - if (message.hostName != null && message.hasOwnProperty("hostName")) - if (!$util.isString(message.hostName)) - return "hostName: string expected"; - if (message.sltName != null && message.hasOwnProperty("sltName")) - if (!$util.isString(message.sltName)) - return "sltName: string expected"; - if (message.slpName != null && message.hasOwnProperty("slpName")) - if (!$util.isString(message.slpName)) - return "slpName: string expected"; - return null; - }; - - /** - * Creates a BackupApplianceBackupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupConfig} BackupApplianceBackupConfig - */ - BackupApplianceBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupConfig(); - if (object.backupApplianceName != null) - message.backupApplianceName = String(object.backupApplianceName); - if (object.backupApplianceId != null) - if ($util.Long) - (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; - else if (typeof object.backupApplianceId === "string") - message.backupApplianceId = parseInt(object.backupApplianceId, 10); - else if (typeof object.backupApplianceId === "number") - message.backupApplianceId = object.backupApplianceId; - else if (typeof object.backupApplianceId === "object") - message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); - if (object.slaId != null) - if ($util.Long) - (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; - else if (typeof object.slaId === "string") - message.slaId = parseInt(object.slaId, 10); - else if (typeof object.slaId === "number") - message.slaId = object.slaId; - else if (typeof object.slaId === "object") - message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); - if (object.applicationName != null) - message.applicationName = String(object.applicationName); - if (object.hostName != null) - message.hostName = String(object.hostName); - if (object.sltName != null) - message.sltName = String(object.sltName); - if (object.slpName != null) - message.slpName = String(object.slpName); - return message; - }; - - /** - * Creates a plain object from a BackupApplianceBackupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.BackupApplianceBackupConfig} message BackupApplianceBackupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupApplianceBackupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupApplianceName = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backupApplianceId = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.slaId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.slaId = options.longs === String ? "0" : 0; - object.applicationName = ""; - object.hostName = ""; - object.sltName = ""; - object.slpName = ""; - } - if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) - object.backupApplianceName = message.backupApplianceName; - if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) - if (typeof message.backupApplianceId === "number") - object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; - else - object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; - if (message.slaId != null && message.hasOwnProperty("slaId")) - if (typeof message.slaId === "number") - object.slaId = options.longs === String ? String(message.slaId) : message.slaId; - else - object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; - if (message.applicationName != null && message.hasOwnProperty("applicationName")) - object.applicationName = message.applicationName; - if (message.hostName != null && message.hasOwnProperty("hostName")) - object.hostName = message.hostName; - if (message.sltName != null && message.hasOwnProperty("sltName")) - object.sltName = message.sltName; - if (message.slpName != null && message.hasOwnProperty("slpName")) - object.slpName = message.slpName; - return object; - }; - - /** - * Converts this BackupApplianceBackupConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @instance - * @returns {Object.} JSON object - */ - BackupApplianceBackupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupApplianceBackupConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupApplianceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupConfig"; - }; - - return BackupApplianceBackupConfig; - })(); - - v1.DataSourceGcpResource = (function() { - - /** - * Properties of a DataSourceGcpResource. - * @memberof google.cloud.backupdr.v1 - * @interface IDataSourceGcpResource - * @property {string|null} [gcpResourcename] DataSourceGcpResource gcpResourcename - * @property {string|null} [location] DataSourceGcpResource location - * @property {string|null} [type] DataSourceGcpResource type - * @property {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null} [computeInstanceDatasourceProperties] DataSourceGcpResource computeInstanceDatasourceProperties - * @property {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null} [cloudSqlInstanceDatasourceProperties] DataSourceGcpResource cloudSqlInstanceDatasourceProperties - * @property {google.cloud.backupdr.v1.IDiskDataSourceProperties|null} [diskDatasourceProperties] DataSourceGcpResource diskDatasourceProperties - */ - - /** - * Constructs a new DataSourceGcpResource. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DataSourceGcpResource. - * @implements IDataSourceGcpResource - * @constructor - * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set - */ - function DataSourceGcpResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataSourceGcpResource gcpResourcename. - * @member {string} gcpResourcename - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - DataSourceGcpResource.prototype.gcpResourcename = ""; - - /** - * DataSourceGcpResource location. - * @member {string} location - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - DataSourceGcpResource.prototype.location = ""; - - /** - * DataSourceGcpResource type. - * @member {string} type - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - DataSourceGcpResource.prototype.type = ""; - - /** - * DataSourceGcpResource computeInstanceDatasourceProperties. - * @member {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties|null|undefined} computeInstanceDatasourceProperties - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - DataSourceGcpResource.prototype.computeInstanceDatasourceProperties = null; - - /** - * DataSourceGcpResource cloudSqlInstanceDatasourceProperties. - * @member {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceProperties|null|undefined} cloudSqlInstanceDatasourceProperties - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - DataSourceGcpResource.prototype.cloudSqlInstanceDatasourceProperties = null; - - /** - * DataSourceGcpResource diskDatasourceProperties. - * @member {google.cloud.backupdr.v1.IDiskDataSourceProperties|null|undefined} diskDatasourceProperties - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - DataSourceGcpResource.prototype.diskDatasourceProperties = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DataSourceGcpResource gcpResourceProperties. - * @member {"computeInstanceDatasourceProperties"|"cloudSqlInstanceDatasourceProperties"|"diskDatasourceProperties"|undefined} gcpResourceProperties - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - */ - Object.defineProperty(DataSourceGcpResource.prototype, "gcpResourceProperties", { - get: $util.oneOfGetter($oneOfFields = ["computeInstanceDatasourceProperties", "cloudSqlInstanceDatasourceProperties", "diskDatasourceProperties"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DataSourceGcpResource instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {google.cloud.backupdr.v1.IDataSourceGcpResource=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource instance - */ - DataSourceGcpResource.create = function create(properties) { - return new DataSourceGcpResource(properties); - }; - - /** - * Encodes the specified DataSourceGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceGcpResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.computeInstanceDatasourceProperties != null && Object.hasOwnProperty.call(message, "computeInstanceDatasourceProperties")) - $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.encode(message.computeInstanceDatasourceProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.cloudSqlInstanceDatasourceProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceDatasourceProperties")) - $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.encode(message.cloudSqlInstanceDatasourceProperties, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.diskDatasourceProperties != null && Object.hasOwnProperty.call(message, "diskDatasourceProperties")) - $root.google.cloud.backupdr.v1.DiskDataSourceProperties.encode(message.diskDatasourceProperties, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataSourceGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {google.cloud.backupdr.v1.IDataSourceGcpResource} message DataSourceGcpResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceGcpResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataSourceGcpResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceGcpResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcpResourcename = reader.string(); - break; - } - case 2: { - message.location = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 4: { - message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.decode(reader, reader.uint32()); - break; - } - case 5: { - message.cloudSqlInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.decode(reader, reader.uint32()); - break; - } - case 7: { - message.diskDatasourceProperties = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataSourceGcpResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceGcpResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataSourceGcpResource message. - * @function verify - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataSourceGcpResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - if (!$util.isString(message.gcpResourcename)) - return "gcpResourcename: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { - properties.gcpResourceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify(message.computeInstanceDatasourceProperties); - if (error) - return "computeInstanceDatasourceProperties." + error; - } - } - if (message.cloudSqlInstanceDatasourceProperties != null && message.hasOwnProperty("cloudSqlInstanceDatasourceProperties")) { - if (properties.gcpResourceProperties === 1) - return "gcpResourceProperties: multiple values"; - properties.gcpResourceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.verify(message.cloudSqlInstanceDatasourceProperties); - if (error) - return "cloudSqlInstanceDatasourceProperties." + error; - } - } - if (message.diskDatasourceProperties != null && message.hasOwnProperty("diskDatasourceProperties")) { - if (properties.gcpResourceProperties === 1) - return "gcpResourceProperties: multiple values"; - properties.gcpResourceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.verify(message.diskDatasourceProperties); - if (error) - return "diskDatasourceProperties." + error; - } - } - return null; - }; - - /** - * Creates a DataSourceGcpResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DataSourceGcpResource} DataSourceGcpResource - */ - DataSourceGcpResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DataSourceGcpResource) - return object; - var message = new $root.google.cloud.backupdr.v1.DataSourceGcpResource(); - if (object.gcpResourcename != null) - message.gcpResourcename = String(object.gcpResourcename); - if (object.location != null) - message.location = String(object.location); - if (object.type != null) - message.type = String(object.type); - if (object.computeInstanceDatasourceProperties != null) { - if (typeof object.computeInstanceDatasourceProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.computeInstanceDatasourceProperties: object expected"); - message.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.fromObject(object.computeInstanceDatasourceProperties); - } - if (object.cloudSqlInstanceDatasourceProperties != null) { - if (typeof object.cloudSqlInstanceDatasourceProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.cloudSqlInstanceDatasourceProperties: object expected"); - message.cloudSqlInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.fromObject(object.cloudSqlInstanceDatasourceProperties); - } - if (object.diskDatasourceProperties != null) { - if (typeof object.diskDatasourceProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResource.diskDatasourceProperties: object expected"); - message.diskDatasourceProperties = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.fromObject(object.diskDatasourceProperties); - } - return message; - }; - - /** - * Creates a plain object from a DataSourceGcpResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {google.cloud.backupdr.v1.DataSourceGcpResource} message DataSourceGcpResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataSourceGcpResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcpResourcename = ""; - object.location = ""; - object.type = ""; - } - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - object.gcpResourcename = message.gcpResourcename; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.computeInstanceDatasourceProperties != null && message.hasOwnProperty("computeInstanceDatasourceProperties")) { - object.computeInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.toObject(message.computeInstanceDatasourceProperties, options); - if (options.oneofs) - object.gcpResourceProperties = "computeInstanceDatasourceProperties"; - } - if (message.cloudSqlInstanceDatasourceProperties != null && message.hasOwnProperty("cloudSqlInstanceDatasourceProperties")) { - object.cloudSqlInstanceDatasourceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceProperties.toObject(message.cloudSqlInstanceDatasourceProperties, options); - if (options.oneofs) - object.gcpResourceProperties = "cloudSqlInstanceDatasourceProperties"; - } - if (message.diskDatasourceProperties != null && message.hasOwnProperty("diskDatasourceProperties")) { - object.diskDatasourceProperties = $root.google.cloud.backupdr.v1.DiskDataSourceProperties.toObject(message.diskDatasourceProperties, options); - if (options.oneofs) - object.gcpResourceProperties = "diskDatasourceProperties"; - } - return object; - }; - - /** - * Converts this DataSourceGcpResource to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @instance - * @returns {Object.} JSON object - */ - DataSourceGcpResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataSourceGcpResource - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DataSourceGcpResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataSourceGcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceGcpResource"; - }; - - return DataSourceGcpResource; - })(); - - v1.DataSourceBackupApplianceApplication = (function() { - - /** - * Properties of a DataSourceBackupApplianceApplication. - * @memberof google.cloud.backupdr.v1 - * @interface IDataSourceBackupApplianceApplication - * @property {string|null} [applicationName] DataSourceBackupApplianceApplication applicationName - * @property {string|null} [backupAppliance] DataSourceBackupApplianceApplication backupAppliance - * @property {number|Long|null} [applianceId] DataSourceBackupApplianceApplication applianceId - * @property {string|null} [type] DataSourceBackupApplianceApplication type - * @property {number|Long|null} [applicationId] DataSourceBackupApplianceApplication applicationId - * @property {string|null} [hostname] DataSourceBackupApplianceApplication hostname - * @property {number|Long|null} [hostId] DataSourceBackupApplianceApplication hostId - */ - - /** - * Constructs a new DataSourceBackupApplianceApplication. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DataSourceBackupApplianceApplication. - * @implements IDataSourceBackupApplianceApplication - * @constructor - * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set - */ - function DataSourceBackupApplianceApplication(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataSourceBackupApplianceApplication applicationName. - * @member {string} applicationName - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.applicationName = ""; - - /** - * DataSourceBackupApplianceApplication backupAppliance. - * @member {string} backupAppliance - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.backupAppliance = ""; - - /** - * DataSourceBackupApplianceApplication applianceId. - * @member {number|Long} applianceId - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.applianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * DataSourceBackupApplianceApplication type. - * @member {string} type - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.type = ""; - - /** - * DataSourceBackupApplianceApplication applicationId. - * @member {number|Long} applicationId - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.applicationId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * DataSourceBackupApplianceApplication hostname. - * @member {string} hostname - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.hostname = ""; - - /** - * DataSourceBackupApplianceApplication hostId. - * @member {number|Long} hostId - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - */ - DataSourceBackupApplianceApplication.prototype.hostId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new DataSourceBackupApplianceApplication instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication instance - */ - DataSourceBackupApplianceApplication.create = function create(properties) { - return new DataSourceBackupApplianceApplication(properties); - }; - - /** - * Encodes the specified DataSourceBackupApplianceApplication message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceBackupApplianceApplication.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.applicationName != null && Object.hasOwnProperty.call(message, "applicationName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.applicationName); - if (message.backupAppliance != null && Object.hasOwnProperty.call(message, "backupAppliance")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupAppliance); - if (message.applianceId != null && Object.hasOwnProperty.call(message, "applianceId")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.applianceId); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.type); - if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.hostname); - if (message.hostId != null && Object.hasOwnProperty.call(message, "hostId")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.hostId); - if (message.applicationId != null && Object.hasOwnProperty.call(message, "applicationId")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.applicationId); - return writer; - }; - - /** - * Encodes the specified DataSourceBackupApplianceApplication message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupApplianceApplication.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {google.cloud.backupdr.v1.IDataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceBackupApplianceApplication.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceBackupApplianceApplication.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.applicationName = reader.string(); - break; - } - case 2: { - message.backupAppliance = reader.string(); - break; - } - case 3: { - message.applianceId = reader.int64(); - break; - } - case 4: { - message.type = reader.string(); - break; - } - case 8: { - message.applicationId = reader.int64(); - break; - } - case 6: { - message.hostname = reader.string(); - break; - } - case 7: { - message.hostId = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataSourceBackupApplianceApplication message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceBackupApplianceApplication.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataSourceBackupApplianceApplication message. - * @function verify - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataSourceBackupApplianceApplication.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.applicationName != null && message.hasOwnProperty("applicationName")) - if (!$util.isString(message.applicationName)) - return "applicationName: string expected"; - if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) - if (!$util.isString(message.backupAppliance)) - return "backupAppliance: string expected"; - if (message.applianceId != null && message.hasOwnProperty("applianceId")) - if (!$util.isInteger(message.applianceId) && !(message.applianceId && $util.isInteger(message.applianceId.low) && $util.isInteger(message.applianceId.high))) - return "applianceId: integer|Long expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.applicationId != null && message.hasOwnProperty("applicationId")) - if (!$util.isInteger(message.applicationId) && !(message.applicationId && $util.isInteger(message.applicationId.low) && $util.isInteger(message.applicationId.high))) - return "applicationId: integer|Long expected"; - if (message.hostname != null && message.hasOwnProperty("hostname")) - if (!$util.isString(message.hostname)) - return "hostname: string expected"; - if (message.hostId != null && message.hasOwnProperty("hostId")) - if (!$util.isInteger(message.hostId) && !(message.hostId && $util.isInteger(message.hostId.low) && $util.isInteger(message.hostId.high))) - return "hostId: integer|Long expected"; - return null; - }; - - /** - * Creates a DataSourceBackupApplianceApplication message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} DataSourceBackupApplianceApplication - */ - DataSourceBackupApplianceApplication.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication) - return object; - var message = new $root.google.cloud.backupdr.v1.DataSourceBackupApplianceApplication(); - if (object.applicationName != null) - message.applicationName = String(object.applicationName); - if (object.backupAppliance != null) - message.backupAppliance = String(object.backupAppliance); - if (object.applianceId != null) - if ($util.Long) - (message.applianceId = $util.Long.fromValue(object.applianceId)).unsigned = false; - else if (typeof object.applianceId === "string") - message.applianceId = parseInt(object.applianceId, 10); - else if (typeof object.applianceId === "number") - message.applianceId = object.applianceId; - else if (typeof object.applianceId === "object") - message.applianceId = new $util.LongBits(object.applianceId.low >>> 0, object.applianceId.high >>> 0).toNumber(); - if (object.type != null) - message.type = String(object.type); - if (object.applicationId != null) - if ($util.Long) - (message.applicationId = $util.Long.fromValue(object.applicationId)).unsigned = false; - else if (typeof object.applicationId === "string") - message.applicationId = parseInt(object.applicationId, 10); - else if (typeof object.applicationId === "number") - message.applicationId = object.applicationId; - else if (typeof object.applicationId === "object") - message.applicationId = new $util.LongBits(object.applicationId.low >>> 0, object.applicationId.high >>> 0).toNumber(); - if (object.hostname != null) - message.hostname = String(object.hostname); - if (object.hostId != null) - if ($util.Long) - (message.hostId = $util.Long.fromValue(object.hostId)).unsigned = false; - else if (typeof object.hostId === "string") - message.hostId = parseInt(object.hostId, 10); - else if (typeof object.hostId === "number") - message.hostId = object.hostId; - else if (typeof object.hostId === "object") - message.hostId = new $util.LongBits(object.hostId.low >>> 0, object.hostId.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a DataSourceBackupApplianceApplication message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {google.cloud.backupdr.v1.DataSourceBackupApplianceApplication} message DataSourceBackupApplianceApplication - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataSourceBackupApplianceApplication.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.applicationName = ""; - object.backupAppliance = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.applianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.applianceId = options.longs === String ? "0" : 0; - object.type = ""; - object.hostname = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.hostId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.hostId = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.applicationId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.applicationId = options.longs === String ? "0" : 0; - } - if (message.applicationName != null && message.hasOwnProperty("applicationName")) - object.applicationName = message.applicationName; - if (message.backupAppliance != null && message.hasOwnProperty("backupAppliance")) - object.backupAppliance = message.backupAppliance; - if (message.applianceId != null && message.hasOwnProperty("applianceId")) - if (typeof message.applianceId === "number") - object.applianceId = options.longs === String ? String(message.applianceId) : message.applianceId; - else - object.applianceId = options.longs === String ? $util.Long.prototype.toString.call(message.applianceId) : options.longs === Number ? new $util.LongBits(message.applianceId.low >>> 0, message.applianceId.high >>> 0).toNumber() : message.applianceId; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.hostname != null && message.hasOwnProperty("hostname")) - object.hostname = message.hostname; - if (message.hostId != null && message.hasOwnProperty("hostId")) - if (typeof message.hostId === "number") - object.hostId = options.longs === String ? String(message.hostId) : message.hostId; - else - object.hostId = options.longs === String ? $util.Long.prototype.toString.call(message.hostId) : options.longs === Number ? new $util.LongBits(message.hostId.low >>> 0, message.hostId.high >>> 0).toNumber() : message.hostId; - if (message.applicationId != null && message.hasOwnProperty("applicationId")) - if (typeof message.applicationId === "number") - object.applicationId = options.longs === String ? String(message.applicationId) : message.applicationId; - else - object.applicationId = options.longs === String ? $util.Long.prototype.toString.call(message.applicationId) : options.longs === Number ? new $util.LongBits(message.applicationId.low >>> 0, message.applicationId.high >>> 0).toNumber() : message.applicationId; - return object; - }; - - /** - * Converts this DataSourceBackupApplianceApplication to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @instance - * @returns {Object.} JSON object - */ - DataSourceBackupApplianceApplication.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataSourceBackupApplianceApplication - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DataSourceBackupApplianceApplication - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataSourceBackupApplianceApplication.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceBackupApplianceApplication"; - }; - - return DataSourceBackupApplianceApplication; - })(); - - v1.ServiceLockInfo = (function() { - - /** - * Properties of a ServiceLockInfo. - * @memberof google.cloud.backupdr.v1 - * @interface IServiceLockInfo - * @property {string|null} [operation] ServiceLockInfo operation - */ - - /** - * Constructs a new ServiceLockInfo. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ServiceLockInfo. - * @implements IServiceLockInfo - * @constructor - * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set - */ - function ServiceLockInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceLockInfo operation. - * @member {string} operation - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @instance - */ - ServiceLockInfo.prototype.operation = ""; - - /** - * Creates a new ServiceLockInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {google.cloud.backupdr.v1.IServiceLockInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo instance - */ - ServiceLockInfo.create = function create(properties) { - return new ServiceLockInfo(properties); - }; - - /** - * Encodes the specified ServiceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceLockInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.operation != null && Object.hasOwnProperty.call(message, "operation")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.operation); - return writer; - }; - - /** - * Encodes the specified ServiceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceLockInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {google.cloud.backupdr.v1.IServiceLockInfo} message ServiceLockInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceLockInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceLockInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.operation = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceLockInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceLockInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceLockInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceLockInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.operation != null && message.hasOwnProperty("operation")) - if (!$util.isString(message.operation)) - return "operation: string expected"; - return null; - }; - - /** - * Creates a ServiceLockInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ServiceLockInfo} ServiceLockInfo - */ - ServiceLockInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ServiceLockInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.ServiceLockInfo(); - if (object.operation != null) - message.operation = String(object.operation); - return message; - }; - - /** - * Creates a plain object from a ServiceLockInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {google.cloud.backupdr.v1.ServiceLockInfo} message ServiceLockInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceLockInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.operation = ""; - if (message.operation != null && message.hasOwnProperty("operation")) - object.operation = message.operation; - return object; - }; - - /** - * Converts this ServiceLockInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @instance - * @returns {Object.} JSON object - */ - ServiceLockInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceLockInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ServiceLockInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceLockInfo"; - }; - - return ServiceLockInfo; - })(); - - v1.BackupApplianceLockInfo = (function() { - - /** - * Properties of a BackupApplianceLockInfo. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupApplianceLockInfo - * @property {number|Long|null} [backupApplianceId] BackupApplianceLockInfo backupApplianceId - * @property {string|null} [backupApplianceName] BackupApplianceLockInfo backupApplianceName - * @property {string|null} [lockReason] BackupApplianceLockInfo lockReason - * @property {string|null} [jobName] BackupApplianceLockInfo jobName - * @property {string|null} [backupImage] BackupApplianceLockInfo backupImage - * @property {number|Long|null} [slaId] BackupApplianceLockInfo slaId - */ - - /** - * Constructs a new BackupApplianceLockInfo. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupApplianceLockInfo. - * @implements IBackupApplianceLockInfo - * @constructor - * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set - */ - function BackupApplianceLockInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupApplianceLockInfo backupApplianceId. - * @member {number|Long} backupApplianceId - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - BackupApplianceLockInfo.prototype.backupApplianceId = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * BackupApplianceLockInfo backupApplianceName. - * @member {string} backupApplianceName - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - BackupApplianceLockInfo.prototype.backupApplianceName = ""; - - /** - * BackupApplianceLockInfo lockReason. - * @member {string} lockReason - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - BackupApplianceLockInfo.prototype.lockReason = ""; - - /** - * BackupApplianceLockInfo jobName. - * @member {string|null|undefined} jobName - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - BackupApplianceLockInfo.prototype.jobName = null; - - /** - * BackupApplianceLockInfo backupImage. - * @member {string|null|undefined} backupImage - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - BackupApplianceLockInfo.prototype.backupImage = null; - - /** - * BackupApplianceLockInfo slaId. - * @member {number|Long|null|undefined} slaId - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - BackupApplianceLockInfo.prototype.slaId = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupApplianceLockInfo lockSource. - * @member {"jobName"|"backupImage"|"slaId"|undefined} lockSource - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - */ - Object.defineProperty(BackupApplianceLockInfo.prototype, "lockSource", { - get: $util.oneOfGetter($oneOfFields = ["jobName", "backupImage", "slaId"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupApplianceLockInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo instance - */ - BackupApplianceLockInfo.create = function create(properties) { - return new BackupApplianceLockInfo(properties); - }; - - /** - * Encodes the specified BackupApplianceLockInfo message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupApplianceLockInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupApplianceId != null && Object.hasOwnProperty.call(message, "backupApplianceId")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.backupApplianceId); - if (message.backupApplianceName != null && Object.hasOwnProperty.call(message, "backupApplianceName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupApplianceName); - if (message.lockReason != null && Object.hasOwnProperty.call(message, "lockReason")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.lockReason); - if (message.jobName != null && Object.hasOwnProperty.call(message, "jobName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.jobName); - if (message.backupImage != null && Object.hasOwnProperty.call(message, "backupImage")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.backupImage); - if (message.slaId != null && Object.hasOwnProperty.call(message, "slaId")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.slaId); - return writer; - }; - - /** - * Encodes the specified BackupApplianceLockInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceLockInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceLockInfo} message BackupApplianceLockInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupApplianceLockInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupApplianceLockInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupApplianceLockInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupApplianceId = reader.int64(); - break; - } - case 2: { - message.backupApplianceName = reader.string(); - break; - } - case 5: { - message.lockReason = reader.string(); - break; - } - case 6: { - message.jobName = reader.string(); - break; - } - case 7: { - message.backupImage = reader.string(); - break; - } - case 8: { - message.slaId = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupApplianceLockInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupApplianceLockInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupApplianceLockInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupApplianceLockInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) - if (!$util.isInteger(message.backupApplianceId) && !(message.backupApplianceId && $util.isInteger(message.backupApplianceId.low) && $util.isInteger(message.backupApplianceId.high))) - return "backupApplianceId: integer|Long expected"; - if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) - if (!$util.isString(message.backupApplianceName)) - return "backupApplianceName: string expected"; - if (message.lockReason != null && message.hasOwnProperty("lockReason")) - if (!$util.isString(message.lockReason)) - return "lockReason: string expected"; - if (message.jobName != null && message.hasOwnProperty("jobName")) { - properties.lockSource = 1; - if (!$util.isString(message.jobName)) - return "jobName: string expected"; - } - if (message.backupImage != null && message.hasOwnProperty("backupImage")) { - if (properties.lockSource === 1) - return "lockSource: multiple values"; - properties.lockSource = 1; - if (!$util.isString(message.backupImage)) - return "backupImage: string expected"; - } - if (message.slaId != null && message.hasOwnProperty("slaId")) { - if (properties.lockSource === 1) - return "lockSource: multiple values"; - properties.lockSource = 1; - if (!$util.isInteger(message.slaId) && !(message.slaId && $util.isInteger(message.slaId.low) && $util.isInteger(message.slaId.high))) - return "slaId: integer|Long expected"; - } - return null; - }; - - /** - * Creates a BackupApplianceLockInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupApplianceLockInfo} BackupApplianceLockInfo - */ - BackupApplianceLockInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceLockInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupApplianceLockInfo(); - if (object.backupApplianceId != null) - if ($util.Long) - (message.backupApplianceId = $util.Long.fromValue(object.backupApplianceId)).unsigned = false; - else if (typeof object.backupApplianceId === "string") - message.backupApplianceId = parseInt(object.backupApplianceId, 10); - else if (typeof object.backupApplianceId === "number") - message.backupApplianceId = object.backupApplianceId; - else if (typeof object.backupApplianceId === "object") - message.backupApplianceId = new $util.LongBits(object.backupApplianceId.low >>> 0, object.backupApplianceId.high >>> 0).toNumber(); - if (object.backupApplianceName != null) - message.backupApplianceName = String(object.backupApplianceName); - if (object.lockReason != null) - message.lockReason = String(object.lockReason); - if (object.jobName != null) - message.jobName = String(object.jobName); - if (object.backupImage != null) - message.backupImage = String(object.backupImage); - if (object.slaId != null) - if ($util.Long) - (message.slaId = $util.Long.fromValue(object.slaId)).unsigned = false; - else if (typeof object.slaId === "string") - message.slaId = parseInt(object.slaId, 10); - else if (typeof object.slaId === "number") - message.slaId = object.slaId; - else if (typeof object.slaId === "object") - message.slaId = new $util.LongBits(object.slaId.low >>> 0, object.slaId.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a BackupApplianceLockInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {google.cloud.backupdr.v1.BackupApplianceLockInfo} message BackupApplianceLockInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupApplianceLockInfo.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.backupApplianceId = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.backupApplianceId = options.longs === String ? "0" : 0; - object.backupApplianceName = ""; - object.lockReason = ""; - } - if (message.backupApplianceId != null && message.hasOwnProperty("backupApplianceId")) - if (typeof message.backupApplianceId === "number") - object.backupApplianceId = options.longs === String ? String(message.backupApplianceId) : message.backupApplianceId; - else - object.backupApplianceId = options.longs === String ? $util.Long.prototype.toString.call(message.backupApplianceId) : options.longs === Number ? new $util.LongBits(message.backupApplianceId.low >>> 0, message.backupApplianceId.high >>> 0).toNumber() : message.backupApplianceId; - if (message.backupApplianceName != null && message.hasOwnProperty("backupApplianceName")) - object.backupApplianceName = message.backupApplianceName; - if (message.lockReason != null && message.hasOwnProperty("lockReason")) - object.lockReason = message.lockReason; - if (message.jobName != null && message.hasOwnProperty("jobName")) { - object.jobName = message.jobName; - if (options.oneofs) - object.lockSource = "jobName"; - } - if (message.backupImage != null && message.hasOwnProperty("backupImage")) { - object.backupImage = message.backupImage; - if (options.oneofs) - object.lockSource = "backupImage"; - } - if (message.slaId != null && message.hasOwnProperty("slaId")) { - if (typeof message.slaId === "number") - object.slaId = options.longs === String ? String(message.slaId) : message.slaId; - else - object.slaId = options.longs === String ? $util.Long.prototype.toString.call(message.slaId) : options.longs === Number ? new $util.LongBits(message.slaId.low >>> 0, message.slaId.high >>> 0).toNumber() : message.slaId; - if (options.oneofs) - object.lockSource = "slaId"; - } - return object; - }; - - /** - * Converts this BackupApplianceLockInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @instance - * @returns {Object.} JSON object - */ - BackupApplianceLockInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupApplianceLockInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupApplianceLockInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupApplianceLockInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceLockInfo"; - }; - - return BackupApplianceLockInfo; - })(); - - v1.BackupLock = (function() { - - /** - * Properties of a BackupLock. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupLock - * @property {google.protobuf.ITimestamp|null} [lockUntilTime] BackupLock lockUntilTime - * @property {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null} [backupApplianceLockInfo] BackupLock backupApplianceLockInfo - * @property {google.cloud.backupdr.v1.IServiceLockInfo|null} [serviceLockInfo] BackupLock serviceLockInfo - */ - - /** - * Constructs a new BackupLock. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupLock. - * @implements IBackupLock - * @constructor - * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set - */ - function BackupLock(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupLock lockUntilTime. - * @member {google.protobuf.ITimestamp|null|undefined} lockUntilTime - * @memberof google.cloud.backupdr.v1.BackupLock - * @instance - */ - BackupLock.prototype.lockUntilTime = null; - - /** - * BackupLock backupApplianceLockInfo. - * @member {google.cloud.backupdr.v1.IBackupApplianceLockInfo|null|undefined} backupApplianceLockInfo - * @memberof google.cloud.backupdr.v1.BackupLock - * @instance - */ - BackupLock.prototype.backupApplianceLockInfo = null; - - /** - * BackupLock serviceLockInfo. - * @member {google.cloud.backupdr.v1.IServiceLockInfo|null|undefined} serviceLockInfo - * @memberof google.cloud.backupdr.v1.BackupLock - * @instance - */ - BackupLock.prototype.serviceLockInfo = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupLock ClientLockInfo. - * @member {"backupApplianceLockInfo"|"serviceLockInfo"|undefined} ClientLockInfo - * @memberof google.cloud.backupdr.v1.BackupLock - * @instance - */ - Object.defineProperty(BackupLock.prototype, "ClientLockInfo", { - get: $util.oneOfGetter($oneOfFields = ["backupApplianceLockInfo", "serviceLockInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupLock instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {google.cloud.backupdr.v1.IBackupLock=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock instance - */ - BackupLock.create = function create(properties) { - return new BackupLock(properties); - }; - - /** - * Encodes the specified BackupLock message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupLock.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lockUntilTime != null && Object.hasOwnProperty.call(message, "lockUntilTime")) - $root.google.protobuf.Timestamp.encode(message.lockUntilTime, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backupApplianceLockInfo != null && Object.hasOwnProperty.call(message, "backupApplianceLockInfo")) - $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.encode(message.backupApplianceLockInfo, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.serviceLockInfo != null && Object.hasOwnProperty.call(message, "serviceLockInfo")) - $root.google.cloud.backupdr.v1.ServiceLockInfo.encode(message.serviceLockInfo, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupLock message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLock.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {google.cloud.backupdr.v1.IBackupLock} message BackupLock message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupLock.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupLock message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupLock.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLock(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.lockUntilTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.decode(reader, reader.uint32()); - break; - } - case 4: { - message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupLock message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupLock.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupLock message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupLock.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lockUntilTime); - if (error) - return "lockUntilTime." + error; - } - if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { - properties.ClientLockInfo = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.verify(message.backupApplianceLockInfo); - if (error) - return "backupApplianceLockInfo." + error; - } - } - if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { - if (properties.ClientLockInfo === 1) - return "ClientLockInfo: multiple values"; - properties.ClientLockInfo = 1; - { - var error = $root.google.cloud.backupdr.v1.ServiceLockInfo.verify(message.serviceLockInfo); - if (error) - return "serviceLockInfo." + error; - } - } - return null; - }; - - /** - * Creates a BackupLock message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupLock} BackupLock - */ - BackupLock.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupLock) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupLock(); - if (object.lockUntilTime != null) { - if (typeof object.lockUntilTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupLock.lockUntilTime: object expected"); - message.lockUntilTime = $root.google.protobuf.Timestamp.fromObject(object.lockUntilTime); - } - if (object.backupApplianceLockInfo != null) { - if (typeof object.backupApplianceLockInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupLock.backupApplianceLockInfo: object expected"); - message.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.fromObject(object.backupApplianceLockInfo); - } - if (object.serviceLockInfo != null) { - if (typeof object.serviceLockInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupLock.serviceLockInfo: object expected"); - message.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.fromObject(object.serviceLockInfo); - } - return message; - }; - - /** - * Creates a plain object from a BackupLock message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {google.cloud.backupdr.v1.BackupLock} message BackupLock - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupLock.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.lockUntilTime = null; - if (message.lockUntilTime != null && message.hasOwnProperty("lockUntilTime")) - object.lockUntilTime = $root.google.protobuf.Timestamp.toObject(message.lockUntilTime, options); - if (message.backupApplianceLockInfo != null && message.hasOwnProperty("backupApplianceLockInfo")) { - object.backupApplianceLockInfo = $root.google.cloud.backupdr.v1.BackupApplianceLockInfo.toObject(message.backupApplianceLockInfo, options); - if (options.oneofs) - object.ClientLockInfo = "backupApplianceLockInfo"; - } - if (message.serviceLockInfo != null && message.hasOwnProperty("serviceLockInfo")) { - object.serviceLockInfo = $root.google.cloud.backupdr.v1.ServiceLockInfo.toObject(message.serviceLockInfo, options); - if (options.oneofs) - object.ClientLockInfo = "serviceLockInfo"; - } - return object; - }; - - /** - * Converts this BackupLock to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupLock - * @instance - * @returns {Object.} JSON object - */ - BackupLock.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupLock - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupLock - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupLock.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLock"; - }; - - return BackupLock; - })(); - - v1.Backup = (function() { - - /** - * Properties of a Backup. - * @memberof google.cloud.backupdr.v1 - * @interface IBackup - * @property {string|null} [name] Backup name - * @property {string|null} [description] Backup description - * @property {google.protobuf.ITimestamp|null} [createTime] Backup createTime - * @property {google.protobuf.ITimestamp|null} [updateTime] Backup updateTime - * @property {Object.|null} [labels] Backup labels - * @property {google.protobuf.ITimestamp|null} [enforcedRetentionEndTime] Backup enforcedRetentionEndTime - * @property {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null} [backupRetentionInheritance] Backup backupRetentionInheritance - * @property {google.protobuf.ITimestamp|null} [expireTime] Backup expireTime - * @property {google.protobuf.ITimestamp|null} [consistencyTime] Backup consistencyTime - * @property {string|null} [etag] Backup etag - * @property {google.cloud.backupdr.v1.Backup.State|null} [state] Backup state - * @property {Array.|null} [serviceLocks] Backup serviceLocks - * @property {Array.|null} [backupApplianceLocks] Backup backupApplianceLocks - * @property {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null} [computeInstanceBackupProperties] Backup computeInstanceBackupProperties - * @property {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null} [cloudSqlInstanceBackupProperties] Backup cloudSqlInstanceBackupProperties - * @property {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null} [backupApplianceBackupProperties] Backup backupApplianceBackupProperties - * @property {google.cloud.backupdr.v1.IDiskBackupProperties|null} [diskBackupProperties] Backup diskBackupProperties - * @property {google.cloud.backupdr.v1.Backup.BackupType|null} [backupType] Backup backupType - * @property {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null} [gcpBackupPlanInfo] Backup gcpBackupPlanInfo - * @property {number|Long|null} [resourceSizeBytes] Backup resourceSizeBytes - * @property {boolean|null} [satisfiesPzs] Backup satisfiesPzs - * @property {boolean|null} [satisfiesPzi] Backup satisfiesPzi - * @property {google.cloud.backupdr.v1.IBackupGcpResource|null} [gcpResource] Backup gcpResource - * @property {Array.|null} [kmsKeyVersions] Backup kmsKeyVersions - */ - - /** - * Constructs a new Backup. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a Backup. - * @implements IBackup - * @constructor - * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set - */ - function Backup(properties) { - this.labels = {}; - this.serviceLocks = []; - this.backupApplianceLocks = []; - this.kmsKeyVersions = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Backup name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.name = ""; - - /** - * Backup description. - * @member {string|null|undefined} description - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.description = null; - - /** - * Backup createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.createTime = null; - - /** - * Backup updateTime. - * @member {google.protobuf.ITimestamp|null|undefined} updateTime - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.updateTime = null; - - /** - * Backup labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.labels = $util.emptyObject; - - /** - * Backup enforcedRetentionEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} enforcedRetentionEndTime - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.enforcedRetentionEndTime = null; - - /** - * Backup backupRetentionInheritance. - * @member {google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance|null|undefined} backupRetentionInheritance - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.backupRetentionInheritance = null; - - /** - * Backup expireTime. - * @member {google.protobuf.ITimestamp|null|undefined} expireTime - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.expireTime = null; - - /** - * Backup consistencyTime. - * @member {google.protobuf.ITimestamp|null|undefined} consistencyTime - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.consistencyTime = null; - - /** - * Backup etag. - * @member {string|null|undefined} etag - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.etag = null; - - /** - * Backup state. - * @member {google.cloud.backupdr.v1.Backup.State} state - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.state = 0; - - /** - * Backup serviceLocks. - * @member {Array.} serviceLocks - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.serviceLocks = $util.emptyArray; - - /** - * Backup backupApplianceLocks. - * @member {Array.} backupApplianceLocks - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.backupApplianceLocks = $util.emptyArray; - - /** - * Backup computeInstanceBackupProperties. - * @member {google.cloud.backupdr.v1.IComputeInstanceBackupProperties|null|undefined} computeInstanceBackupProperties - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.computeInstanceBackupProperties = null; - - /** - * Backup cloudSqlInstanceBackupProperties. - * @member {google.cloud.backupdr.v1.ICloudSqlInstanceBackupProperties|null|undefined} cloudSqlInstanceBackupProperties - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.cloudSqlInstanceBackupProperties = null; - - /** - * Backup backupApplianceBackupProperties. - * @member {google.cloud.backupdr.v1.IBackupApplianceBackupProperties|null|undefined} backupApplianceBackupProperties - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.backupApplianceBackupProperties = null; - - /** - * Backup diskBackupProperties. - * @member {google.cloud.backupdr.v1.IDiskBackupProperties|null|undefined} diskBackupProperties - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.diskBackupProperties = null; - - /** - * Backup backupType. - * @member {google.cloud.backupdr.v1.Backup.BackupType} backupType - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.backupType = 0; - - /** - * Backup gcpBackupPlanInfo. - * @member {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo|null|undefined} gcpBackupPlanInfo - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.gcpBackupPlanInfo = null; - - /** - * Backup resourceSizeBytes. - * @member {number|Long} resourceSizeBytes - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.resourceSizeBytes = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Backup satisfiesPzs. - * @member {boolean|null|undefined} satisfiesPzs - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.satisfiesPzs = null; - - /** - * Backup satisfiesPzi. - * @member {boolean|null|undefined} satisfiesPzi - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.satisfiesPzi = null; - - /** - * Backup gcpResource. - * @member {google.cloud.backupdr.v1.IBackupGcpResource|null|undefined} gcpResource - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.gcpResource = null; - - /** - * Backup kmsKeyVersions. - * @member {Array.} kmsKeyVersions - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Backup.prototype.kmsKeyVersions = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_description", { - get: $util.oneOfGetter($oneOfFields = ["description"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_createTime", { - get: $util.oneOfGetter($oneOfFields = ["createTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_updateTime", { - get: $util.oneOfGetter($oneOfFields = ["updateTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_enforcedRetentionEndTime", { - get: $util.oneOfGetter($oneOfFields = ["enforcedRetentionEndTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_backupRetentionInheritance", { - get: $util.oneOfGetter($oneOfFields = ["backupRetentionInheritance"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_expireTime", { - get: $util.oneOfGetter($oneOfFields = ["expireTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_consistencyTime", { - get: $util.oneOfGetter($oneOfFields = ["consistencyTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_etag", { - get: $util.oneOfGetter($oneOfFields = ["etag"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Backup backupProperties. - * @member {"computeInstanceBackupProperties"|"cloudSqlInstanceBackupProperties"|"backupApplianceBackupProperties"|"diskBackupProperties"|undefined} backupProperties - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Object.defineProperty(Backup.prototype, "backupProperties", { - get: $util.oneOfGetter($oneOfFields = ["computeInstanceBackupProperties", "cloudSqlInstanceBackupProperties", "backupApplianceBackupProperties", "diskBackupProperties"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Backup planInfo. - * @member {"gcpBackupPlanInfo"|undefined} planInfo - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Object.defineProperty(Backup.prototype, "planInfo", { - get: $util.oneOfGetter($oneOfFields = ["gcpBackupPlanInfo"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_satisfiesPzs", { - get: $util.oneOfGetter($oneOfFields = ["satisfiesPzs"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Backup.prototype, "_satisfiesPzi", { - get: $util.oneOfGetter($oneOfFields = ["satisfiesPzi"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Backup sourceResource. - * @member {"gcpResource"|undefined} sourceResource - * @memberof google.cloud.backupdr.v1.Backup - * @instance - */ - Object.defineProperty(Backup.prototype, "sourceResource", { - get: $util.oneOfGetter($oneOfFields = ["gcpResource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Backup instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {google.cloud.backupdr.v1.IBackup=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Backup} Backup instance - */ - Backup.create = function create(properties) { - return new Backup(properties); - }; - - /** - * Encodes the specified Backup message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.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.updateTime != null && Object.hasOwnProperty.call(message, "updateTime")) - $root.google.protobuf.Timestamp.encode(message.updateTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.labels != null && Object.hasOwnProperty.call(message, "labels")) - for (var keys = Object.keys(message.labels), i = 0; i < keys.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.enforcedRetentionEndTime != null && Object.hasOwnProperty.call(message, "enforcedRetentionEndTime")) - $root.google.protobuf.Timestamp.encode(message.enforcedRetentionEndTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.expireTime != null && Object.hasOwnProperty.call(message, "expireTime")) - $root.google.protobuf.Timestamp.encode(message.expireTime, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.consistencyTime != null && Object.hasOwnProperty.call(message, "consistencyTime")) - $root.google.protobuf.Timestamp.encode(message.consistencyTime, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.etag); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 15, wireType 0 =*/120).int32(message.state); - if (message.serviceLocks != null && message.serviceLocks.length) - for (var i = 0; i < message.serviceLocks.length; ++i) - $root.google.cloud.backupdr.v1.BackupLock.encode(message.serviceLocks[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.backupApplianceLocks != null && message.backupApplianceLocks.length) - for (var i = 0; i < message.backupApplianceLocks.length; ++i) - $root.google.cloud.backupdr.v1.BackupLock.encode(message.backupApplianceLocks[i], writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.computeInstanceBackupProperties != null && Object.hasOwnProperty.call(message, "computeInstanceBackupProperties")) - $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.encode(message.computeInstanceBackupProperties, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.backupType != null && Object.hasOwnProperty.call(message, "backupType")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.backupType); - if (message.backupApplianceBackupProperties != null && Object.hasOwnProperty.call(message, "backupApplianceBackupProperties")) - $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.encode(message.backupApplianceBackupProperties, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.gcpBackupPlanInfo != null && Object.hasOwnProperty.call(message, "gcpBackupPlanInfo")) - $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.encode(message.gcpBackupPlanInfo, writer.uint32(/* id 22, wireType 2 =*/178).fork()).ldelim(); - if (message.resourceSizeBytes != null && Object.hasOwnProperty.call(message, "resourceSizeBytes")) - writer.uint32(/* id 23, wireType 0 =*/184).int64(message.resourceSizeBytes); - if (message.satisfiesPzs != null && Object.hasOwnProperty.call(message, "satisfiesPzs")) - writer.uint32(/* id 24, wireType 0 =*/192).bool(message.satisfiesPzs); - if (message.satisfiesPzi != null && Object.hasOwnProperty.call(message, "satisfiesPzi")) - writer.uint32(/* id 25, wireType 0 =*/200).bool(message.satisfiesPzi); - if (message.cloudSqlInstanceBackupProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceBackupProperties")) - $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.encode(message.cloudSqlInstanceBackupProperties, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - if (message.diskBackupProperties != null && Object.hasOwnProperty.call(message, "diskBackupProperties")) - $root.google.cloud.backupdr.v1.DiskBackupProperties.encode(message.diskBackupProperties, writer.uint32(/* id 28, wireType 2 =*/226).fork()).ldelim(); - if (message.backupRetentionInheritance != null && Object.hasOwnProperty.call(message, "backupRetentionInheritance")) - writer.uint32(/* id 30, wireType 0 =*/240).int32(message.backupRetentionInheritance); - if (message.gcpResource != null && Object.hasOwnProperty.call(message, "gcpResource")) - $root.google.cloud.backupdr.v1.BackupGcpResource.encode(message.gcpResource, writer.uint32(/* id 31, wireType 2 =*/250).fork()).ldelim(); - if (message.kmsKeyVersions != null && message.kmsKeyVersions.length) - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - writer.uint32(/* id 33, wireType 2 =*/266).string(message.kmsKeyVersions[i]); - return writer; - }; - - /** - * Encodes the specified Backup message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {google.cloud.backupdr.v1.IBackup} message Backup message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Backup.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Backup message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.updateTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 5: { - if (message.labels === $util.emptyObject) - message.labels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.labels[key] = value; - break; - } - case 6: { - message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 30: { - message.backupRetentionInheritance = reader.int32(); - break; - } - case 7: { - message.expireTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 9: { - message.consistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 11: { - message.etag = reader.string(); - break; - } - case 15: { - message.state = reader.int32(); - break; - } - case 17: { - if (!(message.serviceLocks && message.serviceLocks.length)) - message.serviceLocks = []; - message.serviceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); - break; - } - case 18: { - if (!(message.backupApplianceLocks && message.backupApplianceLocks.length)) - message.backupApplianceLocks = []; - message.backupApplianceLocks.push($root.google.cloud.backupdr.v1.BackupLock.decode(reader, reader.uint32())); - break; - } - case 19: { - message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.decode(reader, reader.uint32()); - break; - } - case 26: { - message.cloudSqlInstanceBackupProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.decode(reader, reader.uint32()); - break; - } - case 21: { - message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.decode(reader, reader.uint32()); - break; - } - case 28: { - message.diskBackupProperties = $root.google.cloud.backupdr.v1.DiskBackupProperties.decode(reader, reader.uint32()); - break; - } - case 20: { - message.backupType = reader.int32(); - break; - } - case 22: { - message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.decode(reader, reader.uint32()); - break; - } - case 23: { - message.resourceSizeBytes = reader.int64(); - break; - } - case 24: { - message.satisfiesPzs = reader.bool(); - break; - } - case 25: { - message.satisfiesPzi = reader.bool(); - break; - } - case 31: { - message.gcpResource = $root.google.cloud.backupdr.v1.BackupGcpResource.decode(reader, reader.uint32()); - break; - } - case 33: { - if (!(message.kmsKeyVersions && message.kmsKeyVersions.length)) - message.kmsKeyVersions = []; - message.kmsKeyVersions.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Backup message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Backup} Backup - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Backup.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Backup message. - * @function verify - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Backup.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")) { - properties._description = 1; - if (!$util.isString(message.description)) - return "description: string expected"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - properties._createTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.createTime); - if (error) - return "createTime." + error; - } - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - properties._updateTime = 1; - { - 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.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { - properties._enforcedRetentionEndTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.enforcedRetentionEndTime); - if (error) - return "enforcedRetentionEndTime." + error; - } - } - if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { - properties._backupRetentionInheritance = 1; - switch (message.backupRetentionInheritance) { - default: - return "backupRetentionInheritance: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - properties._expireTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.expireTime); - if (error) - return "expireTime." + error; - } - } - if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { - properties._consistencyTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.consistencyTime); - if (error) - return "consistencyTime." + error; - } - } - if (message.etag != null && message.hasOwnProperty("etag")) { - properties._etag = 1; - if (!$util.isString(message.etag)) - return "etag: 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.serviceLocks != null && message.hasOwnProperty("serviceLocks")) { - if (!Array.isArray(message.serviceLocks)) - return "serviceLocks: array expected"; - for (var i = 0; i < message.serviceLocks.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.serviceLocks[i]); - if (error) - return "serviceLocks." + error; - } - } - if (message.backupApplianceLocks != null && message.hasOwnProperty("backupApplianceLocks")) { - if (!Array.isArray(message.backupApplianceLocks)) - return "backupApplianceLocks: array expected"; - for (var i = 0; i < message.backupApplianceLocks.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupLock.verify(message.backupApplianceLocks[i]); - if (error) - return "backupApplianceLocks." + error; - } - } - if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { - properties.backupProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify(message.computeInstanceBackupProperties); - if (error) - return "computeInstanceBackupProperties." + error; - } - } - if (message.cloudSqlInstanceBackupProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupProperties")) { - if (properties.backupProperties === 1) - return "backupProperties: multiple values"; - properties.backupProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.verify(message.cloudSqlInstanceBackupProperties); - if (error) - return "cloudSqlInstanceBackupProperties." + error; - } - } - if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { - if (properties.backupProperties === 1) - return "backupProperties: multiple values"; - properties.backupProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify(message.backupApplianceBackupProperties); - if (error) - return "backupApplianceBackupProperties." + error; - } - } - if (message.diskBackupProperties != null && message.hasOwnProperty("diskBackupProperties")) { - if (properties.backupProperties === 1) - return "backupProperties: multiple values"; - properties.backupProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.DiskBackupProperties.verify(message.diskBackupProperties); - if (error) - return "diskBackupProperties." + error; - } - } - if (message.backupType != null && message.hasOwnProperty("backupType")) - switch (message.backupType) { - default: - return "backupType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { - properties.planInfo = 1; - { - var error = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify(message.gcpBackupPlanInfo); - if (error) - return "gcpBackupPlanInfo." + error; - } - } - if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) - if (!$util.isInteger(message.resourceSizeBytes) && !(message.resourceSizeBytes && $util.isInteger(message.resourceSizeBytes.low) && $util.isInteger(message.resourceSizeBytes.high))) - return "resourceSizeBytes: integer|Long expected"; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { - properties._satisfiesPzs = 1; - if (typeof message.satisfiesPzs !== "boolean") - return "satisfiesPzs: boolean expected"; - } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { - properties._satisfiesPzi = 1; - if (typeof message.satisfiesPzi !== "boolean") - return "satisfiesPzi: boolean expected"; - } - if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { - properties.sourceResource = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupGcpResource.verify(message.gcpResource); - if (error) - return "gcpResource." + error; - } - } - if (message.kmsKeyVersions != null && message.hasOwnProperty("kmsKeyVersions")) { - if (!Array.isArray(message.kmsKeyVersions)) - return "kmsKeyVersions: array expected"; - for (var i = 0; i < message.kmsKeyVersions.length; ++i) - if (!$util.isString(message.kmsKeyVersions[i])) - return "kmsKeyVersions: string[] expected"; - } - return null; - }; - - /** - * Creates a Backup message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Backup} Backup - */ - Backup.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Backup) - return object; - var message = new $root.google.cloud.backupdr.v1.Backup(); - 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.backupdr.v1.Backup.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.backupdr.v1.Backup.updateTime: object expected"); - message.updateTime = $root.google.protobuf.Timestamp.fromObject(object.updateTime); - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.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.enforcedRetentionEndTime != null) { - if (typeof object.enforcedRetentionEndTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.enforcedRetentionEndTime: object expected"); - message.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.fromObject(object.enforcedRetentionEndTime); - } - switch (object.backupRetentionInheritance) { - default: - if (typeof object.backupRetentionInheritance === "number") { - message.backupRetentionInheritance = object.backupRetentionInheritance; - break; - } - break; - case "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED": - case 0: - message.backupRetentionInheritance = 0; - break; - case "INHERIT_VAULT_RETENTION": - case 1: - message.backupRetentionInheritance = 1; - break; - case "MATCH_BACKUP_EXPIRE_TIME": - case 2: - message.backupRetentionInheritance = 2; - break; - } - if (object.expireTime != null) { - if (typeof object.expireTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.expireTime: object expected"); - message.expireTime = $root.google.protobuf.Timestamp.fromObject(object.expireTime); - } - if (object.consistencyTime != null) { - if (typeof object.consistencyTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.consistencyTime: object expected"); - message.consistencyTime = $root.google.protobuf.Timestamp.fromObject(object.consistencyTime); - } - if (object.etag != null) - message.etag = String(object.etag); - 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 "DELETING": - case 3: - message.state = 3; - break; - case "ERROR": - case 4: - message.state = 4; - break; - case "UPLOADING": - case 5: - message.state = 5; - break; - } - if (object.serviceLocks) { - if (!Array.isArray(object.serviceLocks)) - throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: array expected"); - message.serviceLocks = []; - for (var i = 0; i < object.serviceLocks.length; ++i) { - if (typeof object.serviceLocks[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.serviceLocks: object expected"); - message.serviceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.serviceLocks[i]); - } - } - if (object.backupApplianceLocks) { - if (!Array.isArray(object.backupApplianceLocks)) - throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: array expected"); - message.backupApplianceLocks = []; - for (var i = 0; i < object.backupApplianceLocks.length; ++i) { - if (typeof object.backupApplianceLocks[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceLocks: object expected"); - message.backupApplianceLocks[i] = $root.google.cloud.backupdr.v1.BackupLock.fromObject(object.backupApplianceLocks[i]); - } - } - if (object.computeInstanceBackupProperties != null) { - if (typeof object.computeInstanceBackupProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.computeInstanceBackupProperties: object expected"); - message.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.fromObject(object.computeInstanceBackupProperties); - } - if (object.cloudSqlInstanceBackupProperties != null) { - if (typeof object.cloudSqlInstanceBackupProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.cloudSqlInstanceBackupProperties: object expected"); - message.cloudSqlInstanceBackupProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.fromObject(object.cloudSqlInstanceBackupProperties); - } - if (object.backupApplianceBackupProperties != null) { - if (typeof object.backupApplianceBackupProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.backupApplianceBackupProperties: object expected"); - message.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.fromObject(object.backupApplianceBackupProperties); - } - if (object.diskBackupProperties != null) { - if (typeof object.diskBackupProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.diskBackupProperties: object expected"); - message.diskBackupProperties = $root.google.cloud.backupdr.v1.DiskBackupProperties.fromObject(object.diskBackupProperties); - } - switch (object.backupType) { - default: - if (typeof object.backupType === "number") { - message.backupType = object.backupType; - break; - } - break; - case "BACKUP_TYPE_UNSPECIFIED": - case 0: - message.backupType = 0; - break; - case "SCHEDULED": - case 1: - message.backupType = 1; - break; - case "ON_DEMAND": - case 2: - message.backupType = 2; - break; - case "ON_DEMAND_OPERATIONAL": - case 3: - message.backupType = 3; - break; - } - if (object.gcpBackupPlanInfo != null) { - if (typeof object.gcpBackupPlanInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.gcpBackupPlanInfo: object expected"); - message.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.fromObject(object.gcpBackupPlanInfo); - } - if (object.resourceSizeBytes != null) - if ($util.Long) - (message.resourceSizeBytes = $util.Long.fromValue(object.resourceSizeBytes)).unsigned = false; - else if (typeof object.resourceSizeBytes === "string") - message.resourceSizeBytes = parseInt(object.resourceSizeBytes, 10); - else if (typeof object.resourceSizeBytes === "number") - message.resourceSizeBytes = object.resourceSizeBytes; - else if (typeof object.resourceSizeBytes === "object") - message.resourceSizeBytes = new $util.LongBits(object.resourceSizeBytes.low >>> 0, object.resourceSizeBytes.high >>> 0).toNumber(); - if (object.satisfiesPzs != null) - message.satisfiesPzs = Boolean(object.satisfiesPzs); - if (object.satisfiesPzi != null) - message.satisfiesPzi = Boolean(object.satisfiesPzi); - if (object.gcpResource != null) { - if (typeof object.gcpResource !== "object") - throw TypeError(".google.cloud.backupdr.v1.Backup.gcpResource: object expected"); - message.gcpResource = $root.google.cloud.backupdr.v1.BackupGcpResource.fromObject(object.gcpResource); - } - if (object.kmsKeyVersions) { - if (!Array.isArray(object.kmsKeyVersions)) - throw TypeError(".google.cloud.backupdr.v1.Backup.kmsKeyVersions: array expected"); - message.kmsKeyVersions = []; - for (var i = 0; i < object.kmsKeyVersions.length; ++i) - message.kmsKeyVersions[i] = String(object.kmsKeyVersions[i]); - } - return message; - }; - - /** - * Creates a plain object from a Backup message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {google.cloud.backupdr.v1.Backup} message Backup - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Backup.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.serviceLocks = []; - object.backupApplianceLocks = []; - object.kmsKeyVersions = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (options.defaults) { - object.name = ""; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.backupType = options.enums === String ? "BACKUP_TYPE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.resourceSizeBytes = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.resourceSizeBytes = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) { - object.description = message.description; - if (options.oneofs) - object._description = "description"; - } - if (message.createTime != null && message.hasOwnProperty("createTime")) { - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (options.oneofs) - object._createTime = "createTime"; - } - if (message.updateTime != null && message.hasOwnProperty("updateTime")) { - object.updateTime = $root.google.protobuf.Timestamp.toObject(message.updateTime, options); - if (options.oneofs) - object._updateTime = "updateTime"; - } - 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.enforcedRetentionEndTime != null && message.hasOwnProperty("enforcedRetentionEndTime")) { - object.enforcedRetentionEndTime = $root.google.protobuf.Timestamp.toObject(message.enforcedRetentionEndTime, options); - if (options.oneofs) - object._enforcedRetentionEndTime = "enforcedRetentionEndTime"; - } - if (message.expireTime != null && message.hasOwnProperty("expireTime")) { - object.expireTime = $root.google.protobuf.Timestamp.toObject(message.expireTime, options); - if (options.oneofs) - object._expireTime = "expireTime"; - } - if (message.consistencyTime != null && message.hasOwnProperty("consistencyTime")) { - object.consistencyTime = $root.google.protobuf.Timestamp.toObject(message.consistencyTime, options); - if (options.oneofs) - object._consistencyTime = "consistencyTime"; - } - if (message.etag != null && message.hasOwnProperty("etag")) { - object.etag = message.etag; - if (options.oneofs) - object._etag = "etag"; - } - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.Backup.State[message.state] : message.state; - if (message.serviceLocks && message.serviceLocks.length) { - object.serviceLocks = []; - for (var j = 0; j < message.serviceLocks.length; ++j) - object.serviceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.serviceLocks[j], options); - } - if (message.backupApplianceLocks && message.backupApplianceLocks.length) { - object.backupApplianceLocks = []; - for (var j = 0; j < message.backupApplianceLocks.length; ++j) - object.backupApplianceLocks[j] = $root.google.cloud.backupdr.v1.BackupLock.toObject(message.backupApplianceLocks[j], options); - } - if (message.computeInstanceBackupProperties != null && message.hasOwnProperty("computeInstanceBackupProperties")) { - object.computeInstanceBackupProperties = $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties.toObject(message.computeInstanceBackupProperties, options); - if (options.oneofs) - object.backupProperties = "computeInstanceBackupProperties"; - } - if (message.backupType != null && message.hasOwnProperty("backupType")) - object.backupType = options.enums === String ? $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] === undefined ? message.backupType : $root.google.cloud.backupdr.v1.Backup.BackupType[message.backupType] : message.backupType; - if (message.backupApplianceBackupProperties != null && message.hasOwnProperty("backupApplianceBackupProperties")) { - object.backupApplianceBackupProperties = $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties.toObject(message.backupApplianceBackupProperties, options); - if (options.oneofs) - object.backupProperties = "backupApplianceBackupProperties"; - } - if (message.gcpBackupPlanInfo != null && message.hasOwnProperty("gcpBackupPlanInfo")) { - object.gcpBackupPlanInfo = $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.toObject(message.gcpBackupPlanInfo, options); - if (options.oneofs) - object.planInfo = "gcpBackupPlanInfo"; - } - if (message.resourceSizeBytes != null && message.hasOwnProperty("resourceSizeBytes")) - if (typeof message.resourceSizeBytes === "number") - object.resourceSizeBytes = options.longs === String ? String(message.resourceSizeBytes) : message.resourceSizeBytes; - else - object.resourceSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.resourceSizeBytes) : options.longs === Number ? new $util.LongBits(message.resourceSizeBytes.low >>> 0, message.resourceSizeBytes.high >>> 0).toNumber() : message.resourceSizeBytes; - if (message.satisfiesPzs != null && message.hasOwnProperty("satisfiesPzs")) { - object.satisfiesPzs = message.satisfiesPzs; - if (options.oneofs) - object._satisfiesPzs = "satisfiesPzs"; - } - if (message.satisfiesPzi != null && message.hasOwnProperty("satisfiesPzi")) { - object.satisfiesPzi = message.satisfiesPzi; - if (options.oneofs) - object._satisfiesPzi = "satisfiesPzi"; - } - if (message.cloudSqlInstanceBackupProperties != null && message.hasOwnProperty("cloudSqlInstanceBackupProperties")) { - object.cloudSqlInstanceBackupProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceBackupProperties.toObject(message.cloudSqlInstanceBackupProperties, options); - if (options.oneofs) - object.backupProperties = "cloudSqlInstanceBackupProperties"; - } - if (message.diskBackupProperties != null && message.hasOwnProperty("diskBackupProperties")) { - object.diskBackupProperties = $root.google.cloud.backupdr.v1.DiskBackupProperties.toObject(message.diskBackupProperties, options); - if (options.oneofs) - object.backupProperties = "diskBackupProperties"; - } - if (message.backupRetentionInheritance != null && message.hasOwnProperty("backupRetentionInheritance")) { - object.backupRetentionInheritance = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] === undefined ? message.backupRetentionInheritance : $root.google.cloud.backupdr.v1.BackupVault.BackupRetentionInheritance[message.backupRetentionInheritance] : message.backupRetentionInheritance; - if (options.oneofs) - object._backupRetentionInheritance = "backupRetentionInheritance"; - } - if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { - object.gcpResource = $root.google.cloud.backupdr.v1.BackupGcpResource.toObject(message.gcpResource, options); - if (options.oneofs) - object.sourceResource = "gcpResource"; - } - if (message.kmsKeyVersions && message.kmsKeyVersions.length) { - object.kmsKeyVersions = []; - for (var j = 0; j < message.kmsKeyVersions.length; ++j) - object.kmsKeyVersions[j] = message.kmsKeyVersions[j]; - } - return object; - }; - - /** - * Converts this Backup to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Backup - * @instance - * @returns {Object.} JSON object - */ - Backup.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Backup - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Backup - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Backup.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup"; - }; - - /** - * State enum. - * @name google.cloud.backupdr.v1.Backup.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} DELETING=3 DELETING value - * @property {number} ERROR=4 ERROR value - * @property {number} UPLOADING=5 UPLOADING value - */ - Backup.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] = "DELETING"] = 3; - values[valuesById[4] = "ERROR"] = 4; - values[valuesById[5] = "UPLOADING"] = 5; - return values; - })(); - - /** - * BackupType enum. - * @name google.cloud.backupdr.v1.Backup.BackupType - * @enum {number} - * @property {number} BACKUP_TYPE_UNSPECIFIED=0 BACKUP_TYPE_UNSPECIFIED value - * @property {number} SCHEDULED=1 SCHEDULED value - * @property {number} ON_DEMAND=2 ON_DEMAND value - * @property {number} ON_DEMAND_OPERATIONAL=3 ON_DEMAND_OPERATIONAL value - */ - Backup.BackupType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BACKUP_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCHEDULED"] = 1; - values[valuesById[2] = "ON_DEMAND"] = 2; - values[valuesById[3] = "ON_DEMAND_OPERATIONAL"] = 3; - return values; - })(); - - Backup.GCPBackupPlanInfo = (function() { - - /** - * Properties of a GCPBackupPlanInfo. - * @memberof google.cloud.backupdr.v1.Backup - * @interface IGCPBackupPlanInfo - * @property {string|null} [backupPlan] GCPBackupPlanInfo backupPlan - * @property {string|null} [backupPlanRuleId] GCPBackupPlanInfo backupPlanRuleId - * @property {string|null} [backupPlanRevisionName] GCPBackupPlanInfo backupPlanRevisionName - * @property {string|null} [backupPlanRevisionId] GCPBackupPlanInfo backupPlanRevisionId - */ - - /** - * Constructs a new GCPBackupPlanInfo. - * @memberof google.cloud.backupdr.v1.Backup - * @classdesc Represents a GCPBackupPlanInfo. - * @implements IGCPBackupPlanInfo - * @constructor - * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set - */ - function GCPBackupPlanInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GCPBackupPlanInfo backupPlan. - * @member {string} backupPlan - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @instance - */ - GCPBackupPlanInfo.prototype.backupPlan = ""; - - /** - * GCPBackupPlanInfo backupPlanRuleId. - * @member {string} backupPlanRuleId - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @instance - */ - GCPBackupPlanInfo.prototype.backupPlanRuleId = ""; - - /** - * GCPBackupPlanInfo backupPlanRevisionName. - * @member {string} backupPlanRevisionName - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @instance - */ - GCPBackupPlanInfo.prototype.backupPlanRevisionName = ""; - - /** - * GCPBackupPlanInfo backupPlanRevisionId. - * @member {string} backupPlanRevisionId - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @instance - */ - GCPBackupPlanInfo.prototype.backupPlanRevisionId = ""; - - /** - * Creates a new GCPBackupPlanInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo instance - */ - GCPBackupPlanInfo.create = function create(properties) { - return new GCPBackupPlanInfo(properties); - }; - - /** - * Encodes the specified GCPBackupPlanInfo message. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCPBackupPlanInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupPlan != null && Object.hasOwnProperty.call(message, "backupPlan")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupPlan); - if (message.backupPlanRuleId != null && Object.hasOwnProperty.call(message, "backupPlanRuleId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupPlanRuleId); - if (message.backupPlanRevisionName != null && Object.hasOwnProperty.call(message, "backupPlanRevisionName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.backupPlanRevisionName); - if (message.backupPlanRevisionId != null && Object.hasOwnProperty.call(message, "backupPlanRevisionId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.backupPlanRevisionId); - return writer; - }; - - /** - * Encodes the specified GCPBackupPlanInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {google.cloud.backupdr.v1.Backup.IGCPBackupPlanInfo} message GCPBackupPlanInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GCPBackupPlanInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GCPBackupPlanInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCPBackupPlanInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupPlan = reader.string(); - break; - } - case 2: { - message.backupPlanRuleId = reader.string(); - break; - } - case 3: { - message.backupPlanRevisionName = reader.string(); - break; - } - case 4: { - message.backupPlanRevisionId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GCPBackupPlanInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GCPBackupPlanInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GCPBackupPlanInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GCPBackupPlanInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - if (!$util.isString(message.backupPlan)) - return "backupPlan: string expected"; - if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) - if (!$util.isString(message.backupPlanRuleId)) - return "backupPlanRuleId: string expected"; - if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) - if (!$util.isString(message.backupPlanRevisionName)) - return "backupPlanRevisionName: string expected"; - if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) - if (!$util.isString(message.backupPlanRevisionId)) - return "backupPlanRevisionId: string expected"; - return null; - }; - - /** - * Creates a GCPBackupPlanInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} GCPBackupPlanInfo - */ - GCPBackupPlanInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo(); - if (object.backupPlan != null) - message.backupPlan = String(object.backupPlan); - if (object.backupPlanRuleId != null) - message.backupPlanRuleId = String(object.backupPlanRuleId); - if (object.backupPlanRevisionName != null) - message.backupPlanRevisionName = String(object.backupPlanRevisionName); - if (object.backupPlanRevisionId != null) - message.backupPlanRevisionId = String(object.backupPlanRevisionId); - return message; - }; - - /** - * Creates a plain object from a GCPBackupPlanInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo} message GCPBackupPlanInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GCPBackupPlanInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.backupPlan = ""; - object.backupPlanRuleId = ""; - object.backupPlanRevisionName = ""; - object.backupPlanRevisionId = ""; - } - if (message.backupPlan != null && message.hasOwnProperty("backupPlan")) - object.backupPlan = message.backupPlan; - if (message.backupPlanRuleId != null && message.hasOwnProperty("backupPlanRuleId")) - object.backupPlanRuleId = message.backupPlanRuleId; - if (message.backupPlanRevisionName != null && message.hasOwnProperty("backupPlanRevisionName")) - object.backupPlanRevisionName = message.backupPlanRevisionName; - if (message.backupPlanRevisionId != null && message.hasOwnProperty("backupPlanRevisionId")) - object.backupPlanRevisionId = message.backupPlanRevisionId; - return object; - }; - - /** - * Converts this GCPBackupPlanInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @instance - * @returns {Object.} JSON object - */ - GCPBackupPlanInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GCPBackupPlanInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GCPBackupPlanInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Backup.GCPBackupPlanInfo"; - }; - - return GCPBackupPlanInfo; - })(); - - return Backup; - })(); - - v1.CreateBackupVaultRequest = (function() { - - /** - * Properties of a CreateBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @interface ICreateBackupVaultRequest - * @property {string|null} [parent] CreateBackupVaultRequest parent - * @property {string|null} [backupVaultId] CreateBackupVaultRequest backupVaultId - * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] CreateBackupVaultRequest backupVault - * @property {string|null} [requestId] CreateBackupVaultRequest requestId - * @property {boolean|null} [validateOnly] CreateBackupVaultRequest validateOnly - */ - - /** - * Constructs a new CreateBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CreateBackupVaultRequest. - * @implements ICreateBackupVaultRequest - * @constructor - * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set - */ - function CreateBackupVaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CreateBackupVaultRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @instance - */ - CreateBackupVaultRequest.prototype.parent = ""; - - /** - * CreateBackupVaultRequest backupVaultId. - * @member {string} backupVaultId - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @instance - */ - CreateBackupVaultRequest.prototype.backupVaultId = ""; - - /** - * CreateBackupVaultRequest backupVault. - * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @instance - */ - CreateBackupVaultRequest.prototype.backupVault = null; - - /** - * CreateBackupVaultRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @instance - */ - CreateBackupVaultRequest.prototype.requestId = ""; - - /** - * CreateBackupVaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @instance - */ - CreateBackupVaultRequest.prototype.validateOnly = false; - - /** - * Creates a new CreateBackupVaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest instance - */ - CreateBackupVaultRequest.create = function create(properties) { - return new CreateBackupVaultRequest(properties); - }; - - /** - * Encodes the specified CreateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupVaultRequest.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.backupVaultId != null && Object.hasOwnProperty.call(message, "backupVaultId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupVaultId); - if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) - $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.requestId != null && Object.hasOwnProperty.call(message, "requestId")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.requestId); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - return writer; - }; - - /** - * Encodes the specified CreateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CreateBackupVaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.ICreateBackupVaultRequest} message CreateBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CreateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CreateBackupVaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupVaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); - 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.backupVaultId = reader.string(); - break; - } - case 3: { - message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); - break; - } - case 4: { - message.requestId = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CreateBackupVaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CreateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CreateBackupVaultRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CreateBackupVaultRequest.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.backupVaultId != null && message.hasOwnProperty("backupVaultId")) - if (!$util.isString(message.backupVaultId)) - return "backupVaultId: string expected"; - if (message.backupVault != null && message.hasOwnProperty("backupVault")) { - var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); - if (error) - return "backupVault." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - return null; - }; - - /** - * Creates a CreateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CreateBackupVaultRequest} CreateBackupVaultRequest - */ - CreateBackupVaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CreateBackupVaultRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.CreateBackupVaultRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.backupVaultId != null) - message.backupVaultId = String(object.backupVaultId); - if (object.backupVault != null) { - if (typeof object.backupVault !== "object") - throw TypeError(".google.cloud.backupdr.v1.CreateBackupVaultRequest.backupVault: object expected"); - message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - return message; - }; - - /** - * Creates a plain object from a CreateBackupVaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.CreateBackupVaultRequest} message CreateBackupVaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CreateBackupVaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.backupVaultId = ""; - object.backupVault = null; - object.requestId = ""; - object.validateOnly = false; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.backupVaultId != null && message.hasOwnProperty("backupVaultId")) - object.backupVaultId = message.backupVaultId; - if (message.backupVault != null && message.hasOwnProperty("backupVault")) - object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - return object; - }; - - /** - * Converts this CreateBackupVaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @instance - * @returns {Object.} JSON object - */ - CreateBackupVaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CreateBackupVaultRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CreateBackupVaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CreateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CreateBackupVaultRequest"; - }; - - return CreateBackupVaultRequest; - })(); - - v1.ListBackupVaultsRequest = (function() { - - /** - * Properties of a ListBackupVaultsRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupVaultsRequest - * @property {string|null} [parent] ListBackupVaultsRequest parent - * @property {number|null} [pageSize] ListBackupVaultsRequest pageSize - * @property {string|null} [pageToken] ListBackupVaultsRequest pageToken - * @property {string|null} [filter] ListBackupVaultsRequest filter - * @property {string|null} [orderBy] ListBackupVaultsRequest orderBy - * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] ListBackupVaultsRequest view - */ - - /** - * Constructs a new ListBackupVaultsRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupVaultsRequest. - * @implements IListBackupVaultsRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set - */ - function ListBackupVaultsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupVaultsRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - */ - ListBackupVaultsRequest.prototype.parent = ""; - - /** - * ListBackupVaultsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - */ - ListBackupVaultsRequest.prototype.pageSize = 0; - - /** - * ListBackupVaultsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - */ - ListBackupVaultsRequest.prototype.pageToken = ""; - - /** - * ListBackupVaultsRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - */ - ListBackupVaultsRequest.prototype.filter = ""; - - /** - * ListBackupVaultsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - */ - ListBackupVaultsRequest.prototype.orderBy = ""; - - /** - * ListBackupVaultsRequest view. - * @member {google.cloud.backupdr.v1.BackupVaultView} view - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - */ - ListBackupVaultsRequest.prototype.view = 0; - - /** - * Creates a new ListBackupVaultsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest instance - */ - ListBackupVaultsRequest.create = function create(properties) { - return new ListBackupVaultsRequest(properties); - }; - - /** - * Encodes the specified ListBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupVaultsRequest.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); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); - return writer; - }; - - /** - * Encodes the specified ListBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupVaultsRequest} message ListBackupVaultsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupVaultsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupVaultsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); - 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; - } - case 6: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupVaultsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupVaultsRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupVaultsRequest.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"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ListBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupVaultsRequest} ListBackupVaultsRequest - */ - ListBackupVaultsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsRequest(); - 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); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "BACKUP_VAULT_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BACKUP_VAULT_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "BACKUP_VAULT_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListBackupVaultsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.ListBackupVaultsRequest} message ListBackupVaultsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupVaultsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; - } - 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; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; - return object; - }; - - /** - * Converts this ListBackupVaultsRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupVaultsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupVaultsRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupVaultsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsRequest"; - }; - - return ListBackupVaultsRequest; - })(); - - v1.ListBackupVaultsResponse = (function() { - - /** - * Properties of a ListBackupVaultsResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupVaultsResponse - * @property {Array.|null} [backupVaults] ListBackupVaultsResponse backupVaults - * @property {string|null} [nextPageToken] ListBackupVaultsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupVaultsResponse unreachable - */ - - /** - * Constructs a new ListBackupVaultsResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupVaultsResponse. - * @implements IListBackupVaultsResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set - */ - function ListBackupVaultsResponse(properties) { - this.backupVaults = []; - 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]]; - } - - /** - * ListBackupVaultsResponse backupVaults. - * @member {Array.} backupVaults - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @instance - */ - ListBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; - - /** - * ListBackupVaultsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @instance - */ - ListBackupVaultsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupVaultsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @instance - */ - ListBackupVaultsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupVaultsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse instance - */ - ListBackupVaultsResponse.create = function create(properties) { - return new ListBackupVaultsResponse(properties); - }; - - /** - * Encodes the specified ListBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupVaultsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupVaults != null && message.backupVaults.length) - for (var i = 0; i < message.backupVaults.length; ++i) - $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[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 ListBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupVaultsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupVaultsResponse} message ListBackupVaultsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupVaultsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupVaultsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupVaults && message.backupVaults.length)) - message.backupVaults = []; - message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.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 ListBackupVaultsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupVaultsResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupVaultsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { - if (!Array.isArray(message.backupVaults)) - return "backupVaults: array expected"; - for (var i = 0; i < message.backupVaults.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); - if (error) - return "backupVaults." + 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 ListBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupVaultsResponse} ListBackupVaultsResponse - */ - ListBackupVaultsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupVaultsResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupVaultsResponse(); - if (object.backupVaults) { - if (!Array.isArray(object.backupVaults)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: array expected"); - message.backupVaults = []; - for (var i = 0; i < object.backupVaults.length; ++i) { - if (typeof object.backupVaults[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.backupVaults: object expected"); - message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupVaultsResponse.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 ListBackupVaultsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.ListBackupVaultsResponse} message ListBackupVaultsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupVaultsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backupVaults = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backupVaults && message.backupVaults.length) { - object.backupVaults = []; - for (var j = 0; j < message.backupVaults.length; ++j) - object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[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 ListBackupVaultsResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupVaultsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupVaultsResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupVaultsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupVaultsResponse"; - }; - - return ListBackupVaultsResponse; - })(); - - v1.FetchUsableBackupVaultsRequest = (function() { - - /** - * Properties of a FetchUsableBackupVaultsRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchUsableBackupVaultsRequest - * @property {string|null} [parent] FetchUsableBackupVaultsRequest parent - * @property {number|null} [pageSize] FetchUsableBackupVaultsRequest pageSize - * @property {string|null} [pageToken] FetchUsableBackupVaultsRequest pageToken - * @property {string|null} [filter] FetchUsableBackupVaultsRequest filter - * @property {string|null} [orderBy] FetchUsableBackupVaultsRequest orderBy - */ - - /** - * Constructs a new FetchUsableBackupVaultsRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchUsableBackupVaultsRequest. - * @implements IFetchUsableBackupVaultsRequest - * @constructor - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set - */ - function FetchUsableBackupVaultsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchUsableBackupVaultsRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @instance - */ - FetchUsableBackupVaultsRequest.prototype.parent = ""; - - /** - * FetchUsableBackupVaultsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @instance - */ - FetchUsableBackupVaultsRequest.prototype.pageSize = 0; - - /** - * FetchUsableBackupVaultsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @instance - */ - FetchUsableBackupVaultsRequest.prototype.pageToken = ""; - - /** - * FetchUsableBackupVaultsRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @instance - */ - FetchUsableBackupVaultsRequest.prototype.filter = ""; - - /** - * FetchUsableBackupVaultsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @instance - */ - FetchUsableBackupVaultsRequest.prototype.orderBy = ""; - - /** - * Creates a new FetchUsableBackupVaultsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest instance - */ - FetchUsableBackupVaultsRequest.create = function create(properties) { - return new FetchUsableBackupVaultsRequest(properties); - }; - - /** - * Encodes the specified FetchUsableBackupVaultsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchUsableBackupVaultsRequest.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 FetchUsableBackupVaultsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchUsableBackupVaultsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchUsableBackupVaultsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchUsableBackupVaultsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); - 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 FetchUsableBackupVaultsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchUsableBackupVaultsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchUsableBackupVaultsRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchUsableBackupVaultsRequest.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 FetchUsableBackupVaultsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} FetchUsableBackupVaultsRequest - */ - FetchUsableBackupVaultsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest(); - 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 FetchUsableBackupVaultsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest} message FetchUsableBackupVaultsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchUsableBackupVaultsRequest.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 FetchUsableBackupVaultsRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @instance - * @returns {Object.} JSON object - */ - FetchUsableBackupVaultsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchUsableBackupVaultsRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchUsableBackupVaultsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest"; - }; - - return FetchUsableBackupVaultsRequest; - })(); - - v1.FetchUsableBackupVaultsResponse = (function() { - - /** - * Properties of a FetchUsableBackupVaultsResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchUsableBackupVaultsResponse - * @property {Array.|null} [backupVaults] FetchUsableBackupVaultsResponse backupVaults - * @property {string|null} [nextPageToken] FetchUsableBackupVaultsResponse nextPageToken - * @property {Array.|null} [unreachable] FetchUsableBackupVaultsResponse unreachable - */ - - /** - * Constructs a new FetchUsableBackupVaultsResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchUsableBackupVaultsResponse. - * @implements IFetchUsableBackupVaultsResponse - * @constructor - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set - */ - function FetchUsableBackupVaultsResponse(properties) { - this.backupVaults = []; - 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]]; - } - - /** - * FetchUsableBackupVaultsResponse backupVaults. - * @member {Array.} backupVaults - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @instance - */ - FetchUsableBackupVaultsResponse.prototype.backupVaults = $util.emptyArray; - - /** - * FetchUsableBackupVaultsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @instance - */ - FetchUsableBackupVaultsResponse.prototype.nextPageToken = ""; - - /** - * FetchUsableBackupVaultsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @instance - */ - FetchUsableBackupVaultsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new FetchUsableBackupVaultsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse instance - */ - FetchUsableBackupVaultsResponse.create = function create(properties) { - return new FetchUsableBackupVaultsResponse(properties); - }; - - /** - * Encodes the specified FetchUsableBackupVaultsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchUsableBackupVaultsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupVaults != null && message.backupVaults.length) - for (var i = 0; i < message.backupVaults.length; ++i) - $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVaults[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 FetchUsableBackupVaultsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchUsableBackupVaultsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchUsableBackupVaultsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchUsableBackupVaultsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupVaults && message.backupVaults.length)) - message.backupVaults = []; - message.backupVaults.push($root.google.cloud.backupdr.v1.BackupVault.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 FetchUsableBackupVaultsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchUsableBackupVaultsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchUsableBackupVaultsResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchUsableBackupVaultsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupVaults != null && message.hasOwnProperty("backupVaults")) { - if (!Array.isArray(message.backupVaults)) - return "backupVaults: array expected"; - for (var i = 0; i < message.backupVaults.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVaults[i]); - if (error) - return "backupVaults." + 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 FetchUsableBackupVaultsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} FetchUsableBackupVaultsResponse - */ - FetchUsableBackupVaultsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse(); - if (object.backupVaults) { - if (!Array.isArray(object.backupVaults)) - throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: array expected"); - message.backupVaults = []; - for (var i = 0; i < object.backupVaults.length; ++i) { - if (typeof object.backupVaults[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.backupVaults: object expected"); - message.backupVaults[i] = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVaults[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse.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 FetchUsableBackupVaultsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse} message FetchUsableBackupVaultsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchUsableBackupVaultsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backupVaults = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backupVaults && message.backupVaults.length) { - object.backupVaults = []; - for (var j = 0; j < message.backupVaults.length; ++j) - object.backupVaults[j] = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVaults[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 FetchUsableBackupVaultsResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @instance - * @returns {Object.} JSON object - */ - FetchUsableBackupVaultsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchUsableBackupVaultsResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchUsableBackupVaultsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchUsableBackupVaultsResponse"; - }; - - return FetchUsableBackupVaultsResponse; - })(); - - v1.FetchBackupsForResourceTypeRequest = (function() { - - /** - * Properties of a FetchBackupsForResourceTypeRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchBackupsForResourceTypeRequest - * @property {string|null} [parent] FetchBackupsForResourceTypeRequest parent - * @property {string|null} [resourceType] FetchBackupsForResourceTypeRequest resourceType - * @property {number|null} [pageSize] FetchBackupsForResourceTypeRequest pageSize - * @property {string|null} [pageToken] FetchBackupsForResourceTypeRequest pageToken - * @property {string|null} [filter] FetchBackupsForResourceTypeRequest filter - * @property {string|null} [orderBy] FetchBackupsForResourceTypeRequest orderBy - * @property {google.cloud.backupdr.v1.BackupView|null} [view] FetchBackupsForResourceTypeRequest view - */ - - /** - * Constructs a new FetchBackupsForResourceTypeRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchBackupsForResourceTypeRequest. - * @implements IFetchBackupsForResourceTypeRequest - * @constructor - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest=} [properties] Properties to set - */ - function FetchBackupsForResourceTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchBackupsForResourceTypeRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.parent = ""; - - /** - * FetchBackupsForResourceTypeRequest resourceType. - * @member {string} resourceType - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.resourceType = ""; - - /** - * FetchBackupsForResourceTypeRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.pageSize = 0; - - /** - * FetchBackupsForResourceTypeRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.pageToken = ""; - - /** - * FetchBackupsForResourceTypeRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.filter = ""; - - /** - * FetchBackupsForResourceTypeRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.orderBy = ""; - - /** - * FetchBackupsForResourceTypeRequest view. - * @member {google.cloud.backupdr.v1.BackupView} view - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - */ - FetchBackupsForResourceTypeRequest.prototype.view = 0; - - /** - * Creates a new FetchBackupsForResourceTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest instance - */ - FetchBackupsForResourceTypeRequest.create = function create(properties) { - return new FetchBackupsForResourceTypeRequest(properties); - }; - - /** - * Encodes the specified FetchBackupsForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} message FetchBackupsForResourceTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupsForResourceTypeRequest.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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.view); - return writer; - }; - - /** - * Encodes the specified FetchBackupsForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest} message FetchBackupsForResourceTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupsForResourceTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupsForResourceTypeRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest(); - 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.resourceType = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.filter = reader.string(); - break; - } - case 6: { - message.orderBy = reader.string(); - break; - } - case 7: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchBackupsForResourceTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupsForResourceTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchBackupsForResourceTypeRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchBackupsForResourceTypeRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: 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"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a FetchBackupsForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} FetchBackupsForResourceTypeRequest - */ - FetchBackupsForResourceTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - 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); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "BACKUP_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BACKUP_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "BACKUP_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a FetchBackupsForResourceTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest} message FetchBackupsForResourceTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchBackupsForResourceTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceType = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - 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; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; - return object; - }; - - /** - * Converts this FetchBackupsForResourceTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @instance - * @returns {Object.} JSON object - */ - FetchBackupsForResourceTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchBackupsForResourceTypeRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchBackupsForResourceTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest"; - }; - - return FetchBackupsForResourceTypeRequest; - })(); - - v1.FetchBackupsForResourceTypeResponse = (function() { - - /** - * Properties of a FetchBackupsForResourceTypeResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchBackupsForResourceTypeResponse - * @property {Array.|null} [backups] FetchBackupsForResourceTypeResponse backups - * @property {string|null} [nextPageToken] FetchBackupsForResourceTypeResponse nextPageToken - */ - - /** - * Constructs a new FetchBackupsForResourceTypeResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchBackupsForResourceTypeResponse. - * @implements IFetchBackupsForResourceTypeResponse - * @constructor - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse=} [properties] Properties to set - */ - function FetchBackupsForResourceTypeResponse(properties) { - this.backups = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchBackupsForResourceTypeResponse backups. - * @member {Array.} backups - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @instance - */ - FetchBackupsForResourceTypeResponse.prototype.backups = $util.emptyArray; - - /** - * FetchBackupsForResourceTypeResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @instance - */ - FetchBackupsForResourceTypeResponse.prototype.nextPageToken = ""; - - /** - * Creates a new FetchBackupsForResourceTypeResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse instance - */ - FetchBackupsForResourceTypeResponse.create = function create(properties) { - return new FetchBackupsForResourceTypeResponse(properties); - }; - - /** - * Encodes the specified FetchBackupsForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse} message FetchBackupsForResourceTypeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupsForResourceTypeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.backupdr.v1.Backup.encode(message.backups[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 FetchBackupsForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse} message FetchBackupsForResourceTypeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchBackupsForResourceTypeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupsForResourceTypeResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchBackupsForResourceTypeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchBackupsForResourceTypeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchBackupsForResourceTypeResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchBackupsForResourceTypeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backups[i]); - if (error) - return "backups." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a FetchBackupsForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} FetchBackupsForResourceTypeResponse - */ - FetchBackupsForResourceTypeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a FetchBackupsForResourceTypeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse} message FetchBackupsForResourceTypeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchBackupsForResourceTypeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backups = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.backupdr.v1.Backup.toObject(message.backups[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this FetchBackupsForResourceTypeResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @instance - * @returns {Object.} JSON object - */ - FetchBackupsForResourceTypeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchBackupsForResourceTypeResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchBackupsForResourceTypeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse"; - }; - - return FetchBackupsForResourceTypeResponse; - })(); - - v1.GetBackupVaultRequest = (function() { - - /** - * Properties of a GetBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetBackupVaultRequest - * @property {string|null} [name] GetBackupVaultRequest name - * @property {google.cloud.backupdr.v1.BackupVaultView|null} [view] GetBackupVaultRequest view - */ - - /** - * Constructs a new GetBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetBackupVaultRequest. - * @implements IGetBackupVaultRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set - */ - function GetBackupVaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupVaultRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @instance - */ - GetBackupVaultRequest.prototype.name = ""; - - /** - * GetBackupVaultRequest view. - * @member {google.cloud.backupdr.v1.BackupVaultView} view - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @instance - */ - GetBackupVaultRequest.prototype.view = 0; - - /** - * Creates a new GetBackupVaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest instance - */ - GetBackupVaultRequest.create = function create(properties) { - return new GetBackupVaultRequest(properties); - }; - - /** - * Encodes the specified GetBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupVaultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupVaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupVaultRequest} message GetBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupVaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupVaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); - 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.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupVaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupVaultRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupVaultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetBackupVaultRequest} GetBackupVaultRequest - */ - GetBackupVaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetBackupVaultRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetBackupVaultRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "BACKUP_VAULT_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BACKUP_VAULT_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "BACKUP_VAULT_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetBackupVaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.GetBackupVaultRequest} message GetBackupVaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupVaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "BACKUP_VAULT_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupVaultView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupVaultView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetBackupVaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupVaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupVaultRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetBackupVaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupVaultRequest"; - }; - - return GetBackupVaultRequest; - })(); - - v1.UpdateBackupVaultRequest = (function() { - - /** - * Properties of an UpdateBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IUpdateBackupVaultRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupVaultRequest updateMask - * @property {google.cloud.backupdr.v1.IBackupVault|null} [backupVault] UpdateBackupVaultRequest backupVault - * @property {string|null} [requestId] UpdateBackupVaultRequest requestId - * @property {boolean|null} [validateOnly] UpdateBackupVaultRequest validateOnly - * @property {boolean|null} [force] UpdateBackupVaultRequest force - * @property {boolean|null} [forceUpdateAccessRestriction] UpdateBackupVaultRequest forceUpdateAccessRestriction - */ - - /** - * Constructs a new UpdateBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an UpdateBackupVaultRequest. - * @implements IUpdateBackupVaultRequest - * @constructor - * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set - */ - function UpdateBackupVaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupVaultRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - */ - UpdateBackupVaultRequest.prototype.updateMask = null; - - /** - * UpdateBackupVaultRequest backupVault. - * @member {google.cloud.backupdr.v1.IBackupVault|null|undefined} backupVault - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - */ - UpdateBackupVaultRequest.prototype.backupVault = null; - - /** - * UpdateBackupVaultRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - */ - UpdateBackupVaultRequest.prototype.requestId = ""; - - /** - * UpdateBackupVaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - */ - UpdateBackupVaultRequest.prototype.validateOnly = false; - - /** - * UpdateBackupVaultRequest force. - * @member {boolean} force - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - */ - UpdateBackupVaultRequest.prototype.force = false; - - /** - * UpdateBackupVaultRequest forceUpdateAccessRestriction. - * @member {boolean} forceUpdateAccessRestriction - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - */ - UpdateBackupVaultRequest.prototype.forceUpdateAccessRestriction = false; - - /** - * Creates a new UpdateBackupVaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest instance - */ - UpdateBackupVaultRequest.create = function create(properties) { - return new UpdateBackupVaultRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupVaultRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) - $root.google.cloud.backupdr.v1.BackupVault.encode(message.backupVault, 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.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.validateOnly); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.force); - if (message.forceUpdateAccessRestriction != null && Object.hasOwnProperty.call(message, "forceUpdateAccessRestriction")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.forceUpdateAccessRestriction); - return writer; - }; - - /** - * Encodes the specified UpdateBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupVaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupVaultRequest} message UpdateBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupVaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.validateOnly = reader.bool(); - break; - } - case 5: { - message.force = reader.bool(); - break; - } - case 6: { - message.forceUpdateAccessRestriction = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupVaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupVaultRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupVaultRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backupVault != null && message.hasOwnProperty("backupVault")) { - var error = $root.google.cloud.backupdr.v1.BackupVault.verify(message.backupVault); - if (error) - return "backupVault." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.forceUpdateAccessRestriction != null && message.hasOwnProperty("forceUpdateAccessRestriction")) - if (typeof message.forceUpdateAccessRestriction !== "boolean") - return "forceUpdateAccessRestriction: boolean expected"; - return null; - }; - - /** - * Creates an UpdateBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.UpdateBackupVaultRequest} UpdateBackupVaultRequest - */ - UpdateBackupVaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.UpdateBackupVaultRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backupVault != null) { - if (typeof object.backupVault !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupVaultRequest.backupVault: object expected"); - message.backupVault = $root.google.cloud.backupdr.v1.BackupVault.fromObject(object.backupVault); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.force != null) - message.force = Boolean(object.force); - if (object.forceUpdateAccessRestriction != null) - message.forceUpdateAccessRestriction = Boolean(object.forceUpdateAccessRestriction); - return message; - }; - - /** - * Creates a plain object from an UpdateBackupVaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.UpdateBackupVaultRequest} message UpdateBackupVaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupVaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.backupVault = null; - object.requestId = ""; - object.validateOnly = false; - object.force = false; - object.forceUpdateAccessRestriction = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backupVault != null && message.hasOwnProperty("backupVault")) - object.backupVault = $root.google.cloud.backupdr.v1.BackupVault.toObject(message.backupVault, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.forceUpdateAccessRestriction != null && message.hasOwnProperty("forceUpdateAccessRestriction")) - object.forceUpdateAccessRestriction = message.forceUpdateAccessRestriction; - return object; - }; - - /** - * Converts this UpdateBackupVaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupVaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupVaultRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.UpdateBackupVaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupVaultRequest"; - }; - - return UpdateBackupVaultRequest; - })(); - - v1.DeleteBackupVaultRequest = (function() { - - /** - * Properties of a DeleteBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IDeleteBackupVaultRequest - * @property {string|null} [name] DeleteBackupVaultRequest name - * @property {string|null} [requestId] DeleteBackupVaultRequest requestId - * @property {boolean|null} [force] DeleteBackupVaultRequest force - * @property {string|null} [etag] DeleteBackupVaultRequest etag - * @property {boolean|null} [validateOnly] DeleteBackupVaultRequest validateOnly - * @property {boolean|null} [allowMissing] DeleteBackupVaultRequest allowMissing - * @property {boolean|null} [ignoreBackupPlanReferences] DeleteBackupVaultRequest ignoreBackupPlanReferences - */ - - /** - * Constructs a new DeleteBackupVaultRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DeleteBackupVaultRequest. - * @implements IDeleteBackupVaultRequest - * @constructor - * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set - */ - function DeleteBackupVaultRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupVaultRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.name = ""; - - /** - * DeleteBackupVaultRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.requestId = ""; - - /** - * DeleteBackupVaultRequest force. - * @member {boolean} force - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.force = false; - - /** - * DeleteBackupVaultRequest etag. - * @member {string} etag - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.etag = ""; - - /** - * DeleteBackupVaultRequest validateOnly. - * @member {boolean} validateOnly - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.validateOnly = false; - - /** - * DeleteBackupVaultRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.allowMissing = false; - - /** - * DeleteBackupVaultRequest ignoreBackupPlanReferences. - * @member {boolean} ignoreBackupPlanReferences - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - */ - DeleteBackupVaultRequest.prototype.ignoreBackupPlanReferences = false; - - /** - * Creates a new DeleteBackupVaultRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest instance - */ - DeleteBackupVaultRequest.create = function create(properties) { - return new DeleteBackupVaultRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupVaultRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupVaultRequest.encode = function encode(message, writer) { - if (!writer) - 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); - if (message.force != null && Object.hasOwnProperty.call(message, "force")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.force); - if (message.etag != null && Object.hasOwnProperty.call(message, "etag")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.etag); - if (message.validateOnly != null && Object.hasOwnProperty.call(message, "validateOnly")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.validateOnly); - if (message.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.allowMissing); - if (message.ignoreBackupPlanReferences != null && Object.hasOwnProperty.call(message, "ignoreBackupPlanReferences")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.ignoreBackupPlanReferences); - return writer; - }; - - /** - * Encodes the specified DeleteBackupVaultRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupVaultRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupVaultRequest} message DeleteBackupVaultRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupVaultRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupVaultRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); - 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; - } - case 3: { - message.force = reader.bool(); - break; - } - case 4: { - message.etag = reader.string(); - break; - } - case 5: { - message.validateOnly = reader.bool(); - break; - } - case 6: { - message.allowMissing = reader.bool(); - break; - } - case 7: { - message.ignoreBackupPlanReferences = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DeleteBackupVaultRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupVaultRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupVaultRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupVaultRequest.verify = function verify(message) { - if (typeof message !== "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"; - if (message.force != null && message.hasOwnProperty("force")) - if (typeof message.force !== "boolean") - return "force: boolean expected"; - if (message.etag != null && message.hasOwnProperty("etag")) - if (!$util.isString(message.etag)) - return "etag: string expected"; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - if (typeof message.validateOnly !== "boolean") - return "validateOnly: boolean expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - if (message.ignoreBackupPlanReferences != null && message.hasOwnProperty("ignoreBackupPlanReferences")) - if (typeof message.ignoreBackupPlanReferences !== "boolean") - return "ignoreBackupPlanReferences: boolean expected"; - return null; - }; - - /** - * Creates a DeleteBackupVaultRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DeleteBackupVaultRequest} DeleteBackupVaultRequest - */ - DeleteBackupVaultRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.DeleteBackupVaultRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.force != null) - message.force = Boolean(object.force); - if (object.etag != null) - message.etag = String(object.etag); - if (object.validateOnly != null) - message.validateOnly = Boolean(object.validateOnly); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - if (object.ignoreBackupPlanReferences != null) - message.ignoreBackupPlanReferences = Boolean(object.ignoreBackupPlanReferences); - return message; - }; - - /** - * Creates a plain object from a DeleteBackupVaultRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {google.cloud.backupdr.v1.DeleteBackupVaultRequest} message DeleteBackupVaultRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupVaultRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.requestId = ""; - object.force = false; - object.etag = ""; - object.validateOnly = false; - object.allowMissing = false; - object.ignoreBackupPlanReferences = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.force != null && message.hasOwnProperty("force")) - object.force = message.force; - if (message.etag != null && message.hasOwnProperty("etag")) - object.etag = message.etag; - if (message.validateOnly != null && message.hasOwnProperty("validateOnly")) - object.validateOnly = message.validateOnly; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - if (message.ignoreBackupPlanReferences != null && message.hasOwnProperty("ignoreBackupPlanReferences")) - object.ignoreBackupPlanReferences = message.ignoreBackupPlanReferences; - return object; - }; - - /** - * Converts this DeleteBackupVaultRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupVaultRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupVaultRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DeleteBackupVaultRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupVaultRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupVaultRequest"; - }; - - return DeleteBackupVaultRequest; - })(); - - v1.ListDataSourcesRequest = (function() { - - /** - * Properties of a ListDataSourcesRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListDataSourcesRequest - * @property {string|null} [parent] ListDataSourcesRequest parent - * @property {number|null} [pageSize] ListDataSourcesRequest pageSize - * @property {string|null} [pageToken] ListDataSourcesRequest pageToken - * @property {string|null} [filter] ListDataSourcesRequest filter - * @property {string|null} [orderBy] ListDataSourcesRequest orderBy - */ - - /** - * Constructs a new ListDataSourcesRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListDataSourcesRequest. - * @implements IListDataSourcesRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set - */ - function ListDataSourcesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDataSourcesRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @instance - */ - ListDataSourcesRequest.prototype.parent = ""; - - /** - * ListDataSourcesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @instance - */ - ListDataSourcesRequest.prototype.pageSize = 0; - - /** - * ListDataSourcesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @instance - */ - ListDataSourcesRequest.prototype.pageToken = ""; - - /** - * ListDataSourcesRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @instance - */ - ListDataSourcesRequest.prototype.filter = ""; - - /** - * ListDataSourcesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @instance - */ - ListDataSourcesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListDataSourcesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {google.cloud.backupdr.v1.IListDataSourcesRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest instance - */ - ListDataSourcesRequest.create = function create(properties) { - return new ListDataSourcesRequest(properties); - }; - - /** - * Encodes the specified ListDataSourcesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourcesRequest.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 ListDataSourcesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {google.cloud.backupdr.v1.IListDataSourcesRequest} message ListDataSourcesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourcesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDataSourcesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourcesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); - 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 ListDataSourcesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourcesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDataSourcesRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDataSourcesRequest.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 ListDataSourcesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListDataSourcesRequest} ListDataSourcesRequest - */ - ListDataSourcesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListDataSourcesRequest(); - 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 ListDataSourcesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {google.cloud.backupdr.v1.ListDataSourcesRequest} message ListDataSourcesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDataSourcesRequest.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 ListDataSourcesRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDataSourcesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDataSourcesRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListDataSourcesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDataSourcesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesRequest"; - }; - - return ListDataSourcesRequest; - })(); - - v1.ListDataSourcesResponse = (function() { - - /** - * Properties of a ListDataSourcesResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListDataSourcesResponse - * @property {Array.|null} [dataSources] ListDataSourcesResponse dataSources - * @property {string|null} [nextPageToken] ListDataSourcesResponse nextPageToken - * @property {Array.|null} [unreachable] ListDataSourcesResponse unreachable - */ - - /** - * Constructs a new ListDataSourcesResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListDataSourcesResponse. - * @implements IListDataSourcesResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set - */ - function ListDataSourcesResponse(properties) { - this.dataSources = []; - 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]]; - } - - /** - * ListDataSourcesResponse dataSources. - * @member {Array.} dataSources - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @instance - */ - ListDataSourcesResponse.prototype.dataSources = $util.emptyArray; - - /** - * ListDataSourcesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @instance - */ - ListDataSourcesResponse.prototype.nextPageToken = ""; - - /** - * ListDataSourcesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @instance - */ - ListDataSourcesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListDataSourcesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {google.cloud.backupdr.v1.IListDataSourcesResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse instance - */ - ListDataSourcesResponse.create = function create(properties) { - return new ListDataSourcesResponse(properties); - }; - - /** - * Encodes the specified ListDataSourcesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourcesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataSources != null && message.dataSources.length) - for (var i = 0; i < message.dataSources.length; ++i) - $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSources[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 ListDataSourcesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourcesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {google.cloud.backupdr.v1.IListDataSourcesResponse} message ListDataSourcesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourcesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDataSourcesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourcesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dataSources && message.dataSources.length)) - message.dataSources = []; - message.dataSources.push($root.google.cloud.backupdr.v1.DataSource.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 ListDataSourcesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourcesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDataSourcesResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDataSourcesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataSources != null && message.hasOwnProperty("dataSources")) { - if (!Array.isArray(message.dataSources)) - return "dataSources: array expected"; - for (var i = 0; i < message.dataSources.length; ++i) { - var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSources[i]); - if (error) - return "dataSources." + 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 ListDataSourcesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListDataSourcesResponse} ListDataSourcesResponse - */ - ListDataSourcesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourcesResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListDataSourcesResponse(); - if (object.dataSources) { - if (!Array.isArray(object.dataSources)) - throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: array expected"); - message.dataSources = []; - for (var i = 0; i < object.dataSources.length; ++i) { - if (typeof object.dataSources[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.dataSources: object expected"); - message.dataSources[i] = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSources[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListDataSourcesResponse.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 ListDataSourcesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {google.cloud.backupdr.v1.ListDataSourcesResponse} message ListDataSourcesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDataSourcesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dataSources = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.dataSources && message.dataSources.length) { - object.dataSources = []; - for (var j = 0; j < message.dataSources.length; ++j) - object.dataSources[j] = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSources[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 ListDataSourcesResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDataSourcesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDataSourcesResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListDataSourcesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDataSourcesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourcesResponse"; - }; - - return ListDataSourcesResponse; - })(); - - v1.GetDataSourceRequest = (function() { - - /** - * Properties of a GetDataSourceRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetDataSourceRequest - * @property {string|null} [name] GetDataSourceRequest name - */ - - /** - * Constructs a new GetDataSourceRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetDataSourceRequest. - * @implements IGetDataSourceRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set - */ - function GetDataSourceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataSourceRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @instance - */ - GetDataSourceRequest.prototype.name = ""; - - /** - * Creates a new GetDataSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.IGetDataSourceRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest instance - */ - GetDataSourceRequest.create = function create(properties) { - return new GetDataSourceRequest(properties); - }; - - /** - * Encodes the specified GetDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataSourceRequest.encode = function encode(message, writer) { - 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 GetDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.IGetDataSourceRequest} message GetDataSourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataSourceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataSourceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); - 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 GetDataSourceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataSourceRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataSourceRequest.verify = function verify(message) { - if (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 GetDataSourceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetDataSourceRequest} GetDataSourceRequest - */ - GetDataSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetDataSourceRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetDataSourceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDataSourceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.GetDataSourceRequest} message GetDataSourceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataSourceRequest.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 GetDataSourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDataSourceRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetDataSourceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetDataSourceRequest"; - }; - - return GetDataSourceRequest; - })(); - - v1.UpdateDataSourceRequest = (function() { - - /** - * Properties of an UpdateDataSourceRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IUpdateDataSourceRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateDataSourceRequest updateMask - * @property {google.cloud.backupdr.v1.IDataSource|null} [dataSource] UpdateDataSourceRequest dataSource - * @property {string|null} [requestId] UpdateDataSourceRequest requestId - * @property {boolean|null} [allowMissing] UpdateDataSourceRequest allowMissing - */ - - /** - * Constructs a new UpdateDataSourceRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an UpdateDataSourceRequest. - * @implements IUpdateDataSourceRequest - * @constructor - * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set - */ - function UpdateDataSourceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateDataSourceRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @instance - */ - UpdateDataSourceRequest.prototype.updateMask = null; - - /** - * UpdateDataSourceRequest dataSource. - * @member {google.cloud.backupdr.v1.IDataSource|null|undefined} dataSource - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @instance - */ - UpdateDataSourceRequest.prototype.dataSource = null; - - /** - * UpdateDataSourceRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @instance - */ - UpdateDataSourceRequest.prototype.requestId = ""; - - /** - * UpdateDataSourceRequest allowMissing. - * @member {boolean} allowMissing - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @instance - */ - UpdateDataSourceRequest.prototype.allowMissing = false; - - /** - * Creates a new UpdateDataSourceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest instance - */ - UpdateDataSourceRequest.create = function create(properties) { - return new UpdateDataSourceRequest(properties); - }; - - /** - * Encodes the specified UpdateDataSourceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDataSourceRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) - $root.google.cloud.backupdr.v1.DataSource.encode(message.dataSource, 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.allowMissing != null && Object.hasOwnProperty.call(message, "allowMissing")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowMissing); - return writer; - }; - - /** - * Encodes the specified UpdateDataSourceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateDataSourceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateDataSourceRequest} message UpdateDataSourceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateDataSourceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateDataSourceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDataSourceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.dataSource = $root.google.cloud.backupdr.v1.DataSource.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - case 4: { - message.allowMissing = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateDataSourceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateDataSourceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateDataSourceRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateDataSourceRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.dataSource != null && message.hasOwnProperty("dataSource")) { - var error = $root.google.cloud.backupdr.v1.DataSource.verify(message.dataSource); - if (error) - return "dataSource." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - if (typeof message.allowMissing !== "boolean") - return "allowMissing: boolean expected"; - return null; - }; - - /** - * Creates an UpdateDataSourceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.UpdateDataSourceRequest} UpdateDataSourceRequest - */ - UpdateDataSourceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.UpdateDataSourceRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.UpdateDataSourceRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.dataSource != null) { - if (typeof object.dataSource !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateDataSourceRequest.dataSource: object expected"); - message.dataSource = $root.google.cloud.backupdr.v1.DataSource.fromObject(object.dataSource); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.allowMissing != null) - message.allowMissing = Boolean(object.allowMissing); - return message; - }; - - /** - * Creates a plain object from an UpdateDataSourceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {google.cloud.backupdr.v1.UpdateDataSourceRequest} message UpdateDataSourceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateDataSourceRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.dataSource = null; - object.requestId = ""; - object.allowMissing = false; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - object.dataSource = $root.google.cloud.backupdr.v1.DataSource.toObject(message.dataSource, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - if (message.allowMissing != null && message.hasOwnProperty("allowMissing")) - object.allowMissing = message.allowMissing; - return object; - }; - - /** - * Converts this UpdateDataSourceRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateDataSourceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateDataSourceRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.UpdateDataSourceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateDataSourceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateDataSourceRequest"; - }; - - return UpdateDataSourceRequest; - })(); - - v1.ListBackupsRequest = (function() { - - /** - * Properties of a ListBackupsRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupsRequest - * @property {string|null} [parent] ListBackupsRequest parent - * @property {number|null} [pageSize] ListBackupsRequest pageSize - * @property {string|null} [pageToken] ListBackupsRequest pageToken - * @property {string|null} [filter] ListBackupsRequest filter - * @property {string|null} [orderBy] ListBackupsRequest orderBy - * @property {google.cloud.backupdr.v1.BackupView|null} [view] ListBackupsRequest view - */ - - /** - * Constructs a new ListBackupsRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupsRequest. - * @implements IListBackupsRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set - */ - function ListBackupsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListBackupsRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.parent = ""; - - /** - * ListBackupsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageSize = 0; - - /** - * ListBackupsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.pageToken = ""; - - /** - * ListBackupsRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.filter = ""; - - /** - * ListBackupsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.orderBy = ""; - - /** - * ListBackupsRequest view. - * @member {google.cloud.backupdr.v1.BackupView} view - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - */ - ListBackupsRequest.prototype.view = 0; - - /** - * Creates a new ListBackupsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupsRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest instance - */ - ListBackupsRequest.create = function create(properties) { - return new ListBackupsRequest(properties); - }; - - /** - * Encodes the specified ListBackupsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.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); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.view); - return writer; - }; - - /** - * Encodes the specified ListBackupsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {google.cloud.backupdr.v1.IListBackupsRequest} message ListBackupsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); - 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; - } - case 6: { - message.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListBackupsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsRequest.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"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a ListBackupsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupsRequest} ListBackupsRequest - */ - ListBackupsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupsRequest(); - 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); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "BACKUP_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BACKUP_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "BACKUP_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a ListBackupsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {google.cloud.backupdr.v1.ListBackupsRequest} message ListBackupsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; - } - 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; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; - return object; - }; - - /** - * Converts this ListBackupsRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @instance - * @returns {Object.} JSON object - */ - ListBackupsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupsRequest"; - }; - - return ListBackupsRequest; - })(); - - v1.ListBackupsResponse = (function() { - - /** - * Properties of a ListBackupsResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListBackupsResponse - * @property {Array.|null} [backups] ListBackupsResponse backups - * @property {string|null} [nextPageToken] ListBackupsResponse nextPageToken - * @property {Array.|null} [unreachable] ListBackupsResponse unreachable - */ - - /** - * Constructs a new ListBackupsResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListBackupsResponse. - * @implements IListBackupsResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set - */ - function ListBackupsResponse(properties) { - this.backups = []; - 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]]; - } - - /** - * ListBackupsResponse backups. - * @member {Array.} backups - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.backups = $util.emptyArray; - - /** - * ListBackupsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.nextPageToken = ""; - - /** - * ListBackupsResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @instance - */ - ListBackupsResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListBackupsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupsResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse instance - */ - ListBackupsResponse.create = function create(properties) { - return new ListBackupsResponse(properties); - }; - - /** - * Encodes the specified ListBackupsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backups != null && message.backups.length) - for (var i = 0; i < message.backups.length; ++i) - $root.google.cloud.backupdr.v1.Backup.encode(message.backups[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 ListBackupsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListBackupsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {google.cloud.backupdr.v1.IListBackupsResponse} message ListBackupsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListBackupsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListBackupsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backups && message.backups.length)) - message.backups = []; - message.backups.push($root.google.cloud.backupdr.v1.Backup.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 ListBackupsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListBackupsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListBackupsResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListBackupsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backups != null && message.hasOwnProperty("backups")) { - if (!Array.isArray(message.backups)) - return "backups: array expected"; - for (var i = 0; i < message.backups.length; ++i) { - var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backups[i]); - if (error) - return "backups." + 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 ListBackupsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListBackupsResponse} ListBackupsResponse - */ - ListBackupsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListBackupsResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListBackupsResponse(); - if (object.backups) { - if (!Array.isArray(object.backups)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.backups: array expected"); - message.backups = []; - for (var i = 0; i < object.backups.length; ++i) { - if (typeof object.backups[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.backups: object expected"); - message.backups[i] = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backups[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListBackupsResponse.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 ListBackupsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {google.cloud.backupdr.v1.ListBackupsResponse} message ListBackupsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListBackupsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.backups = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.backups && message.backups.length) { - object.backups = []; - for (var j = 0; j < message.backups.length; ++j) - object.backups[j] = $root.google.cloud.backupdr.v1.Backup.toObject(message.backups[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 ListBackupsResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @instance - * @returns {Object.} JSON object - */ - ListBackupsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListBackupsResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListBackupsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListBackupsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListBackupsResponse"; - }; - - return ListBackupsResponse; - })(); - - v1.GetBackupRequest = (function() { - - /** - * Properties of a GetBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetBackupRequest - * @property {string|null} [name] GetBackupRequest name - * @property {google.cloud.backupdr.v1.BackupView|null} [view] GetBackupRequest view - */ - - /** - * Constructs a new GetBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetBackupRequest. - * @implements IGetBackupRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set - */ - function GetBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetBackupRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.name = ""; - - /** - * GetBackupRequest view. - * @member {google.cloud.backupdr.v1.BackupView} view - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @instance - */ - GetBackupRequest.prototype.view = 0; - - /** - * Creates a new GetBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest instance - */ - GetBackupRequest.create = function create(properties) { - return new GetBackupRequest(properties); - }; - - /** - * Encodes the specified GetBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.view != null && Object.hasOwnProperty.call(message, "view")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.view); - return writer; - }; - - /** - * Encodes the specified GetBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IGetBackupRequest} message GetBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); - 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.view = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GetBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetBackupRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.view != null && message.hasOwnProperty("view")) - switch (message.view) { - default: - return "view: enum value expected"; - case 0: - case 1: - case 2: - break; - } - return null; - }; - - /** - * Creates a GetBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetBackupRequest} GetBackupRequest - */ - GetBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetBackupRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetBackupRequest(); - if (object.name != null) - message.name = String(object.name); - switch (object.view) { - default: - if (typeof object.view === "number") { - message.view = object.view; - break; - } - break; - case "BACKUP_VIEW_UNSPECIFIED": - case 0: - message.view = 0; - break; - case "BACKUP_VIEW_BASIC": - case 1: - message.view = 1; - break; - case "BACKUP_VIEW_FULL": - case 2: - message.view = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a GetBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {google.cloud.backupdr.v1.GetBackupRequest} message GetBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.view = options.enums === String ? "BACKUP_VIEW_UNSPECIFIED" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.view != null && message.hasOwnProperty("view")) - object.view = options.enums === String ? $root.google.cloud.backupdr.v1.BackupView[message.view] === undefined ? message.view : $root.google.cloud.backupdr.v1.BackupView[message.view] : message.view; - return object; - }; - - /** - * Converts this GetBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @instance - * @returns {Object.} JSON object - */ - GetBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetBackupRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetBackupRequest"; - }; - - return GetBackupRequest; - })(); - - v1.UpdateBackupRequest = (function() { - - /** - * Properties of an UpdateBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IUpdateBackupRequest - * @property {google.protobuf.IFieldMask|null} [updateMask] UpdateBackupRequest updateMask - * @property {google.cloud.backupdr.v1.IBackup|null} [backup] UpdateBackupRequest backup - * @property {string|null} [requestId] UpdateBackupRequest requestId - */ - - /** - * Constructs a new UpdateBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an UpdateBackupRequest. - * @implements IUpdateBackupRequest - * @constructor - * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set - */ - function UpdateBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * UpdateBackupRequest updateMask. - * @member {google.protobuf.IFieldMask|null|undefined} updateMask - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.updateMask = null; - - /** - * UpdateBackupRequest backup. - * @member {google.cloud.backupdr.v1.IBackup|null|undefined} backup - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.backup = null; - - /** - * UpdateBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @instance - */ - UpdateBackupRequest.prototype.requestId = ""; - - /** - * Creates a new UpdateBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest instance - */ - UpdateBackupRequest.create = function create(properties) { - return new UpdateBackupRequest(properties); - }; - - /** - * Encodes the specified UpdateBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.updateMask != null && Object.hasOwnProperty.call(message, "updateMask")) - $root.google.protobuf.FieldMask.encode(message.updateMask, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.backup != null && Object.hasOwnProperty.call(message, "backup")) - $root.google.cloud.backupdr.v1.Backup.encode(message.backup, 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 UpdateBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.UpdateBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IUpdateBackupRequest} message UpdateBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UpdateBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.updateMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - case 2: { - message.backup = $root.google.cloud.backupdr.v1.Backup.decode(reader, reader.uint32()); - break; - } - case 3: { - message.requestId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UpdateBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UpdateBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UpdateBackupRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UpdateBackupRequest.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.updateMask != null && message.hasOwnProperty("updateMask")) { - var error = $root.google.protobuf.FieldMask.verify(message.updateMask); - if (error) - return "updateMask." + error; - } - if (message.backup != null && message.hasOwnProperty("backup")) { - var error = $root.google.cloud.backupdr.v1.Backup.verify(message.backup); - if (error) - return "backup." + error; - } - if (message.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - return null; - }; - - /** - * Creates an UpdateBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.UpdateBackupRequest} UpdateBackupRequest - */ - UpdateBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.UpdateBackupRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.UpdateBackupRequest(); - if (object.updateMask != null) { - if (typeof object.updateMask !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.updateMask: object expected"); - message.updateMask = $root.google.protobuf.FieldMask.fromObject(object.updateMask); - } - if (object.backup != null) { - if (typeof object.backup !== "object") - throw TypeError(".google.cloud.backupdr.v1.UpdateBackupRequest.backup: object expected"); - message.backup = $root.google.cloud.backupdr.v1.Backup.fromObject(object.backup); - } - if (object.requestId != null) - message.requestId = String(object.requestId); - return message; - }; - - /** - * Creates a plain object from an UpdateBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {google.cloud.backupdr.v1.UpdateBackupRequest} message UpdateBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UpdateBackupRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.updateMask = null; - object.backup = null; - object.requestId = ""; - } - if (message.updateMask != null && message.hasOwnProperty("updateMask")) - object.updateMask = $root.google.protobuf.FieldMask.toObject(message.updateMask, options); - if (message.backup != null && message.hasOwnProperty("backup")) - object.backup = $root.google.cloud.backupdr.v1.Backup.toObject(message.backup, options); - if (message.requestId != null && message.hasOwnProperty("requestId")) - object.requestId = message.requestId; - return object; - }; - - /** - * Converts this UpdateBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @instance - * @returns {Object.} JSON object - */ - UpdateBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for UpdateBackupRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.UpdateBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - UpdateBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.UpdateBackupRequest"; - }; - - return UpdateBackupRequest; - })(); - - v1.DeleteBackupRequest = (function() { - - /** - * Properties of a DeleteBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IDeleteBackupRequest - * @property {string|null} [name] DeleteBackupRequest name - * @property {string|null} [requestId] DeleteBackupRequest requestId - */ - - /** - * Constructs a new DeleteBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DeleteBackupRequest. - * @implements IDeleteBackupRequest - * @constructor - * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set - */ - function DeleteBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DeleteBackupRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.name = ""; - - /** - * DeleteBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @instance - */ - DeleteBackupRequest.prototype.requestId = ""; - - /** - * Creates a new DeleteBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest instance - */ - DeleteBackupRequest.create = function create(properties) { - return new DeleteBackupRequest(properties); - }; - - /** - * Encodes the specified DeleteBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encode = function encode(message, writer) { - if (!writer) - 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 DeleteBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DeleteBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IDeleteBackupRequest} message DeleteBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DeleteBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DeleteBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); - 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 DeleteBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DeleteBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DeleteBackupRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DeleteBackupRequest.verify = function verify(message) { - if (typeof message !== "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 DeleteBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DeleteBackupRequest} DeleteBackupRequest - */ - DeleteBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DeleteBackupRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.DeleteBackupRequest(); - 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 DeleteBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {google.cloud.backupdr.v1.DeleteBackupRequest} message DeleteBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DeleteBackupRequest.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 DeleteBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @instance - * @returns {Object.} JSON object - */ - DeleteBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DeleteBackupRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DeleteBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DeleteBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DeleteBackupRequest"; - }; - - return DeleteBackupRequest; - })(); - - v1.RestoreBackupRequest = (function() { - - /** - * Properties of a RestoreBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IRestoreBackupRequest - * @property {string|null} [name] RestoreBackupRequest name - * @property {string|null} [requestId] RestoreBackupRequest requestId - * @property {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null} [computeInstanceTargetEnvironment] RestoreBackupRequest computeInstanceTargetEnvironment - * @property {google.cloud.backupdr.v1.IDiskTargetEnvironment|null} [diskTargetEnvironment] RestoreBackupRequest diskTargetEnvironment - * @property {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null} [regionDiskTargetEnvironment] RestoreBackupRequest regionDiskTargetEnvironment - * @property {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null} [computeInstanceRestoreProperties] RestoreBackupRequest computeInstanceRestoreProperties - * @property {google.cloud.backupdr.v1.IDiskRestoreProperties|null} [diskRestoreProperties] RestoreBackupRequest diskRestoreProperties - * @property {google.protobuf.IFieldMask|null} [clearOverridesFieldMask] RestoreBackupRequest clearOverridesFieldMask - */ - - /** - * Constructs a new RestoreBackupRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a RestoreBackupRequest. - * @implements IRestoreBackupRequest - * @constructor - * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set - */ - function RestoreBackupRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreBackupRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.name = ""; - - /** - * RestoreBackupRequest requestId. - * @member {string} requestId - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.requestId = ""; - - /** - * RestoreBackupRequest computeInstanceTargetEnvironment. - * @member {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment|null|undefined} computeInstanceTargetEnvironment - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.computeInstanceTargetEnvironment = null; - - /** - * RestoreBackupRequest diskTargetEnvironment. - * @member {google.cloud.backupdr.v1.IDiskTargetEnvironment|null|undefined} diskTargetEnvironment - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.diskTargetEnvironment = null; - - /** - * RestoreBackupRequest regionDiskTargetEnvironment. - * @member {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment|null|undefined} regionDiskTargetEnvironment - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.regionDiskTargetEnvironment = null; - - /** - * RestoreBackupRequest computeInstanceRestoreProperties. - * @member {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties|null|undefined} computeInstanceRestoreProperties - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.computeInstanceRestoreProperties = null; - - /** - * RestoreBackupRequest diskRestoreProperties. - * @member {google.cloud.backupdr.v1.IDiskRestoreProperties|null|undefined} diskRestoreProperties - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.diskRestoreProperties = null; - - /** - * RestoreBackupRequest clearOverridesFieldMask. - * @member {google.protobuf.IFieldMask|null|undefined} clearOverridesFieldMask - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - RestoreBackupRequest.prototype.clearOverridesFieldMask = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * RestoreBackupRequest targetEnvironment. - * @member {"computeInstanceTargetEnvironment"|"diskTargetEnvironment"|"regionDiskTargetEnvironment"|undefined} targetEnvironment - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - Object.defineProperty(RestoreBackupRequest.prototype, "targetEnvironment", { - get: $util.oneOfGetter($oneOfFields = ["computeInstanceTargetEnvironment", "diskTargetEnvironment", "regionDiskTargetEnvironment"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * RestoreBackupRequest instanceProperties. - * @member {"computeInstanceRestoreProperties"|"diskRestoreProperties"|undefined} instanceProperties - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - */ - Object.defineProperty(RestoreBackupRequest.prototype, "instanceProperties", { - get: $util.oneOfGetter($oneOfFields = ["computeInstanceRestoreProperties", "diskRestoreProperties"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(RestoreBackupRequest.prototype, "_clearOverridesFieldMask", { - get: $util.oneOfGetter($oneOfFields = ["clearOverridesFieldMask"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new RestoreBackupRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IRestoreBackupRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest instance - */ - RestoreBackupRequest.create = function create(properties) { - return new RestoreBackupRequest(properties); - }; - - /** - * Encodes the specified RestoreBackupRequest message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreBackupRequest.encode = function encode(message, writer) { - if (!writer) - 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); - if (message.computeInstanceTargetEnvironment != null && Object.hasOwnProperty.call(message, "computeInstanceTargetEnvironment")) - $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.encode(message.computeInstanceTargetEnvironment, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.computeInstanceRestoreProperties != null && Object.hasOwnProperty.call(message, "computeInstanceRestoreProperties")) - $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.encode(message.computeInstanceRestoreProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.diskTargetEnvironment != null && Object.hasOwnProperty.call(message, "diskTargetEnvironment")) - $root.google.cloud.backupdr.v1.DiskTargetEnvironment.encode(message.diskTargetEnvironment, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.regionDiskTargetEnvironment != null && Object.hasOwnProperty.call(message, "regionDiskTargetEnvironment")) - $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.encode(message.regionDiskTargetEnvironment, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.diskRestoreProperties != null && Object.hasOwnProperty.call(message, "diskRestoreProperties")) - $root.google.cloud.backupdr.v1.DiskRestoreProperties.encode(message.diskRestoreProperties, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.clearOverridesFieldMask != null && Object.hasOwnProperty.call(message, "clearOverridesFieldMask")) - $root.google.protobuf.FieldMask.encode(message.clearOverridesFieldMask, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreBackupRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {google.cloud.backupdr.v1.IRestoreBackupRequest} message RestoreBackupRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreBackupRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreBackupRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreBackupRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); - 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; - } - case 3: { - message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.decode(reader, reader.uint32()); - break; - } - case 5: { - message.diskTargetEnvironment = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.decode(reader, reader.uint32()); - break; - } - case 6: { - message.regionDiskTargetEnvironment = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.decode(reader, reader.uint32()); - break; - } - case 4: { - message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.decode(reader, reader.uint32()); - break; - } - case 7: { - message.diskRestoreProperties = $root.google.cloud.backupdr.v1.DiskRestoreProperties.decode(reader, reader.uint32()); - break; - } - case 8: { - message.clearOverridesFieldMask = $root.google.protobuf.FieldMask.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreBackupRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreBackupRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreBackupRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreBackupRequest.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.requestId != null && message.hasOwnProperty("requestId")) - if (!$util.isString(message.requestId)) - return "requestId: string expected"; - if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { - properties.targetEnvironment = 1; - { - var error = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify(message.computeInstanceTargetEnvironment); - if (error) - return "computeInstanceTargetEnvironment." + error; - } - } - if (message.diskTargetEnvironment != null && message.hasOwnProperty("diskTargetEnvironment")) { - if (properties.targetEnvironment === 1) - return "targetEnvironment: multiple values"; - properties.targetEnvironment = 1; - { - var error = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.verify(message.diskTargetEnvironment); - if (error) - return "diskTargetEnvironment." + error; - } - } - if (message.regionDiskTargetEnvironment != null && message.hasOwnProperty("regionDiskTargetEnvironment")) { - if (properties.targetEnvironment === 1) - return "targetEnvironment: multiple values"; - properties.targetEnvironment = 1; - { - var error = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify(message.regionDiskTargetEnvironment); - if (error) - return "regionDiskTargetEnvironment." + error; - } - } - if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { - properties.instanceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify(message.computeInstanceRestoreProperties); - if (error) - return "computeInstanceRestoreProperties." + error; - } - } - if (message.diskRestoreProperties != null && message.hasOwnProperty("diskRestoreProperties")) { - if (properties.instanceProperties === 1) - return "instanceProperties: multiple values"; - properties.instanceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.DiskRestoreProperties.verify(message.diskRestoreProperties); - if (error) - return "diskRestoreProperties." + error; - } - } - if (message.clearOverridesFieldMask != null && message.hasOwnProperty("clearOverridesFieldMask")) { - properties._clearOverridesFieldMask = 1; - { - var error = $root.google.protobuf.FieldMask.verify(message.clearOverridesFieldMask); - if (error) - return "clearOverridesFieldMask." + error; - } - } - return null; - }; - - /** - * Creates a RestoreBackupRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.RestoreBackupRequest} RestoreBackupRequest - */ - RestoreBackupRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.RestoreBackupRequest(); - if (object.name != null) - message.name = String(object.name); - if (object.requestId != null) - message.requestId = String(object.requestId); - if (object.computeInstanceTargetEnvironment != null) { - if (typeof object.computeInstanceTargetEnvironment !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceTargetEnvironment: object expected"); - message.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.fromObject(object.computeInstanceTargetEnvironment); - } - if (object.diskTargetEnvironment != null) { - if (typeof object.diskTargetEnvironment !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.diskTargetEnvironment: object expected"); - message.diskTargetEnvironment = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.fromObject(object.diskTargetEnvironment); - } - if (object.regionDiskTargetEnvironment != null) { - if (typeof object.regionDiskTargetEnvironment !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.regionDiskTargetEnvironment: object expected"); - message.regionDiskTargetEnvironment = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.fromObject(object.regionDiskTargetEnvironment); - } - if (object.computeInstanceRestoreProperties != null) { - if (typeof object.computeInstanceRestoreProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.computeInstanceRestoreProperties: object expected"); - message.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.fromObject(object.computeInstanceRestoreProperties); - } - if (object.diskRestoreProperties != null) { - if (typeof object.diskRestoreProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.diskRestoreProperties: object expected"); - message.diskRestoreProperties = $root.google.cloud.backupdr.v1.DiskRestoreProperties.fromObject(object.diskRestoreProperties); - } - if (object.clearOverridesFieldMask != null) { - if (typeof object.clearOverridesFieldMask !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupRequest.clearOverridesFieldMask: object expected"); - message.clearOverridesFieldMask = $root.google.protobuf.FieldMask.fromObject(object.clearOverridesFieldMask); - } - return message; - }; - - /** - * Creates a plain object from a RestoreBackupRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {google.cloud.backupdr.v1.RestoreBackupRequest} message RestoreBackupRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreBackupRequest.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; - if (message.computeInstanceTargetEnvironment != null && message.hasOwnProperty("computeInstanceTargetEnvironment")) { - object.computeInstanceTargetEnvironment = $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.toObject(message.computeInstanceTargetEnvironment, options); - if (options.oneofs) - object.targetEnvironment = "computeInstanceTargetEnvironment"; - } - if (message.computeInstanceRestoreProperties != null && message.hasOwnProperty("computeInstanceRestoreProperties")) { - object.computeInstanceRestoreProperties = $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.toObject(message.computeInstanceRestoreProperties, options); - if (options.oneofs) - object.instanceProperties = "computeInstanceRestoreProperties"; - } - if (message.diskTargetEnvironment != null && message.hasOwnProperty("diskTargetEnvironment")) { - object.diskTargetEnvironment = $root.google.cloud.backupdr.v1.DiskTargetEnvironment.toObject(message.diskTargetEnvironment, options); - if (options.oneofs) - object.targetEnvironment = "diskTargetEnvironment"; - } - if (message.regionDiskTargetEnvironment != null && message.hasOwnProperty("regionDiskTargetEnvironment")) { - object.regionDiskTargetEnvironment = $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment.toObject(message.regionDiskTargetEnvironment, options); - if (options.oneofs) - object.targetEnvironment = "regionDiskTargetEnvironment"; - } - if (message.diskRestoreProperties != null && message.hasOwnProperty("diskRestoreProperties")) { - object.diskRestoreProperties = $root.google.cloud.backupdr.v1.DiskRestoreProperties.toObject(message.diskRestoreProperties, options); - if (options.oneofs) - object.instanceProperties = "diskRestoreProperties"; - } - if (message.clearOverridesFieldMask != null && message.hasOwnProperty("clearOverridesFieldMask")) { - object.clearOverridesFieldMask = $root.google.protobuf.FieldMask.toObject(message.clearOverridesFieldMask, options); - if (options.oneofs) - object._clearOverridesFieldMask = "clearOverridesFieldMask"; - } - return object; - }; - - /** - * Converts this RestoreBackupRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @instance - * @returns {Object.} JSON object - */ - RestoreBackupRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreBackupRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.RestoreBackupRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreBackupRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupRequest"; - }; - - return RestoreBackupRequest; - })(); - - v1.RestoreBackupResponse = (function() { - - /** - * Properties of a RestoreBackupResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IRestoreBackupResponse - * @property {google.cloud.backupdr.v1.ITargetResource|null} [targetResource] RestoreBackupResponse targetResource - */ - - /** - * Constructs a new RestoreBackupResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a RestoreBackupResponse. - * @implements IRestoreBackupResponse - * @constructor - * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set - */ - function RestoreBackupResponse(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RestoreBackupResponse targetResource. - * @member {google.cloud.backupdr.v1.ITargetResource|null|undefined} targetResource - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @instance - */ - RestoreBackupResponse.prototype.targetResource = null; - - /** - * Creates a new RestoreBackupResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {google.cloud.backupdr.v1.IRestoreBackupResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse instance - */ - RestoreBackupResponse.create = function create(properties) { - return new RestoreBackupResponse(properties); - }; - - /** - * Encodes the specified RestoreBackupResponse message. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreBackupResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) - $root.google.cloud.backupdr.v1.TargetResource.encode(message.targetResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified RestoreBackupResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RestoreBackupResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {google.cloud.backupdr.v1.IRestoreBackupResponse} message RestoreBackupResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RestoreBackupResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RestoreBackupResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreBackupResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RestoreBackupResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RestoreBackupResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RestoreBackupResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RestoreBackupResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.targetResource != null && message.hasOwnProperty("targetResource")) { - var error = $root.google.cloud.backupdr.v1.TargetResource.verify(message.targetResource); - if (error) - return "targetResource." + error; - } - return null; - }; - - /** - * Creates a RestoreBackupResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.RestoreBackupResponse} RestoreBackupResponse - */ - RestoreBackupResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.RestoreBackupResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.RestoreBackupResponse(); - if (object.targetResource != null) { - if (typeof object.targetResource !== "object") - throw TypeError(".google.cloud.backupdr.v1.RestoreBackupResponse.targetResource: object expected"); - message.targetResource = $root.google.cloud.backupdr.v1.TargetResource.fromObject(object.targetResource); - } - return message; - }; - - /** - * Creates a plain object from a RestoreBackupResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {google.cloud.backupdr.v1.RestoreBackupResponse} message RestoreBackupResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RestoreBackupResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.targetResource = null; - if (message.targetResource != null && message.hasOwnProperty("targetResource")) - object.targetResource = $root.google.cloud.backupdr.v1.TargetResource.toObject(message.targetResource, options); - return object; - }; - - /** - * Converts this RestoreBackupResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @instance - * @returns {Object.} JSON object - */ - RestoreBackupResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RestoreBackupResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.RestoreBackupResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RestoreBackupResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.RestoreBackupResponse"; - }; - - return RestoreBackupResponse; - })(); - - v1.TargetResource = (function() { - - /** - * Properties of a TargetResource. - * @memberof google.cloud.backupdr.v1 - * @interface ITargetResource - * @property {google.cloud.backupdr.v1.IGcpResource|null} [gcpResource] TargetResource gcpResource - */ - - /** - * Constructs a new TargetResource. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a TargetResource. - * @implements ITargetResource - * @constructor - * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set - */ - function TargetResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * TargetResource gcpResource. - * @member {google.cloud.backupdr.v1.IGcpResource|null|undefined} gcpResource - * @memberof google.cloud.backupdr.v1.TargetResource - * @instance - */ - TargetResource.prototype.gcpResource = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * TargetResource targetResourceInfo. - * @member {"gcpResource"|undefined} targetResourceInfo - * @memberof google.cloud.backupdr.v1.TargetResource - * @instance - */ - Object.defineProperty(TargetResource.prototype, "targetResourceInfo", { - get: $util.oneOfGetter($oneOfFields = ["gcpResource"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new TargetResource instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {google.cloud.backupdr.v1.ITargetResource=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource instance - */ - TargetResource.create = function create(properties) { - return new TargetResource(properties); - }; - - /** - * Encodes the specified TargetResource message. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TargetResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcpResource != null && Object.hasOwnProperty.call(message, "gcpResource")) - $root.google.cloud.backupdr.v1.GcpResource.encode(message.gcpResource, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified TargetResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.TargetResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {google.cloud.backupdr.v1.ITargetResource} message TargetResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - TargetResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a TargetResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TargetResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.TargetResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a TargetResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - TargetResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a TargetResource message. - * @function verify - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - TargetResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { - properties.targetResourceInfo = 1; - { - var error = $root.google.cloud.backupdr.v1.GcpResource.verify(message.gcpResource); - if (error) - return "gcpResource." + error; - } - } - return null; - }; - - /** - * Creates a TargetResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.TargetResource} TargetResource - */ - TargetResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.TargetResource) - return object; - var message = new $root.google.cloud.backupdr.v1.TargetResource(); - if (object.gcpResource != null) { - if (typeof object.gcpResource !== "object") - throw TypeError(".google.cloud.backupdr.v1.TargetResource.gcpResource: object expected"); - message.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.fromObject(object.gcpResource); - } - return message; - }; - - /** - * Creates a plain object from a TargetResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {google.cloud.backupdr.v1.TargetResource} message TargetResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - TargetResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.gcpResource != null && message.hasOwnProperty("gcpResource")) { - object.gcpResource = $root.google.cloud.backupdr.v1.GcpResource.toObject(message.gcpResource, options); - if (options.oneofs) - object.targetResourceInfo = "gcpResource"; - } - return object; - }; - - /** - * Converts this TargetResource to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.TargetResource - * @instance - * @returns {Object.} JSON object - */ - TargetResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for TargetResource - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.TargetResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - TargetResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.TargetResource"; - }; - - return TargetResource; - })(); - - v1.GcpResource = (function() { - - /** - * Properties of a GcpResource. - * @memberof google.cloud.backupdr.v1 - * @interface IGcpResource - * @property {string|null} [gcpResourcename] GcpResource gcpResourcename - * @property {string|null} [location] GcpResource location - * @property {string|null} [type] GcpResource type - */ - - /** - * Constructs a new GcpResource. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GcpResource. - * @implements IGcpResource - * @constructor - * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set - */ - function GcpResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GcpResource gcpResourcename. - * @member {string} gcpResourcename - * @memberof google.cloud.backupdr.v1.GcpResource - * @instance - */ - GcpResource.prototype.gcpResourcename = ""; - - /** - * GcpResource location. - * @member {string} location - * @memberof google.cloud.backupdr.v1.GcpResource - * @instance - */ - GcpResource.prototype.location = ""; - - /** - * GcpResource type. - * @member {string} type - * @memberof google.cloud.backupdr.v1.GcpResource - * @instance - */ - GcpResource.prototype.type = ""; - - /** - * Creates a new GcpResource instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {google.cloud.backupdr.v1.IGcpResource=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource instance - */ - GcpResource.create = function create(properties) { - return new GcpResource(properties); - }; - - /** - * Encodes the specified GcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcpResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - return writer; - }; - - /** - * Encodes the specified GcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GcpResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {google.cloud.backupdr.v1.IGcpResource} message GcpResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GcpResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GcpResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcpResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GcpResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcpResourcename = reader.string(); - break; - } - case 2: { - message.location = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GcpResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GcpResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GcpResource message. - * @function verify - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GcpResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - if (!$util.isString(message.gcpResourcename)) - return "gcpResourcename: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a GcpResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GcpResource} GcpResource - */ - GcpResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GcpResource) - return object; - var message = new $root.google.cloud.backupdr.v1.GcpResource(); - if (object.gcpResourcename != null) - message.gcpResourcename = String(object.gcpResourcename); - if (object.location != null) - message.location = String(object.location); - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a GcpResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {google.cloud.backupdr.v1.GcpResource} message GcpResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GcpResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcpResourcename = ""; - object.location = ""; - object.type = ""; - } - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - object.gcpResourcename = message.gcpResourcename; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this GcpResource to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GcpResource - * @instance - * @returns {Object.} JSON object - */ - GcpResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GcpResource - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GcpResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GcpResource"; - }; - - return GcpResource; - })(); - - v1.BackupGcpResource = (function() { - - /** - * Properties of a BackupGcpResource. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupGcpResource - * @property {string|null} [gcpResourcename] BackupGcpResource gcpResourcename - * @property {string|null} [location] BackupGcpResource location - * @property {string|null} [type] BackupGcpResource type - */ - - /** - * Constructs a new BackupGcpResource. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupGcpResource. - * @implements IBackupGcpResource - * @constructor - * @param {google.cloud.backupdr.v1.IBackupGcpResource=} [properties] Properties to set - */ - function BackupGcpResource(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupGcpResource gcpResourcename. - * @member {string} gcpResourcename - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @instance - */ - BackupGcpResource.prototype.gcpResourcename = ""; - - /** - * BackupGcpResource location. - * @member {string} location - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @instance - */ - BackupGcpResource.prototype.location = ""; - - /** - * BackupGcpResource type. - * @member {string} type - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @instance - */ - BackupGcpResource.prototype.type = ""; - - /** - * Creates a new BackupGcpResource instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {google.cloud.backupdr.v1.IBackupGcpResource=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource instance - */ - BackupGcpResource.create = function create(properties) { - return new BackupGcpResource(properties); - }; - - /** - * Encodes the specified BackupGcpResource message. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {google.cloud.backupdr.v1.IBackupGcpResource} message BackupGcpResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupGcpResource.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.location); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - return writer; - }; - - /** - * Encodes the specified BackupGcpResource message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupGcpResource.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {google.cloud.backupdr.v1.IBackupGcpResource} message BackupGcpResource message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupGcpResource.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupGcpResource message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupGcpResource.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupGcpResource(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcpResourcename = reader.string(); - break; - } - case 2: { - message.location = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupGcpResource message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupGcpResource.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupGcpResource message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupGcpResource.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - if (!$util.isString(message.gcpResourcename)) - return "gcpResourcename: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - return null; - }; - - /** - * Creates a BackupGcpResource message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupGcpResource} BackupGcpResource - */ - BackupGcpResource.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupGcpResource) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupGcpResource(); - if (object.gcpResourcename != null) - message.gcpResourcename = String(object.gcpResourcename); - if (object.location != null) - message.location = String(object.location); - if (object.type != null) - message.type = String(object.type); - return message; - }; - - /** - * Creates a plain object from a BackupGcpResource message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {google.cloud.backupdr.v1.BackupGcpResource} message BackupGcpResource - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupGcpResource.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcpResourcename = ""; - object.location = ""; - object.type = ""; - } - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - object.gcpResourcename = message.gcpResourcename; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - return object; - }; - - /** - * Converts this BackupGcpResource to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @instance - * @returns {Object.} JSON object - */ - BackupGcpResource.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupGcpResource - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupGcpResource - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupGcpResource.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupGcpResource"; - }; - - return BackupGcpResource; - })(); - - /** - * BackupConfigState enum. - * @name google.cloud.backupdr.v1.BackupConfigState - * @enum {number} - * @property {number} BACKUP_CONFIG_STATE_UNSPECIFIED=0 BACKUP_CONFIG_STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} PASSIVE=2 PASSIVE value - */ - v1.BackupConfigState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BACKUP_CONFIG_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "PASSIVE"] = 2; - return values; - })(); - - /** - * BackupView enum. - * @name google.cloud.backupdr.v1.BackupView - * @enum {number} - * @property {number} BACKUP_VIEW_UNSPECIFIED=0 BACKUP_VIEW_UNSPECIFIED value - * @property {number} BACKUP_VIEW_BASIC=1 BACKUP_VIEW_BASIC value - * @property {number} BACKUP_VIEW_FULL=2 BACKUP_VIEW_FULL value - */ - v1.BackupView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BACKUP_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "BACKUP_VIEW_BASIC"] = 1; - values[valuesById[2] = "BACKUP_VIEW_FULL"] = 2; - return values; - })(); - - /** - * BackupVaultView enum. - * @name google.cloud.backupdr.v1.BackupVaultView - * @enum {number} - * @property {number} BACKUP_VAULT_VIEW_UNSPECIFIED=0 BACKUP_VAULT_VIEW_UNSPECIFIED value - * @property {number} BACKUP_VAULT_VIEW_BASIC=1 BACKUP_VAULT_VIEW_BASIC value - * @property {number} BACKUP_VAULT_VIEW_FULL=2 BACKUP_VAULT_VIEW_FULL value - */ - v1.BackupVaultView = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "BACKUP_VAULT_VIEW_UNSPECIFIED"] = 0; - values[valuesById[1] = "BACKUP_VAULT_VIEW_BASIC"] = 1; - values[valuesById[2] = "BACKUP_VAULT_VIEW_FULL"] = 2; - return values; - })(); - - v1.BackupApplianceBackupProperties = (function() { - - /** - * Properties of a BackupApplianceBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupApplianceBackupProperties - * @property {number|null} [generationId] BackupApplianceBackupProperties generationId - * @property {google.protobuf.ITimestamp|null} [finalizeTime] BackupApplianceBackupProperties finalizeTime - * @property {google.protobuf.ITimestamp|null} [recoveryRangeStartTime] BackupApplianceBackupProperties recoveryRangeStartTime - * @property {google.protobuf.ITimestamp|null} [recoveryRangeEndTime] BackupApplianceBackupProperties recoveryRangeEndTime - */ - - /** - * Constructs a new BackupApplianceBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupApplianceBackupProperties. - * @implements IBackupApplianceBackupProperties - * @constructor - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set - */ - function BackupApplianceBackupProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupApplianceBackupProperties generationId. - * @member {number|null|undefined} generationId - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @instance - */ - BackupApplianceBackupProperties.prototype.generationId = null; - - /** - * BackupApplianceBackupProperties finalizeTime. - * @member {google.protobuf.ITimestamp|null|undefined} finalizeTime - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @instance - */ - BackupApplianceBackupProperties.prototype.finalizeTime = null; - - /** - * BackupApplianceBackupProperties recoveryRangeStartTime. - * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeStartTime - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @instance - */ - BackupApplianceBackupProperties.prototype.recoveryRangeStartTime = null; - - /** - * BackupApplianceBackupProperties recoveryRangeEndTime. - * @member {google.protobuf.ITimestamp|null|undefined} recoveryRangeEndTime - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @instance - */ - BackupApplianceBackupProperties.prototype.recoveryRangeEndTime = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupApplianceBackupProperties.prototype, "_generationId", { - get: $util.oneOfGetter($oneOfFields = ["generationId"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupApplianceBackupProperties.prototype, "_finalizeTime", { - get: $util.oneOfGetter($oneOfFields = ["finalizeTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeStartTime", { - get: $util.oneOfGetter($oneOfFields = ["recoveryRangeStartTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(BackupApplianceBackupProperties.prototype, "_recoveryRangeEndTime", { - get: $util.oneOfGetter($oneOfFields = ["recoveryRangeEndTime"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupApplianceBackupProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties instance - */ - BackupApplianceBackupProperties.create = function create(properties) { - return new BackupApplianceBackupProperties(properties); - }; - - /** - * Encodes the specified BackupApplianceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupApplianceBackupProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.generationId != null && Object.hasOwnProperty.call(message, "generationId")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.generationId); - if (message.finalizeTime != null && Object.hasOwnProperty.call(message, "finalizeTime")) - $root.google.protobuf.Timestamp.encode(message.finalizeTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.recoveryRangeStartTime != null && Object.hasOwnProperty.call(message, "recoveryRangeStartTime")) - $root.google.protobuf.Timestamp.encode(message.recoveryRangeStartTime, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.recoveryRangeEndTime != null && Object.hasOwnProperty.call(message, "recoveryRangeEndTime")) - $root.google.protobuf.Timestamp.encode(message.recoveryRangeEndTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupApplianceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupApplianceBackupProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IBackupApplianceBackupProperties} message BackupApplianceBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupApplianceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupApplianceBackupProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.generationId = reader.int32(); - break; - } - case 2: { - message.finalizeTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 3: { - message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupApplianceBackupProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupApplianceBackupProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupApplianceBackupProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupApplianceBackupProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.generationId != null && message.hasOwnProperty("generationId")) { - properties._generationId = 1; - if (!$util.isInteger(message.generationId)) - return "generationId: integer expected"; - } - if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { - properties._finalizeTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.finalizeTime); - if (error) - return "finalizeTime." + error; - } - } - if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { - properties._recoveryRangeStartTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeStartTime); - if (error) - return "recoveryRangeStartTime." + error; - } - } - if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { - properties._recoveryRangeEndTime = 1; - { - var error = $root.google.protobuf.Timestamp.verify(message.recoveryRangeEndTime); - if (error) - return "recoveryRangeEndTime." + error; - } - } - return null; - }; - - /** - * Creates a BackupApplianceBackupProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupApplianceBackupProperties} BackupApplianceBackupProperties - */ - BackupApplianceBackupProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupApplianceBackupProperties(); - if (object.generationId != null) - message.generationId = object.generationId | 0; - if (object.finalizeTime != null) { - if (typeof object.finalizeTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.finalizeTime: object expected"); - message.finalizeTime = $root.google.protobuf.Timestamp.fromObject(object.finalizeTime); - } - if (object.recoveryRangeStartTime != null) { - if (typeof object.recoveryRangeStartTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeStartTime: object expected"); - message.recoveryRangeStartTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeStartTime); - } - if (object.recoveryRangeEndTime != null) { - if (typeof object.recoveryRangeEndTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupApplianceBackupProperties.recoveryRangeEndTime: object expected"); - message.recoveryRangeEndTime = $root.google.protobuf.Timestamp.fromObject(object.recoveryRangeEndTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupApplianceBackupProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.BackupApplianceBackupProperties} message BackupApplianceBackupProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupApplianceBackupProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.generationId != null && message.hasOwnProperty("generationId")) { - object.generationId = message.generationId; - if (options.oneofs) - object._generationId = "generationId"; - } - if (message.finalizeTime != null && message.hasOwnProperty("finalizeTime")) { - object.finalizeTime = $root.google.protobuf.Timestamp.toObject(message.finalizeTime, options); - if (options.oneofs) - object._finalizeTime = "finalizeTime"; - } - if (message.recoveryRangeStartTime != null && message.hasOwnProperty("recoveryRangeStartTime")) { - object.recoveryRangeStartTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeStartTime, options); - if (options.oneofs) - object._recoveryRangeStartTime = "recoveryRangeStartTime"; - } - if (message.recoveryRangeEndTime != null && message.hasOwnProperty("recoveryRangeEndTime")) { - object.recoveryRangeEndTime = $root.google.protobuf.Timestamp.toObject(message.recoveryRangeEndTime, options); - if (options.oneofs) - object._recoveryRangeEndTime = "recoveryRangeEndTime"; - } - return object; - }; - - /** - * Converts this BackupApplianceBackupProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @instance - * @returns {Object.} JSON object - */ - BackupApplianceBackupProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupApplianceBackupProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupApplianceBackupProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupApplianceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupApplianceBackupProperties"; - }; - - return BackupApplianceBackupProperties; - })(); - - v1.DiskTargetEnvironment = (function() { - - /** - * Properties of a DiskTargetEnvironment. - * @memberof google.cloud.backupdr.v1 - * @interface IDiskTargetEnvironment - * @property {string|null} [project] DiskTargetEnvironment project - * @property {string|null} [zone] DiskTargetEnvironment zone - */ - - /** - * Constructs a new DiskTargetEnvironment. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DiskTargetEnvironment. - * @implements IDiskTargetEnvironment - * @constructor - * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment=} [properties] Properties to set - */ - function DiskTargetEnvironment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskTargetEnvironment project. - * @member {string} project - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @instance - */ - DiskTargetEnvironment.prototype.project = ""; - - /** - * DiskTargetEnvironment zone. - * @member {string} zone - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @instance - */ - DiskTargetEnvironment.prototype.zone = ""; - - /** - * Creates a new DiskTargetEnvironment instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment instance - */ - DiskTargetEnvironment.create = function create(properties) { - return new DiskTargetEnvironment(properties); - }; - - /** - * Encodes the specified DiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment} message DiskTargetEnvironment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskTargetEnvironment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); - return writer; - }; - - /** - * Encodes the specified DiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskTargetEnvironment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IDiskTargetEnvironment} message DiskTargetEnvironment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskTargetEnvironment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskTargetEnvironment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskTargetEnvironment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.zone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskTargetEnvironment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskTargetEnvironment message. - * @function verify - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskTargetEnvironment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.zone != null && message.hasOwnProperty("zone")) - if (!$util.isString(message.zone)) - return "zone: string expected"; - return null; - }; - - /** - * Creates a DiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DiskTargetEnvironment} DiskTargetEnvironment - */ - DiskTargetEnvironment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DiskTargetEnvironment) - return object; - var message = new $root.google.cloud.backupdr.v1.DiskTargetEnvironment(); - if (object.project != null) - message.project = String(object.project); - if (object.zone != null) - message.zone = String(object.zone); - return message; - }; - - /** - * Creates a plain object from a DiskTargetEnvironment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.DiskTargetEnvironment} message DiskTargetEnvironment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskTargetEnvironment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.zone = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.zone != null && message.hasOwnProperty("zone")) - object.zone = message.zone; - return object; - }; - - /** - * Converts this DiskTargetEnvironment to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @instance - * @returns {Object.} JSON object - */ - DiskTargetEnvironment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskTargetEnvironment - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DiskTargetEnvironment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskTargetEnvironment"; - }; - - return DiskTargetEnvironment; - })(); - - v1.RegionDiskTargetEnvironment = (function() { - - /** - * Properties of a RegionDiskTargetEnvironment. - * @memberof google.cloud.backupdr.v1 - * @interface IRegionDiskTargetEnvironment - * @property {string|null} [project] RegionDiskTargetEnvironment project - * @property {string|null} [region] RegionDiskTargetEnvironment region - * @property {Array.|null} [replicaZones] RegionDiskTargetEnvironment replicaZones - */ - - /** - * Constructs a new RegionDiskTargetEnvironment. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a RegionDiskTargetEnvironment. - * @implements IRegionDiskTargetEnvironment - * @constructor - * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment=} [properties] Properties to set - */ - function RegionDiskTargetEnvironment(properties) { - this.replicaZones = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * RegionDiskTargetEnvironment project. - * @member {string} project - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @instance - */ - RegionDiskTargetEnvironment.prototype.project = ""; - - /** - * RegionDiskTargetEnvironment region. - * @member {string} region - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @instance - */ - RegionDiskTargetEnvironment.prototype.region = ""; - - /** - * RegionDiskTargetEnvironment replicaZones. - * @member {Array.} replicaZones - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @instance - */ - RegionDiskTargetEnvironment.prototype.replicaZones = $util.emptyArray; - - /** - * Creates a new RegionDiskTargetEnvironment instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment instance - */ - RegionDiskTargetEnvironment.create = function create(properties) { - return new RegionDiskTargetEnvironment(properties); - }; - - /** - * Encodes the specified RegionDiskTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment} message RegionDiskTargetEnvironment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegionDiskTargetEnvironment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.region); - if (message.replicaZones != null && message.replicaZones.length) - for (var i = 0; i < message.replicaZones.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.replicaZones[i]); - return writer; - }; - - /** - * Encodes the specified RegionDiskTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.RegionDiskTargetEnvironment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IRegionDiskTargetEnvironment} message RegionDiskTargetEnvironment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - RegionDiskTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegionDiskTargetEnvironment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.region = reader.string(); - break; - } - case 3: { - if (!(message.replicaZones && message.replicaZones.length)) - message.replicaZones = []; - message.replicaZones.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a RegionDiskTargetEnvironment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - RegionDiskTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a RegionDiskTargetEnvironment message. - * @function verify - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - RegionDiskTargetEnvironment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.region != null && message.hasOwnProperty("region")) - if (!$util.isString(message.region)) - return "region: string expected"; - if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { - if (!Array.isArray(message.replicaZones)) - return "replicaZones: array expected"; - for (var i = 0; i < message.replicaZones.length; ++i) - if (!$util.isString(message.replicaZones[i])) - return "replicaZones: string[] expected"; - } - return null; - }; - - /** - * Creates a RegionDiskTargetEnvironment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} RegionDiskTargetEnvironment - */ - RegionDiskTargetEnvironment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment) - return object; - var message = new $root.google.cloud.backupdr.v1.RegionDiskTargetEnvironment(); - if (object.project != null) - message.project = String(object.project); - if (object.region != null) - message.region = String(object.region); - if (object.replicaZones) { - if (!Array.isArray(object.replicaZones)) - throw TypeError(".google.cloud.backupdr.v1.RegionDiskTargetEnvironment.replicaZones: array expected"); - message.replicaZones = []; - for (var i = 0; i < object.replicaZones.length; ++i) - message.replicaZones[i] = String(object.replicaZones[i]); - } - return message; - }; - - /** - * Creates a plain object from a RegionDiskTargetEnvironment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} message RegionDiskTargetEnvironment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - RegionDiskTargetEnvironment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicaZones = []; - if (options.defaults) { - object.project = ""; - object.region = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.region != null && message.hasOwnProperty("region")) - object.region = message.region; - if (message.replicaZones && message.replicaZones.length) { - object.replicaZones = []; - for (var j = 0; j < message.replicaZones.length; ++j) - object.replicaZones[j] = message.replicaZones[j]; - } - return object; - }; - - /** - * Converts this RegionDiskTargetEnvironment to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @instance - * @returns {Object.} JSON object - */ - RegionDiskTargetEnvironment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for RegionDiskTargetEnvironment - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.RegionDiskTargetEnvironment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - RegionDiskTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.RegionDiskTargetEnvironment"; - }; - - return RegionDiskTargetEnvironment; - })(); - - v1.DiskRestoreProperties = (function() { - - /** - * Properties of a DiskRestoreProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IDiskRestoreProperties - * @property {string|null} [name] DiskRestoreProperties name - * @property {string|null} [description] DiskRestoreProperties description - * @property {number|Long|null} [sizeGb] DiskRestoreProperties sizeGb - * @property {Array.|null} [licenses] DiskRestoreProperties licenses - * @property {Array.|null} [guestOsFeature] DiskRestoreProperties guestOsFeature - * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] DiskRestoreProperties diskEncryptionKey - * @property {number|Long|null} [physicalBlockSizeBytes] DiskRestoreProperties physicalBlockSizeBytes - * @property {number|Long|null} [provisionedIops] DiskRestoreProperties provisionedIops - * @property {number|Long|null} [provisionedThroughput] DiskRestoreProperties provisionedThroughput - * @property {boolean|null} [enableConfidentialCompute] DiskRestoreProperties enableConfidentialCompute - * @property {string|null} [storagePool] DiskRestoreProperties storagePool - * @property {google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null} [accessMode] DiskRestoreProperties accessMode - * @property {google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null} [architecture] DiskRestoreProperties architecture - * @property {Array.|null} [resourcePolicy] DiskRestoreProperties resourcePolicy - * @property {string|null} [type] DiskRestoreProperties type - * @property {Object.|null} [labels] DiskRestoreProperties labels - * @property {Object.|null} [resourceManagerTags] DiskRestoreProperties resourceManagerTags - */ - - /** - * Constructs a new DiskRestoreProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DiskRestoreProperties. - * @implements IDiskRestoreProperties - * @constructor - * @param {google.cloud.backupdr.v1.IDiskRestoreProperties=} [properties] Properties to set - */ - function DiskRestoreProperties(properties) { - this.licenses = []; - this.guestOsFeature = []; - this.resourcePolicy = []; - this.labels = {}; - this.resourceManagerTags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskRestoreProperties name. - * @member {string|null|undefined} name - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.name = null; - - /** - * DiskRestoreProperties description. - * @member {string|null|undefined} description - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.description = null; - - /** - * DiskRestoreProperties sizeGb. - * @member {number|Long|null|undefined} sizeGb - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.sizeGb = null; - - /** - * DiskRestoreProperties licenses. - * @member {Array.} licenses - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.licenses = $util.emptyArray; - - /** - * DiskRestoreProperties guestOsFeature. - * @member {Array.} guestOsFeature - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.guestOsFeature = $util.emptyArray; - - /** - * DiskRestoreProperties diskEncryptionKey. - * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.diskEncryptionKey = null; - - /** - * DiskRestoreProperties physicalBlockSizeBytes. - * @member {number|Long|null|undefined} physicalBlockSizeBytes - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.physicalBlockSizeBytes = null; - - /** - * DiskRestoreProperties provisionedIops. - * @member {number|Long|null|undefined} provisionedIops - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.provisionedIops = null; - - /** - * DiskRestoreProperties provisionedThroughput. - * @member {number|Long|null|undefined} provisionedThroughput - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.provisionedThroughput = null; - - /** - * DiskRestoreProperties enableConfidentialCompute. - * @member {boolean|null|undefined} enableConfidentialCompute - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.enableConfidentialCompute = null; - - /** - * DiskRestoreProperties storagePool. - * @member {string|null|undefined} storagePool - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.storagePool = null; - - /** - * DiskRestoreProperties accessMode. - * @member {google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode|null|undefined} accessMode - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.accessMode = null; - - /** - * DiskRestoreProperties architecture. - * @member {google.cloud.backupdr.v1.DiskRestoreProperties.Architecture|null|undefined} architecture - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.architecture = null; - - /** - * DiskRestoreProperties resourcePolicy. - * @member {Array.} resourcePolicy - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.resourcePolicy = $util.emptyArray; - - /** - * DiskRestoreProperties type. - * @member {string|null|undefined} type - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.type = null; - - /** - * DiskRestoreProperties labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.labels = $util.emptyObject; - - /** - * DiskRestoreProperties resourceManagerTags. - * @member {Object.} resourceManagerTags - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - */ - DiskRestoreProperties.prototype.resourceManagerTags = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_description", { - get: $util.oneOfGetter($oneOfFields = ["description"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_sizeGb", { - get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_diskEncryptionKey", { - get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_physicalBlockSizeBytes", { - get: $util.oneOfGetter($oneOfFields = ["physicalBlockSizeBytes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_provisionedIops", { - get: $util.oneOfGetter($oneOfFields = ["provisionedIops"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_provisionedThroughput", { - get: $util.oneOfGetter($oneOfFields = ["provisionedThroughput"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_enableConfidentialCompute", { - get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_storagePool", { - get: $util.oneOfGetter($oneOfFields = ["storagePool"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_accessMode", { - get: $util.oneOfGetter($oneOfFields = ["accessMode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_architecture", { - get: $util.oneOfGetter($oneOfFields = ["architecture"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskRestoreProperties.prototype, "_type", { - get: $util.oneOfGetter($oneOfFields = ["type"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DiskRestoreProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskRestoreProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties instance - */ - DiskRestoreProperties.create = function create(properties) { - return new DiskRestoreProperties(properties); - }; - - /** - * Encodes the specified DiskRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskRestoreProperties} message DiskRestoreProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskRestoreProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 3, wireType 0 =*/24).int64(message.sizeGb); - if (message.licenses != null && message.licenses.length) - for (var i = 0; i < message.licenses.length; ++i) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.licenses[i]); - if (message.guestOsFeature != null && message.guestOsFeature.length) - for (var i = 0; i < message.guestOsFeature.length; ++i) - $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) - $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.physicalBlockSizeBytes != null && Object.hasOwnProperty.call(message, "physicalBlockSizeBytes")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.physicalBlockSizeBytes); - if (message.provisionedIops != null && Object.hasOwnProperty.call(message, "provisionedIops")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.provisionedIops); - if (message.provisionedThroughput != null && Object.hasOwnProperty.call(message, "provisionedThroughput")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.provisionedThroughput); - if (message.enableConfidentialCompute != null && Object.hasOwnProperty.call(message, "enableConfidentialCompute")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.enableConfidentialCompute); - if (message.storagePool != null && Object.hasOwnProperty.call(message, "storagePool")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.storagePool); - if (message.accessMode != null && Object.hasOwnProperty.call(message, "accessMode")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.accessMode); - if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) - writer.uint32(/* id 14, wireType 0 =*/112).int32(message.architecture); - if (message.resourcePolicy != null && message.resourcePolicy.length) - for (var i = 0; i < message.resourcePolicy.length; ++i) - writer.uint32(/* id 15, wireType 2 =*/122).string(message.resourcePolicy[i]); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.type); - 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 17, wireType 2 =*/138).fork().uint32(/* id 1, wireType 2 =*/10).string(keys[i]).uint32(/* id 2, wireType 2 =*/18).string(message.labels[keys[i]]).ldelim(); - if (message.resourceManagerTags != null && Object.hasOwnProperty.call(message, "resourceManagerTags")) - for (var keys = Object.keys(message.resourceManagerTags), 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.resourceManagerTags[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified DiskRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskRestoreProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskRestoreProperties} message DiskRestoreProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskRestoreProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskRestoreProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskRestoreProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskRestoreProperties(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.sizeGb = reader.int64(); - break; - } - case 4: { - if (!(message.licenses && message.licenses.length)) - message.licenses = []; - message.licenses.push(reader.string()); - break; - } - case 5: { - if (!(message.guestOsFeature && message.guestOsFeature.length)) - message.guestOsFeature = []; - message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); - break; - } - case 6: { - message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); - break; - } - case 7: { - message.physicalBlockSizeBytes = reader.int64(); - break; - } - case 8: { - message.provisionedIops = reader.int64(); - break; - } - case 9: { - message.provisionedThroughput = reader.int64(); - break; - } - case 10: { - message.enableConfidentialCompute = reader.bool(); - break; - } - case 11: { - message.storagePool = reader.string(); - break; - } - case 12: { - message.accessMode = reader.int32(); - break; - } - case 14: { - message.architecture = reader.int32(); - break; - } - case 15: { - if (!(message.resourcePolicy && message.resourcePolicy.length)) - message.resourcePolicy = []; - message.resourcePolicy.push(reader.string()); - break; - } - case 16: { - message.type = reader.string(); - break; - } - case 17: { - 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 18: { - if (message.resourceManagerTags === $util.emptyObject) - message.resourceManagerTags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.resourceManagerTags[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskRestoreProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskRestoreProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskRestoreProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskRestoreProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.description != null && message.hasOwnProperty("description")) { - properties._description = 1; - if (!$util.isString(message.description)) - return "description: string expected"; - } - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { - properties._sizeGb = 1; - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - } - if (message.licenses != null && message.hasOwnProperty("licenses")) { - if (!Array.isArray(message.licenses)) - return "licenses: array expected"; - for (var i = 0; i < message.licenses.length; ++i) - if (!$util.isString(message.licenses[i])) - return "licenses: string[] expected"; - } - if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { - if (!Array.isArray(message.guestOsFeature)) - return "guestOsFeature: array expected"; - for (var i = 0; i < message.guestOsFeature.length; ++i) { - var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); - if (error) - return "guestOsFeature." + error; - } - } - if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { - properties._diskEncryptionKey = 1; - { - var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); - if (error) - return "diskEncryptionKey." + error; - } - } - if (message.physicalBlockSizeBytes != null && message.hasOwnProperty("physicalBlockSizeBytes")) { - properties._physicalBlockSizeBytes = 1; - if (!$util.isInteger(message.physicalBlockSizeBytes) && !(message.physicalBlockSizeBytes && $util.isInteger(message.physicalBlockSizeBytes.low) && $util.isInteger(message.physicalBlockSizeBytes.high))) - return "physicalBlockSizeBytes: integer|Long expected"; - } - if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { - properties._provisionedIops = 1; - if (!$util.isInteger(message.provisionedIops) && !(message.provisionedIops && $util.isInteger(message.provisionedIops.low) && $util.isInteger(message.provisionedIops.high))) - return "provisionedIops: integer|Long expected"; - } - if (message.provisionedThroughput != null && message.hasOwnProperty("provisionedThroughput")) { - properties._provisionedThroughput = 1; - if (!$util.isInteger(message.provisionedThroughput) && !(message.provisionedThroughput && $util.isInteger(message.provisionedThroughput.low) && $util.isInteger(message.provisionedThroughput.high))) - return "provisionedThroughput: integer|Long expected"; - } - if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { - properties._enableConfidentialCompute = 1; - if (typeof message.enableConfidentialCompute !== "boolean") - return "enableConfidentialCompute: boolean expected"; - } - if (message.storagePool != null && message.hasOwnProperty("storagePool")) { - properties._storagePool = 1; - if (!$util.isString(message.storagePool)) - return "storagePool: string expected"; - } - if (message.accessMode != null && message.hasOwnProperty("accessMode")) { - properties._accessMode = 1; - switch (message.accessMode) { - default: - return "accessMode: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.architecture != null && message.hasOwnProperty("architecture")) { - properties._architecture = 1; - switch (message.architecture) { - default: - return "architecture: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.resourcePolicy != null && message.hasOwnProperty("resourcePolicy")) { - if (!Array.isArray(message.resourcePolicy)) - return "resourcePolicy: array expected"; - for (var i = 0; i < message.resourcePolicy.length; ++i) - if (!$util.isString(message.resourcePolicy[i])) - return "resourcePolicy: string[] expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - properties._type = 1; - if (!$util.isString(message.type)) - return "type: 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.resourceManagerTags != null && message.hasOwnProperty("resourceManagerTags")) { - if (!$util.isObject(message.resourceManagerTags)) - return "resourceManagerTags: object expected"; - var key = Object.keys(message.resourceManagerTags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.resourceManagerTags[key[i]])) - return "resourceManagerTags: string{k:string} expected"; - } - return null; - }; - - /** - * Creates a DiskRestoreProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DiskRestoreProperties} DiskRestoreProperties - */ - DiskRestoreProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DiskRestoreProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.DiskRestoreProperties(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - if (object.licenses) { - if (!Array.isArray(object.licenses)) - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.licenses: array expected"); - message.licenses = []; - for (var i = 0; i < object.licenses.length; ++i) - message.licenses[i] = String(object.licenses[i]); - } - if (object.guestOsFeature) { - if (!Array.isArray(object.guestOsFeature)) - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.guestOsFeature: array expected"); - message.guestOsFeature = []; - for (var i = 0; i < object.guestOsFeature.length; ++i) { - if (typeof object.guestOsFeature[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.guestOsFeature: object expected"); - message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); - } - } - if (object.diskEncryptionKey != null) { - if (typeof object.diskEncryptionKey !== "object") - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.diskEncryptionKey: object expected"); - message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); - } - if (object.physicalBlockSizeBytes != null) - if ($util.Long) - (message.physicalBlockSizeBytes = $util.Long.fromValue(object.physicalBlockSizeBytes)).unsigned = false; - else if (typeof object.physicalBlockSizeBytes === "string") - message.physicalBlockSizeBytes = parseInt(object.physicalBlockSizeBytes, 10); - else if (typeof object.physicalBlockSizeBytes === "number") - message.physicalBlockSizeBytes = object.physicalBlockSizeBytes; - else if (typeof object.physicalBlockSizeBytes === "object") - message.physicalBlockSizeBytes = new $util.LongBits(object.physicalBlockSizeBytes.low >>> 0, object.physicalBlockSizeBytes.high >>> 0).toNumber(); - if (object.provisionedIops != null) - if ($util.Long) - (message.provisionedIops = $util.Long.fromValue(object.provisionedIops)).unsigned = false; - else if (typeof object.provisionedIops === "string") - message.provisionedIops = parseInt(object.provisionedIops, 10); - else if (typeof object.provisionedIops === "number") - message.provisionedIops = object.provisionedIops; - else if (typeof object.provisionedIops === "object") - message.provisionedIops = new $util.LongBits(object.provisionedIops.low >>> 0, object.provisionedIops.high >>> 0).toNumber(); - if (object.provisionedThroughput != null) - if ($util.Long) - (message.provisionedThroughput = $util.Long.fromValue(object.provisionedThroughput)).unsigned = false; - else if (typeof object.provisionedThroughput === "string") - message.provisionedThroughput = parseInt(object.provisionedThroughput, 10); - else if (typeof object.provisionedThroughput === "number") - message.provisionedThroughput = object.provisionedThroughput; - else if (typeof object.provisionedThroughput === "object") - message.provisionedThroughput = new $util.LongBits(object.provisionedThroughput.low >>> 0, object.provisionedThroughput.high >>> 0).toNumber(); - if (object.enableConfidentialCompute != null) - message.enableConfidentialCompute = Boolean(object.enableConfidentialCompute); - if (object.storagePool != null) - message.storagePool = String(object.storagePool); - switch (object.accessMode) { - default: - if (typeof object.accessMode === "number") { - message.accessMode = object.accessMode; - break; - } - break; - case "READ_WRITE_SINGLE": - case 0: - message.accessMode = 0; - break; - case "READ_WRITE_MANY": - case 1: - message.accessMode = 1; - break; - case "READ_ONLY_MANY": - case 2: - message.accessMode = 2; - break; - } - switch (object.architecture) { - default: - if (typeof object.architecture === "number") { - message.architecture = object.architecture; - break; - } - break; - case "ARCHITECTURE_UNSPECIFIED": - case 0: - message.architecture = 0; - break; - case "X86_64": - case 1: - message.architecture = 1; - break; - case "ARM64": - case 2: - message.architecture = 2; - break; - } - if (object.resourcePolicy) { - if (!Array.isArray(object.resourcePolicy)) - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.resourcePolicy: array expected"); - message.resourcePolicy = []; - for (var i = 0; i < object.resourcePolicy.length; ++i) - message.resourcePolicy[i] = String(object.resourcePolicy[i]); - } - if (object.type != null) - message.type = String(object.type); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.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.resourceManagerTags) { - if (typeof object.resourceManagerTags !== "object") - throw TypeError(".google.cloud.backupdr.v1.DiskRestoreProperties.resourceManagerTags: object expected"); - message.resourceManagerTags = {}; - for (var keys = Object.keys(object.resourceManagerTags), i = 0; i < keys.length; ++i) - message.resourceManagerTags[keys[i]] = String(object.resourceManagerTags[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from a DiskRestoreProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.DiskRestoreProperties} message DiskRestoreProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskRestoreProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.licenses = []; - object.guestOsFeature = []; - object.resourcePolicy = []; - } - if (options.objects || options.defaults) { - object.labels = {}; - object.resourceManagerTags = {}; - } - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.description != null && message.hasOwnProperty("description")) { - object.description = message.description; - if (options.oneofs) - object._description = "description"; - } - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - if (options.oneofs) - object._sizeGb = "sizeGb"; - } - if (message.licenses && message.licenses.length) { - object.licenses = []; - for (var j = 0; j < message.licenses.length; ++j) - object.licenses[j] = message.licenses[j]; - } - if (message.guestOsFeature && message.guestOsFeature.length) { - object.guestOsFeature = []; - for (var j = 0; j < message.guestOsFeature.length; ++j) - object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); - } - if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { - object.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); - if (options.oneofs) - object._diskEncryptionKey = "diskEncryptionKey"; - } - if (message.physicalBlockSizeBytes != null && message.hasOwnProperty("physicalBlockSizeBytes")) { - if (typeof message.physicalBlockSizeBytes === "number") - object.physicalBlockSizeBytes = options.longs === String ? String(message.physicalBlockSizeBytes) : message.physicalBlockSizeBytes; - else - object.physicalBlockSizeBytes = options.longs === String ? $util.Long.prototype.toString.call(message.physicalBlockSizeBytes) : options.longs === Number ? new $util.LongBits(message.physicalBlockSizeBytes.low >>> 0, message.physicalBlockSizeBytes.high >>> 0).toNumber() : message.physicalBlockSizeBytes; - if (options.oneofs) - object._physicalBlockSizeBytes = "physicalBlockSizeBytes"; - } - if (message.provisionedIops != null && message.hasOwnProperty("provisionedIops")) { - if (typeof message.provisionedIops === "number") - object.provisionedIops = options.longs === String ? String(message.provisionedIops) : message.provisionedIops; - else - object.provisionedIops = options.longs === String ? $util.Long.prototype.toString.call(message.provisionedIops) : options.longs === Number ? new $util.LongBits(message.provisionedIops.low >>> 0, message.provisionedIops.high >>> 0).toNumber() : message.provisionedIops; - if (options.oneofs) - object._provisionedIops = "provisionedIops"; - } - if (message.provisionedThroughput != null && message.hasOwnProperty("provisionedThroughput")) { - if (typeof message.provisionedThroughput === "number") - object.provisionedThroughput = options.longs === String ? String(message.provisionedThroughput) : message.provisionedThroughput; - else - object.provisionedThroughput = options.longs === String ? $util.Long.prototype.toString.call(message.provisionedThroughput) : options.longs === Number ? new $util.LongBits(message.provisionedThroughput.low >>> 0, message.provisionedThroughput.high >>> 0).toNumber() : message.provisionedThroughput; - if (options.oneofs) - object._provisionedThroughput = "provisionedThroughput"; - } - if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { - object.enableConfidentialCompute = message.enableConfidentialCompute; - if (options.oneofs) - object._enableConfidentialCompute = "enableConfidentialCompute"; - } - if (message.storagePool != null && message.hasOwnProperty("storagePool")) { - object.storagePool = message.storagePool; - if (options.oneofs) - object._storagePool = "storagePool"; - } - if (message.accessMode != null && message.hasOwnProperty("accessMode")) { - object.accessMode = options.enums === String ? $root.google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode[message.accessMode] === undefined ? message.accessMode : $root.google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode[message.accessMode] : message.accessMode; - if (options.oneofs) - object._accessMode = "accessMode"; - } - if (message.architecture != null && message.hasOwnProperty("architecture")) { - object.architecture = options.enums === String ? $root.google.cloud.backupdr.v1.DiskRestoreProperties.Architecture[message.architecture] === undefined ? message.architecture : $root.google.cloud.backupdr.v1.DiskRestoreProperties.Architecture[message.architecture] : message.architecture; - if (options.oneofs) - object._architecture = "architecture"; - } - if (message.resourcePolicy && message.resourcePolicy.length) { - object.resourcePolicy = []; - for (var j = 0; j < message.resourcePolicy.length; ++j) - object.resourcePolicy[j] = message.resourcePolicy[j]; - } - if (message.type != null && message.hasOwnProperty("type")) { - object.type = message.type; - if (options.oneofs) - object._type = "type"; - } - 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.resourceManagerTags && (keys2 = Object.keys(message.resourceManagerTags)).length) { - object.resourceManagerTags = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceManagerTags[keys2[j]] = message.resourceManagerTags[keys2[j]]; - } - return object; - }; - - /** - * Converts this DiskRestoreProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @instance - * @returns {Object.} JSON object - */ - DiskRestoreProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskRestoreProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DiskRestoreProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskRestoreProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskRestoreProperties"; - }; - - /** - * AccessMode enum. - * @name google.cloud.backupdr.v1.DiskRestoreProperties.AccessMode - * @enum {number} - * @property {number} READ_WRITE_SINGLE=0 READ_WRITE_SINGLE value - * @property {number} READ_WRITE_MANY=1 READ_WRITE_MANY value - * @property {number} READ_ONLY_MANY=2 READ_ONLY_MANY value - */ - DiskRestoreProperties.AccessMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "READ_WRITE_SINGLE"] = 0; - values[valuesById[1] = "READ_WRITE_MANY"] = 1; - values[valuesById[2] = "READ_ONLY_MANY"] = 2; - return values; - })(); - - /** - * Architecture enum. - * @name google.cloud.backupdr.v1.DiskRestoreProperties.Architecture - * @enum {number} - * @property {number} ARCHITECTURE_UNSPECIFIED=0 ARCHITECTURE_UNSPECIFIED value - * @property {number} X86_64=1 X86_64 value - * @property {number} ARM64=2 ARM64 value - */ - DiskRestoreProperties.Architecture = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ARCHITECTURE_UNSPECIFIED"] = 0; - values[valuesById[1] = "X86_64"] = 1; - values[valuesById[2] = "ARM64"] = 2; - return values; - })(); - - return DiskRestoreProperties; - })(); - - v1.DiskBackupProperties = (function() { - - /** - * Properties of a DiskBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IDiskBackupProperties - * @property {string|null} [description] DiskBackupProperties description - * @property {Array.|null} [licenses] DiskBackupProperties licenses - * @property {Array.|null} [guestOsFeature] DiskBackupProperties guestOsFeature - * @property {google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null} [architecture] DiskBackupProperties architecture - * @property {string|null} [type] DiskBackupProperties type - * @property {number|Long|null} [sizeGb] DiskBackupProperties sizeGb - * @property {string|null} [region] DiskBackupProperties region - * @property {string|null} [zone] DiskBackupProperties zone - * @property {Array.|null} [replicaZones] DiskBackupProperties replicaZones - * @property {string|null} [sourceDisk] DiskBackupProperties sourceDisk - */ - - /** - * Constructs a new DiskBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DiskBackupProperties. - * @implements IDiskBackupProperties - * @constructor - * @param {google.cloud.backupdr.v1.IDiskBackupProperties=} [properties] Properties to set - */ - function DiskBackupProperties(properties) { - this.licenses = []; - this.guestOsFeature = []; - this.replicaZones = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskBackupProperties description. - * @member {string|null|undefined} description - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.description = null; - - /** - * DiskBackupProperties licenses. - * @member {Array.} licenses - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.licenses = $util.emptyArray; - - /** - * DiskBackupProperties guestOsFeature. - * @member {Array.} guestOsFeature - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.guestOsFeature = $util.emptyArray; - - /** - * DiskBackupProperties architecture. - * @member {google.cloud.backupdr.v1.DiskBackupProperties.Architecture|null|undefined} architecture - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.architecture = null; - - /** - * DiskBackupProperties type. - * @member {string|null|undefined} type - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.type = null; - - /** - * DiskBackupProperties sizeGb. - * @member {number|Long|null|undefined} sizeGb - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.sizeGb = null; - - /** - * DiskBackupProperties region. - * @member {string|null|undefined} region - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.region = null; - - /** - * DiskBackupProperties zone. - * @member {string|null|undefined} zone - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.zone = null; - - /** - * DiskBackupProperties replicaZones. - * @member {Array.} replicaZones - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.replicaZones = $util.emptyArray; - - /** - * DiskBackupProperties sourceDisk. - * @member {string|null|undefined} sourceDisk - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - */ - DiskBackupProperties.prototype.sourceDisk = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_description", { - get: $util.oneOfGetter($oneOfFields = ["description"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_architecture", { - get: $util.oneOfGetter($oneOfFields = ["architecture"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_type", { - get: $util.oneOfGetter($oneOfFields = ["type"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_sizeGb", { - get: $util.oneOfGetter($oneOfFields = ["sizeGb"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_region", { - get: $util.oneOfGetter($oneOfFields = ["region"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_zone", { - get: $util.oneOfGetter($oneOfFields = ["zone"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DiskBackupProperties.prototype, "_sourceDisk", { - get: $util.oneOfGetter($oneOfFields = ["sourceDisk"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DiskBackupProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskBackupProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties instance - */ - DiskBackupProperties.create = function create(properties) { - return new DiskBackupProperties(properties); - }; - - /** - * Encodes the specified DiskBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskBackupProperties} message DiskBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskBackupProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.licenses != null && message.licenses.length) - for (var i = 0; i < message.licenses.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.licenses[i]); - if (message.guestOsFeature != null && message.guestOsFeature.length) - for (var i = 0; i < message.guestOsFeature.length; ++i) - $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.architecture != null && Object.hasOwnProperty.call(message, "architecture")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.architecture); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.type); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 6, wireType 0 =*/48).int64(message.sizeGb); - if (message.region != null && Object.hasOwnProperty.call(message, "region")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.region); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.zone); - if (message.replicaZones != null && message.replicaZones.length) - for (var i = 0; i < message.replicaZones.length; ++i) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.replicaZones[i]); - if (message.sourceDisk != null && Object.hasOwnProperty.call(message, "sourceDisk")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.sourceDisk); - return writer; - }; - - /** - * Encodes the specified DiskBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskBackupProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskBackupProperties} message DiskBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskBackupProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskBackupProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskBackupProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - case 2: { - if (!(message.licenses && message.licenses.length)) - message.licenses = []; - message.licenses.push(reader.string()); - break; - } - case 3: { - if (!(message.guestOsFeature && message.guestOsFeature.length)) - message.guestOsFeature = []; - message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); - break; - } - case 4: { - message.architecture = reader.int32(); - break; - } - case 5: { - message.type = reader.string(); - break; - } - case 6: { - message.sizeGb = reader.int64(); - break; - } - case 7: { - message.region = reader.string(); - break; - } - case 8: { - message.zone = reader.string(); - break; - } - case 9: { - if (!(message.replicaZones && message.replicaZones.length)) - message.replicaZones = []; - message.replicaZones.push(reader.string()); - break; - } - case 10: { - message.sourceDisk = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskBackupProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskBackupProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskBackupProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskBackupProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.description != null && message.hasOwnProperty("description")) { - properties._description = 1; - if (!$util.isString(message.description)) - return "description: string expected"; - } - if (message.licenses != null && message.hasOwnProperty("licenses")) { - if (!Array.isArray(message.licenses)) - return "licenses: array expected"; - for (var i = 0; i < message.licenses.length; ++i) - if (!$util.isString(message.licenses[i])) - return "licenses: string[] expected"; - } - if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { - if (!Array.isArray(message.guestOsFeature)) - return "guestOsFeature: array expected"; - for (var i = 0; i < message.guestOsFeature.length; ++i) { - var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); - if (error) - return "guestOsFeature." + error; - } - } - if (message.architecture != null && message.hasOwnProperty("architecture")) { - properties._architecture = 1; - switch (message.architecture) { - default: - return "architecture: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.type != null && message.hasOwnProperty("type")) { - properties._type = 1; - if (!$util.isString(message.type)) - return "type: string expected"; - } - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { - properties._sizeGb = 1; - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - } - if (message.region != null && message.hasOwnProperty("region")) { - properties._region = 1; - if (!$util.isString(message.region)) - return "region: string expected"; - } - if (message.zone != null && message.hasOwnProperty("zone")) { - properties._zone = 1; - if (!$util.isString(message.zone)) - return "zone: string expected"; - } - if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { - if (!Array.isArray(message.replicaZones)) - return "replicaZones: array expected"; - for (var i = 0; i < message.replicaZones.length; ++i) - if (!$util.isString(message.replicaZones[i])) - return "replicaZones: string[] expected"; - } - if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { - properties._sourceDisk = 1; - if (!$util.isString(message.sourceDisk)) - return "sourceDisk: string expected"; - } - return null; - }; - - /** - * Creates a DiskBackupProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DiskBackupProperties} DiskBackupProperties - */ - DiskBackupProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DiskBackupProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.DiskBackupProperties(); - if (object.description != null) - message.description = String(object.description); - if (object.licenses) { - if (!Array.isArray(object.licenses)) - throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.licenses: array expected"); - message.licenses = []; - for (var i = 0; i < object.licenses.length; ++i) - message.licenses[i] = String(object.licenses[i]); - } - if (object.guestOsFeature) { - if (!Array.isArray(object.guestOsFeature)) - throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.guestOsFeature: array expected"); - message.guestOsFeature = []; - for (var i = 0; i < object.guestOsFeature.length; ++i) { - if (typeof object.guestOsFeature[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.guestOsFeature: object expected"); - message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); - } - } - switch (object.architecture) { - default: - if (typeof object.architecture === "number") { - message.architecture = object.architecture; - break; - } - break; - case "ARCHITECTURE_UNSPECIFIED": - case 0: - message.architecture = 0; - break; - case "X86_64": - case 1: - message.architecture = 1; - break; - case "ARM64": - case 2: - message.architecture = 2; - break; - } - if (object.type != null) - message.type = String(object.type); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - if (object.region != null) - message.region = String(object.region); - if (object.zone != null) - message.zone = String(object.zone); - if (object.replicaZones) { - if (!Array.isArray(object.replicaZones)) - throw TypeError(".google.cloud.backupdr.v1.DiskBackupProperties.replicaZones: array expected"); - message.replicaZones = []; - for (var i = 0; i < object.replicaZones.length; ++i) - message.replicaZones[i] = String(object.replicaZones[i]); - } - if (object.sourceDisk != null) - message.sourceDisk = String(object.sourceDisk); - return message; - }; - - /** - * Creates a plain object from a DiskBackupProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {google.cloud.backupdr.v1.DiskBackupProperties} message DiskBackupProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskBackupProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.licenses = []; - object.guestOsFeature = []; - object.replicaZones = []; - } - if (message.description != null && message.hasOwnProperty("description")) { - object.description = message.description; - if (options.oneofs) - object._description = "description"; - } - if (message.licenses && message.licenses.length) { - object.licenses = []; - for (var j = 0; j < message.licenses.length; ++j) - object.licenses[j] = message.licenses[j]; - } - if (message.guestOsFeature && message.guestOsFeature.length) { - object.guestOsFeature = []; - for (var j = 0; j < message.guestOsFeature.length; ++j) - object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); - } - if (message.architecture != null && message.hasOwnProperty("architecture")) { - object.architecture = options.enums === String ? $root.google.cloud.backupdr.v1.DiskBackupProperties.Architecture[message.architecture] === undefined ? message.architecture : $root.google.cloud.backupdr.v1.DiskBackupProperties.Architecture[message.architecture] : message.architecture; - if (options.oneofs) - object._architecture = "architecture"; - } - if (message.type != null && message.hasOwnProperty("type")) { - object.type = message.type; - if (options.oneofs) - object._type = "type"; - } - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) { - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - if (options.oneofs) - object._sizeGb = "sizeGb"; - } - if (message.region != null && message.hasOwnProperty("region")) { - object.region = message.region; - if (options.oneofs) - object._region = "region"; - } - if (message.zone != null && message.hasOwnProperty("zone")) { - object.zone = message.zone; - if (options.oneofs) - object._zone = "zone"; - } - if (message.replicaZones && message.replicaZones.length) { - object.replicaZones = []; - for (var j = 0; j < message.replicaZones.length; ++j) - object.replicaZones[j] = message.replicaZones[j]; - } - if (message.sourceDisk != null && message.hasOwnProperty("sourceDisk")) { - object.sourceDisk = message.sourceDisk; - if (options.oneofs) - object._sourceDisk = "sourceDisk"; - } - return object; - }; - - /** - * Converts this DiskBackupProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @instance - * @returns {Object.} JSON object - */ - DiskBackupProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskBackupProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DiskBackupProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskBackupProperties"; - }; - - /** - * Architecture enum. - * @name google.cloud.backupdr.v1.DiskBackupProperties.Architecture - * @enum {number} - * @property {number} ARCHITECTURE_UNSPECIFIED=0 ARCHITECTURE_UNSPECIFIED value - * @property {number} X86_64=1 X86_64 value - * @property {number} ARM64=2 ARM64 value - */ - DiskBackupProperties.Architecture = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ARCHITECTURE_UNSPECIFIED"] = 0; - values[valuesById[1] = "X86_64"] = 1; - values[valuesById[2] = "ARM64"] = 2; - return values; - })(); - - return DiskBackupProperties; - })(); - - v1.DiskDataSourceProperties = (function() { - - /** - * Properties of a DiskDataSourceProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IDiskDataSourceProperties - * @property {string|null} [name] DiskDataSourceProperties name - * @property {string|null} [description] DiskDataSourceProperties description - * @property {string|null} [type] DiskDataSourceProperties type - * @property {number|Long|null} [sizeGb] DiskDataSourceProperties sizeGb - */ - - /** - * Constructs a new DiskDataSourceProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DiskDataSourceProperties. - * @implements IDiskDataSourceProperties - * @constructor - * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties=} [properties] Properties to set - */ - function DiskDataSourceProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DiskDataSourceProperties name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @instance - */ - DiskDataSourceProperties.prototype.name = ""; - - /** - * DiskDataSourceProperties description. - * @member {string} description - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @instance - */ - DiskDataSourceProperties.prototype.description = ""; - - /** - * DiskDataSourceProperties type. - * @member {string} type - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @instance - */ - DiskDataSourceProperties.prototype.type = ""; - - /** - * DiskDataSourceProperties sizeGb. - * @member {number|Long} sizeGb - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @instance - */ - DiskDataSourceProperties.prototype.sizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new DiskDataSourceProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties instance - */ - DiskDataSourceProperties.create = function create(properties) { - return new DiskDataSourceProperties(properties); - }; - - /** - * Encodes the specified DiskDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties} message DiskDataSourceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskDataSourceProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.type); - if (message.sizeGb != null && Object.hasOwnProperty.call(message, "sizeGb")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.sizeGb); - return writer; - }; - - /** - * Encodes the specified DiskDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DiskDataSourceProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.IDiskDataSourceProperties} message DiskDataSourceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DiskDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DiskDataSourceProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskDataSourceProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DiskDataSourceProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.type = reader.string(); - break; - } - case 4: { - message.sizeGb = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DiskDataSourceProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DiskDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DiskDataSourceProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DiskDataSourceProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (!$util.isInteger(message.sizeGb) && !(message.sizeGb && $util.isInteger(message.sizeGb.low) && $util.isInteger(message.sizeGb.high))) - return "sizeGb: integer|Long expected"; - return null; - }; - - /** - * Creates a DiskDataSourceProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DiskDataSourceProperties} DiskDataSourceProperties - */ - DiskDataSourceProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DiskDataSourceProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.DiskDataSourceProperties(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.type != null) - message.type = String(object.type); - if (object.sizeGb != null) - if ($util.Long) - (message.sizeGb = $util.Long.fromValue(object.sizeGb)).unsigned = false; - else if (typeof object.sizeGb === "string") - message.sizeGb = parseInt(object.sizeGb, 10); - else if (typeof object.sizeGb === "number") - message.sizeGb = object.sizeGb; - else if (typeof object.sizeGb === "object") - message.sizeGb = new $util.LongBits(object.sizeGb.low >>> 0, object.sizeGb.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a DiskDataSourceProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.DiskDataSourceProperties} message DiskDataSourceProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DiskDataSourceProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.type = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.sizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.sizeGb = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.sizeGb != null && message.hasOwnProperty("sizeGb")) - if (typeof message.sizeGb === "number") - object.sizeGb = options.longs === String ? String(message.sizeGb) : message.sizeGb; - else - object.sizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.sizeGb) : options.longs === Number ? new $util.LongBits(message.sizeGb.low >>> 0, message.sizeGb.high >>> 0).toNumber() : message.sizeGb; - return object; - }; - - /** - * Converts this DiskDataSourceProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @instance - * @returns {Object.} JSON object - */ - DiskDataSourceProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DiskDataSourceProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DiskDataSourceProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DiskDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DiskDataSourceProperties"; - }; - - return DiskDataSourceProperties; - })(); - - v1.ComputeInstanceBackupProperties = (function() { - - /** - * Properties of a ComputeInstanceBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IComputeInstanceBackupProperties - * @property {string|null} [description] ComputeInstanceBackupProperties description - * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceBackupProperties tags - * @property {string|null} [machineType] ComputeInstanceBackupProperties machineType - * @property {boolean|null} [canIpForward] ComputeInstanceBackupProperties canIpForward - * @property {Array.|null} [networkInterface] ComputeInstanceBackupProperties networkInterface - * @property {Array.|null} [disk] ComputeInstanceBackupProperties disk - * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceBackupProperties metadata - * @property {Array.|null} [serviceAccount] ComputeInstanceBackupProperties serviceAccount - * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceBackupProperties scheduling - * @property {Array.|null} [guestAccelerator] ComputeInstanceBackupProperties guestAccelerator - * @property {string|null} [minCpuPlatform] ComputeInstanceBackupProperties minCpuPlatform - * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceBackupProperties keyRevocationActionType - * @property {string|null} [sourceInstance] ComputeInstanceBackupProperties sourceInstance - * @property {Object.|null} [labels] ComputeInstanceBackupProperties labels - */ - - /** - * Constructs a new ComputeInstanceBackupProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ComputeInstanceBackupProperties. - * @implements IComputeInstanceBackupProperties - * @constructor - * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set - */ - function ComputeInstanceBackupProperties(properties) { - this.networkInterface = []; - this.disk = []; - this.serviceAccount = []; - this.guestAccelerator = []; - 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]]; - } - - /** - * ComputeInstanceBackupProperties description. - * @member {string|null|undefined} description - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.description = null; - - /** - * ComputeInstanceBackupProperties tags. - * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.tags = null; - - /** - * ComputeInstanceBackupProperties machineType. - * @member {string|null|undefined} machineType - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.machineType = null; - - /** - * ComputeInstanceBackupProperties canIpForward. - * @member {boolean|null|undefined} canIpForward - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.canIpForward = null; - - /** - * ComputeInstanceBackupProperties networkInterface. - * @member {Array.} networkInterface - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.networkInterface = $util.emptyArray; - - /** - * ComputeInstanceBackupProperties disk. - * @member {Array.} disk - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.disk = $util.emptyArray; - - /** - * ComputeInstanceBackupProperties metadata. - * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.metadata = null; - - /** - * ComputeInstanceBackupProperties serviceAccount. - * @member {Array.} serviceAccount - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.serviceAccount = $util.emptyArray; - - /** - * ComputeInstanceBackupProperties scheduling. - * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.scheduling = null; - - /** - * ComputeInstanceBackupProperties guestAccelerator. - * @member {Array.} guestAccelerator - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.guestAccelerator = $util.emptyArray; - - /** - * ComputeInstanceBackupProperties minCpuPlatform. - * @member {string|null|undefined} minCpuPlatform - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.minCpuPlatform = null; - - /** - * ComputeInstanceBackupProperties keyRevocationActionType. - * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.keyRevocationActionType = null; - - /** - * ComputeInstanceBackupProperties sourceInstance. - * @member {string|null|undefined} sourceInstance - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.sourceInstance = null; - - /** - * ComputeInstanceBackupProperties labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - */ - ComputeInstanceBackupProperties.prototype.labels = $util.emptyObject; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_description", { - get: $util.oneOfGetter($oneOfFields = ["description"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_tags", { - get: $util.oneOfGetter($oneOfFields = ["tags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_machineType", { - get: $util.oneOfGetter($oneOfFields = ["machineType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_canIpForward", { - get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_metadata", { - get: $util.oneOfGetter($oneOfFields = ["metadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_scheduling", { - get: $util.oneOfGetter($oneOfFields = ["scheduling"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_minCpuPlatform", { - get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_keyRevocationActionType", { - get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceBackupProperties.prototype, "_sourceInstance", { - get: $util.oneOfGetter($oneOfFields = ["sourceInstance"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ComputeInstanceBackupProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties instance - */ - ComputeInstanceBackupProperties.create = function create(properties) { - return new ComputeInstanceBackupProperties(properties); - }; - - /** - * Encodes the specified ComputeInstanceBackupProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceBackupProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.description); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); - if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.canIpForward); - if (message.networkInterface != null && message.networkInterface.length) - for (var i = 0; i < message.networkInterface.length; ++i) - $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterface[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.disk != null && message.disk.length) - for (var i = 0; i < message.disk.length; ++i) - $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disk[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.serviceAccount != null && message.serviceAccount.length) - for (var i = 0; i < message.serviceAccount.length; ++i) - $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccount[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) - $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.guestAccelerator != null && message.guestAccelerator.length) - for (var i = 0; i < message.guestAccelerator.length; ++i) - $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerator[i], writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.minCpuPlatform); - if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); - if (message.sourceInstance != null && Object.hasOwnProperty.call(message, "sourceInstance")) - writer.uint32(/* id 13, wireType 2 =*/106).string(message.sourceInstance); - 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 14, wireType 2 =*/114).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 ComputeInstanceBackupProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceBackupProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceBackupProperties} message ComputeInstanceBackupProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceBackupProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeInstanceBackupProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceBackupProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.description = reader.string(); - break; - } - case 2: { - message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); - break; - } - case 3: { - message.machineType = reader.string(); - break; - } - case 4: { - message.canIpForward = reader.bool(); - break; - } - case 5: { - if (!(message.networkInterface && message.networkInterface.length)) - message.networkInterface = []; - message.networkInterface.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); - break; - } - case 6: { - if (!(message.disk && message.disk.length)) - message.disk = []; - message.disk.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); - break; - } - case 7: { - message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); - break; - } - case 8: { - if (!(message.serviceAccount && message.serviceAccount.length)) - message.serviceAccount = []; - message.serviceAccount.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); - break; - } - case 9: { - message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); - break; - } - case 10: { - if (!(message.guestAccelerator && message.guestAccelerator.length)) - message.guestAccelerator = []; - message.guestAccelerator.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); - break; - } - case 11: { - message.minCpuPlatform = reader.string(); - break; - } - case 12: { - message.keyRevocationActionType = reader.int32(); - break; - } - case 13: { - message.sourceInstance = reader.string(); - break; - } - case 14: { - 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 ComputeInstanceBackupProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceBackupProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeInstanceBackupProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeInstanceBackupProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.description != null && message.hasOwnProperty("description")) { - properties._description = 1; - if (!$util.isString(message.description)) - return "description: string expected"; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - properties._tags = 1; - { - var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); - if (error) - return "tags." + error; - } - } - if (message.machineType != null && message.hasOwnProperty("machineType")) { - properties._machineType = 1; - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - } - if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { - properties._canIpForward = 1; - if (typeof message.canIpForward !== "boolean") - return "canIpForward: boolean expected"; - } - if (message.networkInterface != null && message.hasOwnProperty("networkInterface")) { - if (!Array.isArray(message.networkInterface)) - return "networkInterface: array expected"; - for (var i = 0; i < message.networkInterface.length; ++i) { - var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterface[i]); - if (error) - return "networkInterface." + error; - } - } - if (message.disk != null && message.hasOwnProperty("disk")) { - if (!Array.isArray(message.disk)) - return "disk: array expected"; - for (var i = 0; i < message.disk.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disk[i]); - if (error) - return "disk." + error; - } - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - properties._metadata = 1; - { - var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - } - if (message.serviceAccount != null && message.hasOwnProperty("serviceAccount")) { - if (!Array.isArray(message.serviceAccount)) - return "serviceAccount: array expected"; - for (var i = 0; i < message.serviceAccount.length; ++i) { - var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccount[i]); - if (error) - return "serviceAccount." + error; - } - } - if (message.scheduling != null && message.hasOwnProperty("scheduling")) { - properties._scheduling = 1; - { - var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); - if (error) - return "scheduling." + error; - } - } - if (message.guestAccelerator != null && message.hasOwnProperty("guestAccelerator")) { - if (!Array.isArray(message.guestAccelerator)) - return "guestAccelerator: array expected"; - for (var i = 0; i < message.guestAccelerator.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerator[i]); - if (error) - return "guestAccelerator." + error; - } - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { - properties._minCpuPlatform = 1; - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - } - if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { - properties._keyRevocationActionType = 1; - switch (message.keyRevocationActionType) { - default: - return "keyRevocationActionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { - properties._sourceInstance = 1; - if (!$util.isString(message.sourceInstance)) - return "sourceInstance: 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"; - } - return null; - }; - - /** - * Creates a ComputeInstanceBackupProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} ComputeInstanceBackupProperties - */ - ComputeInstanceBackupProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.ComputeInstanceBackupProperties(); - if (object.description != null) - message.description = String(object.description); - if (object.tags != null) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.tags: object expected"); - message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); - } - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.canIpForward != null) - message.canIpForward = Boolean(object.canIpForward); - if (object.networkInterface) { - if (!Array.isArray(object.networkInterface)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: array expected"); - message.networkInterface = []; - for (var i = 0; i < object.networkInterface.length; ++i) { - if (typeof object.networkInterface[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.networkInterface: object expected"); - message.networkInterface[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterface[i]); - } - } - if (object.disk) { - if (!Array.isArray(object.disk)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: array expected"); - message.disk = []; - for (var i = 0; i < object.disk.length; ++i) { - if (typeof object.disk[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.disk: object expected"); - message.disk[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disk[i]); - } - } - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.metadata: object expected"); - message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); - } - if (object.serviceAccount) { - if (!Array.isArray(object.serviceAccount)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: array expected"); - message.serviceAccount = []; - for (var i = 0; i < object.serviceAccount.length; ++i) { - if (typeof object.serviceAccount[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.serviceAccount: object expected"); - message.serviceAccount[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccount[i]); - } - } - if (object.scheduling != null) { - if (typeof object.scheduling !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.scheduling: object expected"); - message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); - } - if (object.guestAccelerator) { - if (!Array.isArray(object.guestAccelerator)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: array expected"); - message.guestAccelerator = []; - for (var i = 0; i < object.guestAccelerator.length; ++i) { - if (typeof object.guestAccelerator[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.guestAccelerator: object expected"); - message.guestAccelerator[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerator[i]); - } - } - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - switch (object.keyRevocationActionType) { - default: - if (typeof object.keyRevocationActionType === "number") { - message.keyRevocationActionType = object.keyRevocationActionType; - break; - } - break; - case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": - case 0: - message.keyRevocationActionType = 0; - break; - case "NONE": - case 1: - message.keyRevocationActionType = 1; - break; - case "STOP": - case 2: - message.keyRevocationActionType = 2; - break; - } - if (object.sourceInstance != null) - message.sourceInstance = String(object.sourceInstance); - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceBackupProperties.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 ComputeInstanceBackupProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {google.cloud.backupdr.v1.ComputeInstanceBackupProperties} message ComputeInstanceBackupProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeInstanceBackupProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.networkInterface = []; - object.disk = []; - object.serviceAccount = []; - object.guestAccelerator = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (message.description != null && message.hasOwnProperty("description")) { - object.description = message.description; - if (options.oneofs) - object._description = "description"; - } - if (message.tags != null && message.hasOwnProperty("tags")) { - object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); - if (options.oneofs) - object._tags = "tags"; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) { - object.machineType = message.machineType; - if (options.oneofs) - object._machineType = "machineType"; - } - if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { - object.canIpForward = message.canIpForward; - if (options.oneofs) - object._canIpForward = "canIpForward"; - } - if (message.networkInterface && message.networkInterface.length) { - object.networkInterface = []; - for (var j = 0; j < message.networkInterface.length; ++j) - object.networkInterface[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterface[j], options); - } - if (message.disk && message.disk.length) { - object.disk = []; - for (var j = 0; j < message.disk.length; ++j) - object.disk[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disk[j], options); - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); - if (options.oneofs) - object._metadata = "metadata"; - } - if (message.serviceAccount && message.serviceAccount.length) { - object.serviceAccount = []; - for (var j = 0; j < message.serviceAccount.length; ++j) - object.serviceAccount[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccount[j], options); - } - if (message.scheduling != null && message.hasOwnProperty("scheduling")) { - object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); - if (options.oneofs) - object._scheduling = "scheduling"; - } - if (message.guestAccelerator && message.guestAccelerator.length) { - object.guestAccelerator = []; - for (var j = 0; j < message.guestAccelerator.length; ++j) - object.guestAccelerator[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerator[j], options); - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { - object.minCpuPlatform = message.minCpuPlatform; - if (options.oneofs) - object._minCpuPlatform = "minCpuPlatform"; - } - if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { - object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; - if (options.oneofs) - object._keyRevocationActionType = "keyRevocationActionType"; - } - if (message.sourceInstance != null && message.hasOwnProperty("sourceInstance")) { - object.sourceInstance = message.sourceInstance; - if (options.oneofs) - object._sourceInstance = "sourceInstance"; - } - 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 ComputeInstanceBackupProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @instance - * @returns {Object.} JSON object - */ - ComputeInstanceBackupProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeInstanceBackupProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ComputeInstanceBackupProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeInstanceBackupProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceBackupProperties"; - }; - - return ComputeInstanceBackupProperties; - })(); - - v1.ComputeInstanceRestoreProperties = (function() { - - /** - * Properties of a ComputeInstanceRestoreProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IComputeInstanceRestoreProperties - * @property {string|null} [name] ComputeInstanceRestoreProperties name - * @property {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null} [advancedMachineFeatures] ComputeInstanceRestoreProperties advancedMachineFeatures - * @property {boolean|null} [canIpForward] ComputeInstanceRestoreProperties canIpForward - * @property {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null} [confidentialInstanceConfig] ComputeInstanceRestoreProperties confidentialInstanceConfig - * @property {boolean|null} [deletionProtection] ComputeInstanceRestoreProperties deletionProtection - * @property {string|null} [description] ComputeInstanceRestoreProperties description - * @property {Array.|null} [disks] ComputeInstanceRestoreProperties disks - * @property {google.cloud.backupdr.v1.IDisplayDevice|null} [displayDevice] ComputeInstanceRestoreProperties displayDevice - * @property {Array.|null} [guestAccelerators] ComputeInstanceRestoreProperties guestAccelerators - * @property {string|null} [hostname] ComputeInstanceRestoreProperties hostname - * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [instanceEncryptionKey] ComputeInstanceRestoreProperties instanceEncryptionKey - * @property {google.cloud.backupdr.v1.KeyRevocationActionType|null} [keyRevocationActionType] ComputeInstanceRestoreProperties keyRevocationActionType - * @property {Object.|null} [labels] ComputeInstanceRestoreProperties labels - * @property {string|null} [machineType] ComputeInstanceRestoreProperties machineType - * @property {google.cloud.backupdr.v1.IMetadata|null} [metadata] ComputeInstanceRestoreProperties metadata - * @property {string|null} [minCpuPlatform] ComputeInstanceRestoreProperties minCpuPlatform - * @property {Array.|null} [networkInterfaces] ComputeInstanceRestoreProperties networkInterfaces - * @property {google.cloud.backupdr.v1.INetworkPerformanceConfig|null} [networkPerformanceConfig] ComputeInstanceRestoreProperties networkPerformanceConfig - * @property {google.cloud.backupdr.v1.IInstanceParams|null} [params] ComputeInstanceRestoreProperties params - * @property {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null} [privateIpv6GoogleAccess] ComputeInstanceRestoreProperties privateIpv6GoogleAccess - * @property {google.cloud.backupdr.v1.IAllocationAffinity|null} [allocationAffinity] ComputeInstanceRestoreProperties allocationAffinity - * @property {Array.|null} [resourcePolicies] ComputeInstanceRestoreProperties resourcePolicies - * @property {google.cloud.backupdr.v1.IScheduling|null} [scheduling] ComputeInstanceRestoreProperties scheduling - * @property {Array.|null} [serviceAccounts] ComputeInstanceRestoreProperties serviceAccounts - * @property {google.cloud.backupdr.v1.ITags|null} [tags] ComputeInstanceRestoreProperties tags - */ - - /** - * Constructs a new ComputeInstanceRestoreProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ComputeInstanceRestoreProperties. - * @implements IComputeInstanceRestoreProperties - * @constructor - * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set - */ - function ComputeInstanceRestoreProperties(properties) { - this.disks = []; - this.guestAccelerators = []; - this.labels = {}; - this.networkInterfaces = []; - this.resourcePolicies = []; - this.serviceAccounts = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeInstanceRestoreProperties name. - * @member {string|null|undefined} name - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.name = null; - - /** - * ComputeInstanceRestoreProperties advancedMachineFeatures. - * @member {google.cloud.backupdr.v1.IAdvancedMachineFeatures|null|undefined} advancedMachineFeatures - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.advancedMachineFeatures = null; - - /** - * ComputeInstanceRestoreProperties canIpForward. - * @member {boolean|null|undefined} canIpForward - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.canIpForward = null; - - /** - * ComputeInstanceRestoreProperties confidentialInstanceConfig. - * @member {google.cloud.backupdr.v1.IConfidentialInstanceConfig|null|undefined} confidentialInstanceConfig - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.confidentialInstanceConfig = null; - - /** - * ComputeInstanceRestoreProperties deletionProtection. - * @member {boolean|null|undefined} deletionProtection - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.deletionProtection = null; - - /** - * ComputeInstanceRestoreProperties description. - * @member {string|null|undefined} description - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.description = null; - - /** - * ComputeInstanceRestoreProperties disks. - * @member {Array.} disks - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.disks = $util.emptyArray; - - /** - * ComputeInstanceRestoreProperties displayDevice. - * @member {google.cloud.backupdr.v1.IDisplayDevice|null|undefined} displayDevice - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.displayDevice = null; - - /** - * ComputeInstanceRestoreProperties guestAccelerators. - * @member {Array.} guestAccelerators - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.guestAccelerators = $util.emptyArray; - - /** - * ComputeInstanceRestoreProperties hostname. - * @member {string|null|undefined} hostname - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.hostname = null; - - /** - * ComputeInstanceRestoreProperties instanceEncryptionKey. - * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} instanceEncryptionKey - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.instanceEncryptionKey = null; - - /** - * ComputeInstanceRestoreProperties keyRevocationActionType. - * @member {google.cloud.backupdr.v1.KeyRevocationActionType|null|undefined} keyRevocationActionType - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.keyRevocationActionType = null; - - /** - * ComputeInstanceRestoreProperties labels. - * @member {Object.} labels - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.labels = $util.emptyObject; - - /** - * ComputeInstanceRestoreProperties machineType. - * @member {string|null|undefined} machineType - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.machineType = null; - - /** - * ComputeInstanceRestoreProperties metadata. - * @member {google.cloud.backupdr.v1.IMetadata|null|undefined} metadata - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.metadata = null; - - /** - * ComputeInstanceRestoreProperties minCpuPlatform. - * @member {string|null|undefined} minCpuPlatform - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.minCpuPlatform = null; - - /** - * ComputeInstanceRestoreProperties networkInterfaces. - * @member {Array.} networkInterfaces - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.networkInterfaces = $util.emptyArray; - - /** - * ComputeInstanceRestoreProperties networkPerformanceConfig. - * @member {google.cloud.backupdr.v1.INetworkPerformanceConfig|null|undefined} networkPerformanceConfig - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.networkPerformanceConfig = null; - - /** - * ComputeInstanceRestoreProperties params. - * @member {google.cloud.backupdr.v1.IInstanceParams|null|undefined} params - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.params = null; - - /** - * ComputeInstanceRestoreProperties privateIpv6GoogleAccess. - * @member {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess|null|undefined} privateIpv6GoogleAccess - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.privateIpv6GoogleAccess = null; - - /** - * ComputeInstanceRestoreProperties allocationAffinity. - * @member {google.cloud.backupdr.v1.IAllocationAffinity|null|undefined} allocationAffinity - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.allocationAffinity = null; - - /** - * ComputeInstanceRestoreProperties resourcePolicies. - * @member {Array.} resourcePolicies - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.resourcePolicies = $util.emptyArray; - - /** - * ComputeInstanceRestoreProperties scheduling. - * @member {google.cloud.backupdr.v1.IScheduling|null|undefined} scheduling - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.scheduling = null; - - /** - * ComputeInstanceRestoreProperties serviceAccounts. - * @member {Array.} serviceAccounts - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.serviceAccounts = $util.emptyArray; - - /** - * ComputeInstanceRestoreProperties tags. - * @member {google.cloud.backupdr.v1.ITags|null|undefined} tags - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - */ - ComputeInstanceRestoreProperties.prototype.tags = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_advancedMachineFeatures", { - get: $util.oneOfGetter($oneOfFields = ["advancedMachineFeatures"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_canIpForward", { - get: $util.oneOfGetter($oneOfFields = ["canIpForward"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_confidentialInstanceConfig", { - get: $util.oneOfGetter($oneOfFields = ["confidentialInstanceConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_deletionProtection", { - get: $util.oneOfGetter($oneOfFields = ["deletionProtection"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_description", { - get: $util.oneOfGetter($oneOfFields = ["description"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_displayDevice", { - get: $util.oneOfGetter($oneOfFields = ["displayDevice"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_hostname", { - get: $util.oneOfGetter($oneOfFields = ["hostname"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_instanceEncryptionKey", { - get: $util.oneOfGetter($oneOfFields = ["instanceEncryptionKey"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_keyRevocationActionType", { - get: $util.oneOfGetter($oneOfFields = ["keyRevocationActionType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_machineType", { - get: $util.oneOfGetter($oneOfFields = ["machineType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_metadata", { - get: $util.oneOfGetter($oneOfFields = ["metadata"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_minCpuPlatform", { - get: $util.oneOfGetter($oneOfFields = ["minCpuPlatform"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_networkPerformanceConfig", { - get: $util.oneOfGetter($oneOfFields = ["networkPerformanceConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_params", { - get: $util.oneOfGetter($oneOfFields = ["params"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_privateIpv6GoogleAccess", { - get: $util.oneOfGetter($oneOfFields = ["privateIpv6GoogleAccess"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_allocationAffinity", { - get: $util.oneOfGetter($oneOfFields = ["allocationAffinity"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_scheduling", { - get: $util.oneOfGetter($oneOfFields = ["scheduling"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ComputeInstanceRestoreProperties.prototype, "_tags", { - get: $util.oneOfGetter($oneOfFields = ["tags"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ComputeInstanceRestoreProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties instance - */ - ComputeInstanceRestoreProperties.create = function create(properties) { - return new ComputeInstanceRestoreProperties(properties); - }; - - /** - * Encodes the specified ComputeInstanceRestoreProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceRestoreProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.advancedMachineFeatures != null && Object.hasOwnProperty.call(message, "advancedMachineFeatures")) - $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.encode(message.advancedMachineFeatures, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.canIpForward != null && Object.hasOwnProperty.call(message, "canIpForward")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.canIpForward); - if (message.confidentialInstanceConfig != null && Object.hasOwnProperty.call(message, "confidentialInstanceConfig")) - $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.encode(message.confidentialInstanceConfig, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.deletionProtection != null && Object.hasOwnProperty.call(message, "deletionProtection")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.deletionProtection); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.description); - if (message.disks != null && message.disks.length) - for (var i = 0; i < message.disks.length; ++i) - $root.google.cloud.backupdr.v1.AttachedDisk.encode(message.disks[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.displayDevice != null && Object.hasOwnProperty.call(message, "displayDevice")) - $root.google.cloud.backupdr.v1.DisplayDevice.encode(message.displayDevice, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.guestAccelerators != null && message.guestAccelerators.length) - for (var i = 0; i < message.guestAccelerators.length; ++i) - $root.google.cloud.backupdr.v1.AcceleratorConfig.encode(message.guestAccelerators[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.hostname != null && Object.hasOwnProperty.call(message, "hostname")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.hostname); - if (message.instanceEncryptionKey != null && Object.hasOwnProperty.call(message, "instanceEncryptionKey")) - $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.instanceEncryptionKey, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.keyRevocationActionType != null && Object.hasOwnProperty.call(message, "keyRevocationActionType")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.keyRevocationActionType); - 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.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.machineType); - if (message.metadata != null && Object.hasOwnProperty.call(message, "metadata")) - $root.google.cloud.backupdr.v1.Metadata.encode(message.metadata, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.minCpuPlatform != null && Object.hasOwnProperty.call(message, "minCpuPlatform")) - writer.uint32(/* id 16, wireType 2 =*/130).string(message.minCpuPlatform); - if (message.networkInterfaces != null && message.networkInterfaces.length) - for (var i = 0; i < message.networkInterfaces.length; ++i) - $root.google.cloud.backupdr.v1.NetworkInterface.encode(message.networkInterfaces[i], writer.uint32(/* id 17, wireType 2 =*/138).fork()).ldelim(); - if (message.networkPerformanceConfig != null && Object.hasOwnProperty.call(message, "networkPerformanceConfig")) - $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.encode(message.networkPerformanceConfig, writer.uint32(/* id 18, wireType 2 =*/146).fork()).ldelim(); - if (message.params != null && Object.hasOwnProperty.call(message, "params")) - $root.google.cloud.backupdr.v1.InstanceParams.encode(message.params, writer.uint32(/* id 19, wireType 2 =*/154).fork()).ldelim(); - if (message.privateIpv6GoogleAccess != null && Object.hasOwnProperty.call(message, "privateIpv6GoogleAccess")) - writer.uint32(/* id 20, wireType 0 =*/160).int32(message.privateIpv6GoogleAccess); - if (message.allocationAffinity != null && Object.hasOwnProperty.call(message, "allocationAffinity")) - $root.google.cloud.backupdr.v1.AllocationAffinity.encode(message.allocationAffinity, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.resourcePolicies != null && message.resourcePolicies.length) - for (var i = 0; i < message.resourcePolicies.length; ++i) - writer.uint32(/* id 22, wireType 2 =*/178).string(message.resourcePolicies[i]); - if (message.scheduling != null && Object.hasOwnProperty.call(message, "scheduling")) - $root.google.cloud.backupdr.v1.Scheduling.encode(message.scheduling, writer.uint32(/* id 23, wireType 2 =*/186).fork()).ldelim(); - if (message.serviceAccounts != null && message.serviceAccounts.length) - for (var i = 0; i < message.serviceAccounts.length; ++i) - $root.google.cloud.backupdr.v1.ServiceAccount.encode(message.serviceAccounts[i], writer.uint32(/* id 24, wireType 2 =*/194).fork()).ldelim(); - if (message.tags != null && Object.hasOwnProperty.call(message, "tags")) - $root.google.cloud.backupdr.v1.Tags.encode(message.tags, writer.uint32(/* id 26, wireType 2 =*/210).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ComputeInstanceRestoreProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceRestoreProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceRestoreProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(), 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.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.decode(reader, reader.uint32()); - break; - } - case 3: { - message.canIpForward = reader.bool(); - break; - } - case 4: { - message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.decode(reader, reader.uint32()); - break; - } - case 5: { - message.deletionProtection = reader.bool(); - break; - } - case 6: { - message.description = reader.string(); - break; - } - case 7: { - if (!(message.disks && message.disks.length)) - message.disks = []; - message.disks.push($root.google.cloud.backupdr.v1.AttachedDisk.decode(reader, reader.uint32())); - break; - } - case 8: { - message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.decode(reader, reader.uint32()); - break; - } - case 9: { - if (!(message.guestAccelerators && message.guestAccelerators.length)) - message.guestAccelerators = []; - message.guestAccelerators.push($root.google.cloud.backupdr.v1.AcceleratorConfig.decode(reader, reader.uint32())); - break; - } - case 10: { - message.hostname = reader.string(); - break; - } - case 11: { - message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); - break; - } - case 12: { - message.keyRevocationActionType = reader.int32(); - 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.machineType = reader.string(); - break; - } - case 15: { - message.metadata = $root.google.cloud.backupdr.v1.Metadata.decode(reader, reader.uint32()); - break; - } - case 16: { - message.minCpuPlatform = reader.string(); - break; - } - case 17: { - if (!(message.networkInterfaces && message.networkInterfaces.length)) - message.networkInterfaces = []; - message.networkInterfaces.push($root.google.cloud.backupdr.v1.NetworkInterface.decode(reader, reader.uint32())); - break; - } - case 18: { - message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.decode(reader, reader.uint32()); - break; - } - case 19: { - message.params = $root.google.cloud.backupdr.v1.InstanceParams.decode(reader, reader.uint32()); - break; - } - case 20: { - message.privateIpv6GoogleAccess = reader.int32(); - break; - } - case 21: { - message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.decode(reader, reader.uint32()); - break; - } - case 22: { - if (!(message.resourcePolicies && message.resourcePolicies.length)) - message.resourcePolicies = []; - message.resourcePolicies.push(reader.string()); - break; - } - case 23: { - message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.decode(reader, reader.uint32()); - break; - } - case 24: { - if (!(message.serviceAccounts && message.serviceAccounts.length)) - message.serviceAccounts = []; - message.serviceAccounts.push($root.google.cloud.backupdr.v1.ServiceAccount.decode(reader, reader.uint32())); - break; - } - case 26: { - message.tags = $root.google.cloud.backupdr.v1.Tags.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeInstanceRestoreProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceRestoreProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeInstanceRestoreProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeInstanceRestoreProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { - properties._advancedMachineFeatures = 1; - { - var error = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.verify(message.advancedMachineFeatures); - if (error) - return "advancedMachineFeatures." + error; - } - } - if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { - properties._canIpForward = 1; - if (typeof message.canIpForward !== "boolean") - return "canIpForward: boolean expected"; - } - if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { - properties._confidentialInstanceConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify(message.confidentialInstanceConfig); - if (error) - return "confidentialInstanceConfig." + error; - } - } - if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { - properties._deletionProtection = 1; - if (typeof message.deletionProtection !== "boolean") - return "deletionProtection: boolean expected"; - } - if (message.description != null && message.hasOwnProperty("description")) { - properties._description = 1; - if (!$util.isString(message.description)) - return "description: string expected"; - } - if (message.disks != null && message.hasOwnProperty("disks")) { - if (!Array.isArray(message.disks)) - return "disks: array expected"; - for (var i = 0; i < message.disks.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AttachedDisk.verify(message.disks[i]); - if (error) - return "disks." + error; - } - } - if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { - properties._displayDevice = 1; - { - var error = $root.google.cloud.backupdr.v1.DisplayDevice.verify(message.displayDevice); - if (error) - return "displayDevice." + error; - } - } - if (message.guestAccelerators != null && message.hasOwnProperty("guestAccelerators")) { - if (!Array.isArray(message.guestAccelerators)) - return "guestAccelerators: array expected"; - for (var i = 0; i < message.guestAccelerators.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AcceleratorConfig.verify(message.guestAccelerators[i]); - if (error) - return "guestAccelerators." + error; - } - } - if (message.hostname != null && message.hasOwnProperty("hostname")) { - properties._hostname = 1; - if (!$util.isString(message.hostname)) - return "hostname: string expected"; - } - if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { - properties._instanceEncryptionKey = 1; - { - var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.instanceEncryptionKey); - if (error) - return "instanceEncryptionKey." + error; - } - } - if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { - properties._keyRevocationActionType = 1; - switch (message.keyRevocationActionType) { - default: - return "keyRevocationActionType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.labels != null && message.hasOwnProperty("labels")) { - if (!$util.isObject(message.labels)) - return "labels: object expected"; - var key = Object.keys(message.labels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.labels[key[i]])) - return "labels: string{k:string} expected"; - } - if (message.machineType != null && message.hasOwnProperty("machineType")) { - properties._machineType = 1; - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - properties._metadata = 1; - { - var error = $root.google.cloud.backupdr.v1.Metadata.verify(message.metadata); - if (error) - return "metadata." + error; - } - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { - properties._minCpuPlatform = 1; - if (!$util.isString(message.minCpuPlatform)) - return "minCpuPlatform: string expected"; - } - if (message.networkInterfaces != null && message.hasOwnProperty("networkInterfaces")) { - if (!Array.isArray(message.networkInterfaces)) - return "networkInterfaces: array expected"; - for (var i = 0; i < message.networkInterfaces.length; ++i) { - var error = $root.google.cloud.backupdr.v1.NetworkInterface.verify(message.networkInterfaces[i]); - if (error) - return "networkInterfaces." + error; - } - } - if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { - properties._networkPerformanceConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.verify(message.networkPerformanceConfig); - if (error) - return "networkPerformanceConfig." + error; - } - } - if (message.params != null && message.hasOwnProperty("params")) { - properties._params = 1; - { - var error = $root.google.cloud.backupdr.v1.InstanceParams.verify(message.params); - if (error) - return "params." + error; - } - } - if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { - properties._privateIpv6GoogleAccess = 1; - switch (message.privateIpv6GoogleAccess) { - default: - return "privateIpv6GoogleAccess: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { - properties._allocationAffinity = 1; - { - var error = $root.google.cloud.backupdr.v1.AllocationAffinity.verify(message.allocationAffinity); - if (error) - return "allocationAffinity." + error; - } - } - if (message.resourcePolicies != null && message.hasOwnProperty("resourcePolicies")) { - if (!Array.isArray(message.resourcePolicies)) - return "resourcePolicies: array expected"; - for (var i = 0; i < message.resourcePolicies.length; ++i) - if (!$util.isString(message.resourcePolicies[i])) - return "resourcePolicies: string[] expected"; - } - if (message.scheduling != null && message.hasOwnProperty("scheduling")) { - properties._scheduling = 1; - { - var error = $root.google.cloud.backupdr.v1.Scheduling.verify(message.scheduling); - if (error) - return "scheduling." + error; - } - } - if (message.serviceAccounts != null && message.hasOwnProperty("serviceAccounts")) { - if (!Array.isArray(message.serviceAccounts)) - return "serviceAccounts: array expected"; - for (var i = 0; i < message.serviceAccounts.length; ++i) { - var error = $root.google.cloud.backupdr.v1.ServiceAccount.verify(message.serviceAccounts[i]); - if (error) - return "serviceAccounts." + error; - } - } - if (message.tags != null && message.hasOwnProperty("tags")) { - properties._tags = 1; - { - var error = $root.google.cloud.backupdr.v1.Tags.verify(message.tags); - if (error) - return "tags." + error; - } - } - return null; - }; - - /** - * Creates a ComputeInstanceRestoreProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} ComputeInstanceRestoreProperties - */ - ComputeInstanceRestoreProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties(); - if (object.name != null) - message.name = String(object.name); - if (object.advancedMachineFeatures != null) { - if (typeof object.advancedMachineFeatures !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.advancedMachineFeatures: object expected"); - message.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.fromObject(object.advancedMachineFeatures); - } - if (object.canIpForward != null) - message.canIpForward = Boolean(object.canIpForward); - if (object.confidentialInstanceConfig != null) { - if (typeof object.confidentialInstanceConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.confidentialInstanceConfig: object expected"); - message.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.fromObject(object.confidentialInstanceConfig); - } - if (object.deletionProtection != null) - message.deletionProtection = Boolean(object.deletionProtection); - if (object.description != null) - message.description = String(object.description); - if (object.disks) { - if (!Array.isArray(object.disks)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: array expected"); - message.disks = []; - for (var i = 0; i < object.disks.length; ++i) { - if (typeof object.disks[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.disks: object expected"); - message.disks[i] = $root.google.cloud.backupdr.v1.AttachedDisk.fromObject(object.disks[i]); - } - } - if (object.displayDevice != null) { - if (typeof object.displayDevice !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.displayDevice: object expected"); - message.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.fromObject(object.displayDevice); - } - if (object.guestAccelerators) { - if (!Array.isArray(object.guestAccelerators)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: array expected"); - message.guestAccelerators = []; - for (var i = 0; i < object.guestAccelerators.length; ++i) { - if (typeof object.guestAccelerators[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.guestAccelerators: object expected"); - message.guestAccelerators[i] = $root.google.cloud.backupdr.v1.AcceleratorConfig.fromObject(object.guestAccelerators[i]); - } - } - if (object.hostname != null) - message.hostname = String(object.hostname); - if (object.instanceEncryptionKey != null) { - if (typeof object.instanceEncryptionKey !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.instanceEncryptionKey: object expected"); - message.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.instanceEncryptionKey); - } - switch (object.keyRevocationActionType) { - default: - if (typeof object.keyRevocationActionType === "number") { - message.keyRevocationActionType = object.keyRevocationActionType; - break; - } - break; - case "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": - case 0: - message.keyRevocationActionType = 0; - break; - case "NONE": - case 1: - message.keyRevocationActionType = 1; - break; - case "STOP": - case 2: - message.keyRevocationActionType = 2; - break; - } - if (object.labels) { - if (typeof object.labels !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.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.machineType != null) - message.machineType = String(object.machineType); - if (object.metadata != null) { - if (typeof object.metadata !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.metadata: object expected"); - message.metadata = $root.google.cloud.backupdr.v1.Metadata.fromObject(object.metadata); - } - if (object.minCpuPlatform != null) - message.minCpuPlatform = String(object.minCpuPlatform); - if (object.networkInterfaces) { - if (!Array.isArray(object.networkInterfaces)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: array expected"); - message.networkInterfaces = []; - for (var i = 0; i < object.networkInterfaces.length; ++i) { - if (typeof object.networkInterfaces[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkInterfaces: object expected"); - message.networkInterfaces[i] = $root.google.cloud.backupdr.v1.NetworkInterface.fromObject(object.networkInterfaces[i]); - } - } - if (object.networkPerformanceConfig != null) { - if (typeof object.networkPerformanceConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.networkPerformanceConfig: object expected"); - message.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.fromObject(object.networkPerformanceConfig); - } - if (object.params != null) { - if (typeof object.params !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.params: object expected"); - message.params = $root.google.cloud.backupdr.v1.InstanceParams.fromObject(object.params); - } - switch (object.privateIpv6GoogleAccess) { - default: - if (typeof object.privateIpv6GoogleAccess === "number") { - message.privateIpv6GoogleAccess = object.privateIpv6GoogleAccess; - break; - } - break; - case "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": - case 0: - message.privateIpv6GoogleAccess = 0; - break; - case "INHERIT_FROM_SUBNETWORK": - case 1: - message.privateIpv6GoogleAccess = 1; - break; - case "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": - case 2: - message.privateIpv6GoogleAccess = 2; - break; - case "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": - case 3: - message.privateIpv6GoogleAccess = 3; - break; - } - if (object.allocationAffinity != null) { - if (typeof object.allocationAffinity !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.allocationAffinity: object expected"); - message.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.fromObject(object.allocationAffinity); - } - if (object.resourcePolicies) { - if (!Array.isArray(object.resourcePolicies)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.resourcePolicies: array expected"); - message.resourcePolicies = []; - for (var i = 0; i < object.resourcePolicies.length; ++i) - message.resourcePolicies[i] = String(object.resourcePolicies[i]); - } - if (object.scheduling != null) { - if (typeof object.scheduling !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.scheduling: object expected"); - message.scheduling = $root.google.cloud.backupdr.v1.Scheduling.fromObject(object.scheduling); - } - if (object.serviceAccounts) { - if (!Array.isArray(object.serviceAccounts)) - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: array expected"); - message.serviceAccounts = []; - for (var i = 0; i < object.serviceAccounts.length; ++i) { - if (typeof object.serviceAccounts[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.serviceAccounts: object expected"); - message.serviceAccounts[i] = $root.google.cloud.backupdr.v1.ServiceAccount.fromObject(object.serviceAccounts[i]); - } - } - if (object.tags != null) { - if (typeof object.tags !== "object") - throw TypeError(".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.tags: object expected"); - message.tags = $root.google.cloud.backupdr.v1.Tags.fromObject(object.tags); - } - return message; - }; - - /** - * Creates a plain object from a ComputeInstanceRestoreProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} message ComputeInstanceRestoreProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeInstanceRestoreProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.disks = []; - object.guestAccelerators = []; - object.networkInterfaces = []; - object.resourcePolicies = []; - object.serviceAccounts = []; - } - if (options.objects || options.defaults) - object.labels = {}; - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.advancedMachineFeatures != null && message.hasOwnProperty("advancedMachineFeatures")) { - object.advancedMachineFeatures = $root.google.cloud.backupdr.v1.AdvancedMachineFeatures.toObject(message.advancedMachineFeatures, options); - if (options.oneofs) - object._advancedMachineFeatures = "advancedMachineFeatures"; - } - if (message.canIpForward != null && message.hasOwnProperty("canIpForward")) { - object.canIpForward = message.canIpForward; - if (options.oneofs) - object._canIpForward = "canIpForward"; - } - if (message.confidentialInstanceConfig != null && message.hasOwnProperty("confidentialInstanceConfig")) { - object.confidentialInstanceConfig = $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig.toObject(message.confidentialInstanceConfig, options); - if (options.oneofs) - object._confidentialInstanceConfig = "confidentialInstanceConfig"; - } - if (message.deletionProtection != null && message.hasOwnProperty("deletionProtection")) { - object.deletionProtection = message.deletionProtection; - if (options.oneofs) - object._deletionProtection = "deletionProtection"; - } - if (message.description != null && message.hasOwnProperty("description")) { - object.description = message.description; - if (options.oneofs) - object._description = "description"; - } - if (message.disks && message.disks.length) { - object.disks = []; - for (var j = 0; j < message.disks.length; ++j) - object.disks[j] = $root.google.cloud.backupdr.v1.AttachedDisk.toObject(message.disks[j], options); - } - if (message.displayDevice != null && message.hasOwnProperty("displayDevice")) { - object.displayDevice = $root.google.cloud.backupdr.v1.DisplayDevice.toObject(message.displayDevice, options); - if (options.oneofs) - object._displayDevice = "displayDevice"; - } - if (message.guestAccelerators && message.guestAccelerators.length) { - object.guestAccelerators = []; - for (var j = 0; j < message.guestAccelerators.length; ++j) - object.guestAccelerators[j] = $root.google.cloud.backupdr.v1.AcceleratorConfig.toObject(message.guestAccelerators[j], options); - } - if (message.hostname != null && message.hasOwnProperty("hostname")) { - object.hostname = message.hostname; - if (options.oneofs) - object._hostname = "hostname"; - } - if (message.instanceEncryptionKey != null && message.hasOwnProperty("instanceEncryptionKey")) { - object.instanceEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.instanceEncryptionKey, options); - if (options.oneofs) - object._instanceEncryptionKey = "instanceEncryptionKey"; - } - if (message.keyRevocationActionType != null && message.hasOwnProperty("keyRevocationActionType")) { - object.keyRevocationActionType = options.enums === String ? $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] === undefined ? message.keyRevocationActionType : $root.google.cloud.backupdr.v1.KeyRevocationActionType[message.keyRevocationActionType] : message.keyRevocationActionType; - if (options.oneofs) - object._keyRevocationActionType = "keyRevocationActionType"; - } - 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.machineType != null && message.hasOwnProperty("machineType")) { - object.machineType = message.machineType; - if (options.oneofs) - object._machineType = "machineType"; - } - if (message.metadata != null && message.hasOwnProperty("metadata")) { - object.metadata = $root.google.cloud.backupdr.v1.Metadata.toObject(message.metadata, options); - if (options.oneofs) - object._metadata = "metadata"; - } - if (message.minCpuPlatform != null && message.hasOwnProperty("minCpuPlatform")) { - object.minCpuPlatform = message.minCpuPlatform; - if (options.oneofs) - object._minCpuPlatform = "minCpuPlatform"; - } - if (message.networkInterfaces && message.networkInterfaces.length) { - object.networkInterfaces = []; - for (var j = 0; j < message.networkInterfaces.length; ++j) - object.networkInterfaces[j] = $root.google.cloud.backupdr.v1.NetworkInterface.toObject(message.networkInterfaces[j], options); - } - if (message.networkPerformanceConfig != null && message.hasOwnProperty("networkPerformanceConfig")) { - object.networkPerformanceConfig = $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.toObject(message.networkPerformanceConfig, options); - if (options.oneofs) - object._networkPerformanceConfig = "networkPerformanceConfig"; - } - if (message.params != null && message.hasOwnProperty("params")) { - object.params = $root.google.cloud.backupdr.v1.InstanceParams.toObject(message.params, options); - if (options.oneofs) - object._params = "params"; - } - if (message.privateIpv6GoogleAccess != null && message.hasOwnProperty("privateIpv6GoogleAccess")) { - object.privateIpv6GoogleAccess = options.enums === String ? $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] === undefined ? message.privateIpv6GoogleAccess : $root.google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess[message.privateIpv6GoogleAccess] : message.privateIpv6GoogleAccess; - if (options.oneofs) - object._privateIpv6GoogleAccess = "privateIpv6GoogleAccess"; - } - if (message.allocationAffinity != null && message.hasOwnProperty("allocationAffinity")) { - object.allocationAffinity = $root.google.cloud.backupdr.v1.AllocationAffinity.toObject(message.allocationAffinity, options); - if (options.oneofs) - object._allocationAffinity = "allocationAffinity"; - } - if (message.resourcePolicies && message.resourcePolicies.length) { - object.resourcePolicies = []; - for (var j = 0; j < message.resourcePolicies.length; ++j) - object.resourcePolicies[j] = message.resourcePolicies[j]; - } - if (message.scheduling != null && message.hasOwnProperty("scheduling")) { - object.scheduling = $root.google.cloud.backupdr.v1.Scheduling.toObject(message.scheduling, options); - if (options.oneofs) - object._scheduling = "scheduling"; - } - if (message.serviceAccounts && message.serviceAccounts.length) { - object.serviceAccounts = []; - for (var j = 0; j < message.serviceAccounts.length; ++j) - object.serviceAccounts[j] = $root.google.cloud.backupdr.v1.ServiceAccount.toObject(message.serviceAccounts[j], options); - } - if (message.tags != null && message.hasOwnProperty("tags")) { - object.tags = $root.google.cloud.backupdr.v1.Tags.toObject(message.tags, options); - if (options.oneofs) - object._tags = "tags"; - } - return object; - }; - - /** - * Converts this ComputeInstanceRestoreProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @instance - * @returns {Object.} JSON object - */ - ComputeInstanceRestoreProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeInstanceRestoreProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ComputeInstanceRestoreProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeInstanceRestoreProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceRestoreProperties"; - }; - - /** - * InstancePrivateIpv6GoogleAccess enum. - * @name google.cloud.backupdr.v1.ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess - * @enum {number} - * @property {number} INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED=0 INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED value - * @property {number} INHERIT_FROM_SUBNETWORK=1 INHERIT_FROM_SUBNETWORK value - * @property {number} ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE=2 ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE value - * @property {number} ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE=3 ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE value - */ - ComputeInstanceRestoreProperties.InstancePrivateIpv6GoogleAccess = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED"] = 0; - values[valuesById[1] = "INHERIT_FROM_SUBNETWORK"] = 1; - values[valuesById[2] = "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE"] = 2; - values[valuesById[3] = "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE"] = 3; - return values; - })(); - - return ComputeInstanceRestoreProperties; - })(); - - v1.ComputeInstanceTargetEnvironment = (function() { - - /** - * Properties of a ComputeInstanceTargetEnvironment. - * @memberof google.cloud.backupdr.v1 - * @interface IComputeInstanceTargetEnvironment - * @property {string|null} [project] ComputeInstanceTargetEnvironment project - * @property {string|null} [zone] ComputeInstanceTargetEnvironment zone - */ - - /** - * Constructs a new ComputeInstanceTargetEnvironment. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ComputeInstanceTargetEnvironment. - * @implements IComputeInstanceTargetEnvironment - * @constructor - * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set - */ - function ComputeInstanceTargetEnvironment(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeInstanceTargetEnvironment project. - * @member {string} project - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @instance - */ - ComputeInstanceTargetEnvironment.prototype.project = ""; - - /** - * ComputeInstanceTargetEnvironment zone. - * @member {string} zone - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @instance - */ - ComputeInstanceTargetEnvironment.prototype.zone = ""; - - /** - * Creates a new ComputeInstanceTargetEnvironment instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment instance - */ - ComputeInstanceTargetEnvironment.create = function create(properties) { - return new ComputeInstanceTargetEnvironment(properties); - }; - - /** - * Encodes the specified ComputeInstanceTargetEnvironment message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceTargetEnvironment.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.project != null && Object.hasOwnProperty.call(message, "project")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.project); - if (message.zone != null && Object.hasOwnProperty.call(message, "zone")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.zone); - return writer; - }; - - /** - * Encodes the specified ComputeInstanceTargetEnvironment message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceTargetEnvironment.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceTargetEnvironment.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.project = reader.string(); - break; - } - case 2: { - message.zone = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeInstanceTargetEnvironment message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceTargetEnvironment.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeInstanceTargetEnvironment message. - * @function verify - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeInstanceTargetEnvironment.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.project != null && message.hasOwnProperty("project")) - if (!$util.isString(message.project)) - return "project: string expected"; - if (message.zone != null && message.hasOwnProperty("zone")) - if (!$util.isString(message.zone)) - return "zone: string expected"; - return null; - }; - - /** - * Creates a ComputeInstanceTargetEnvironment message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} ComputeInstanceTargetEnvironment - */ - ComputeInstanceTargetEnvironment.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment) - return object; - var message = new $root.google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment(); - if (object.project != null) - message.project = String(object.project); - if (object.zone != null) - message.zone = String(object.zone); - return message; - }; - - /** - * Creates a plain object from a ComputeInstanceTargetEnvironment message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} message ComputeInstanceTargetEnvironment - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeInstanceTargetEnvironment.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.project = ""; - object.zone = ""; - } - if (message.project != null && message.hasOwnProperty("project")) - object.project = message.project; - if (message.zone != null && message.hasOwnProperty("zone")) - object.zone = message.zone; - return object; - }; - - /** - * Converts this ComputeInstanceTargetEnvironment to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @instance - * @returns {Object.} JSON object - */ - ComputeInstanceTargetEnvironment.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeInstanceTargetEnvironment - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeInstanceTargetEnvironment.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment"; - }; - - return ComputeInstanceTargetEnvironment; - })(); - - v1.ComputeInstanceDataSourceProperties = (function() { - - /** - * Properties of a ComputeInstanceDataSourceProperties. - * @memberof google.cloud.backupdr.v1 - * @interface IComputeInstanceDataSourceProperties - * @property {string|null} [name] ComputeInstanceDataSourceProperties name - * @property {string|null} [description] ComputeInstanceDataSourceProperties description - * @property {string|null} [machineType] ComputeInstanceDataSourceProperties machineType - * @property {number|Long|null} [totalDiskCount] ComputeInstanceDataSourceProperties totalDiskCount - * @property {number|Long|null} [totalDiskSizeGb] ComputeInstanceDataSourceProperties totalDiskSizeGb - */ - - /** - * Constructs a new ComputeInstanceDataSourceProperties. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ComputeInstanceDataSourceProperties. - * @implements IComputeInstanceDataSourceProperties - * @constructor - * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set - */ - function ComputeInstanceDataSourceProperties(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ComputeInstanceDataSourceProperties name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @instance - */ - ComputeInstanceDataSourceProperties.prototype.name = ""; - - /** - * ComputeInstanceDataSourceProperties description. - * @member {string} description - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @instance - */ - ComputeInstanceDataSourceProperties.prototype.description = ""; - - /** - * ComputeInstanceDataSourceProperties machineType. - * @member {string} machineType - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @instance - */ - ComputeInstanceDataSourceProperties.prototype.machineType = ""; - - /** - * ComputeInstanceDataSourceProperties totalDiskCount. - * @member {number|Long} totalDiskCount - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @instance - */ - ComputeInstanceDataSourceProperties.prototype.totalDiskCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ComputeInstanceDataSourceProperties totalDiskSizeGb. - * @member {number|Long} totalDiskSizeGb - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @instance - */ - ComputeInstanceDataSourceProperties.prototype.totalDiskSizeGb = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new ComputeInstanceDataSourceProperties instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties instance - */ - ComputeInstanceDataSourceProperties.create = function create(properties) { - return new ComputeInstanceDataSourceProperties(properties); - }; - - /** - * Encodes the specified ComputeInstanceDataSourceProperties message. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceDataSourceProperties.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.description != null && Object.hasOwnProperty.call(message, "description")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.description); - if (message.machineType != null && Object.hasOwnProperty.call(message, "machineType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.machineType); - if (message.totalDiskCount != null && Object.hasOwnProperty.call(message, "totalDiskCount")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.totalDiskCount); - if (message.totalDiskSizeGb != null && Object.hasOwnProperty.call(message, "totalDiskSizeGb")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.totalDiskSizeGb); - return writer; - }; - - /** - * Encodes the specified ComputeInstanceDataSourceProperties message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.IComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ComputeInstanceDataSourceProperties.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceDataSourceProperties.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.description = reader.string(); - break; - } - case 3: { - message.machineType = reader.string(); - break; - } - case 4: { - message.totalDiskCount = reader.int64(); - break; - } - case 5: { - message.totalDiskSizeGb = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ComputeInstanceDataSourceProperties message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ComputeInstanceDataSourceProperties.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ComputeInstanceDataSourceProperties message. - * @function verify - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ComputeInstanceDataSourceProperties.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.description != null && message.hasOwnProperty("description")) - if (!$util.isString(message.description)) - return "description: string expected"; - if (message.machineType != null && message.hasOwnProperty("machineType")) - if (!$util.isString(message.machineType)) - return "machineType: string expected"; - if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) - if (!$util.isInteger(message.totalDiskCount) && !(message.totalDiskCount && $util.isInteger(message.totalDiskCount.low) && $util.isInteger(message.totalDiskCount.high))) - return "totalDiskCount: integer|Long expected"; - if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) - if (!$util.isInteger(message.totalDiskSizeGb) && !(message.totalDiskSizeGb && $util.isInteger(message.totalDiskSizeGb.low) && $util.isInteger(message.totalDiskSizeGb.high))) - return "totalDiskSizeGb: integer|Long expected"; - return null; - }; - - /** - * Creates a ComputeInstanceDataSourceProperties message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} ComputeInstanceDataSourceProperties - */ - ComputeInstanceDataSourceProperties.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties) - return object; - var message = new $root.google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties(); - if (object.name != null) - message.name = String(object.name); - if (object.description != null) - message.description = String(object.description); - if (object.machineType != null) - message.machineType = String(object.machineType); - if (object.totalDiskCount != null) - if ($util.Long) - (message.totalDiskCount = $util.Long.fromValue(object.totalDiskCount)).unsigned = false; - else if (typeof object.totalDiskCount === "string") - message.totalDiskCount = parseInt(object.totalDiskCount, 10); - else if (typeof object.totalDiskCount === "number") - message.totalDiskCount = object.totalDiskCount; - else if (typeof object.totalDiskCount === "object") - message.totalDiskCount = new $util.LongBits(object.totalDiskCount.low >>> 0, object.totalDiskCount.high >>> 0).toNumber(); - if (object.totalDiskSizeGb != null) - if ($util.Long) - (message.totalDiskSizeGb = $util.Long.fromValue(object.totalDiskSizeGb)).unsigned = false; - else if (typeof object.totalDiskSizeGb === "string") - message.totalDiskSizeGb = parseInt(object.totalDiskSizeGb, 10); - else if (typeof object.totalDiskSizeGb === "number") - message.totalDiskSizeGb = object.totalDiskSizeGb; - else if (typeof object.totalDiskSizeGb === "object") - message.totalDiskSizeGb = new $util.LongBits(object.totalDiskSizeGb.low >>> 0, object.totalDiskSizeGb.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a ComputeInstanceDataSourceProperties message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties} message ComputeInstanceDataSourceProperties - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ComputeInstanceDataSourceProperties.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.description = ""; - object.machineType = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalDiskCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalDiskCount = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.totalDiskSizeGb = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.totalDiskSizeGb = options.longs === String ? "0" : 0; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.description != null && message.hasOwnProperty("description")) - object.description = message.description; - if (message.machineType != null && message.hasOwnProperty("machineType")) - object.machineType = message.machineType; - if (message.totalDiskCount != null && message.hasOwnProperty("totalDiskCount")) - if (typeof message.totalDiskCount === "number") - object.totalDiskCount = options.longs === String ? String(message.totalDiskCount) : message.totalDiskCount; - else - object.totalDiskCount = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskCount) : options.longs === Number ? new $util.LongBits(message.totalDiskCount.low >>> 0, message.totalDiskCount.high >>> 0).toNumber() : message.totalDiskCount; - if (message.totalDiskSizeGb != null && message.hasOwnProperty("totalDiskSizeGb")) - if (typeof message.totalDiskSizeGb === "number") - object.totalDiskSizeGb = options.longs === String ? String(message.totalDiskSizeGb) : message.totalDiskSizeGb; - else - object.totalDiskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.totalDiskSizeGb) : options.longs === Number ? new $util.LongBits(message.totalDiskSizeGb.low >>> 0, message.totalDiskSizeGb.high >>> 0).toNumber() : message.totalDiskSizeGb; - return object; - }; - - /** - * Converts this ComputeInstanceDataSourceProperties to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @instance - * @returns {Object.} JSON object - */ - ComputeInstanceDataSourceProperties.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ComputeInstanceDataSourceProperties - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ComputeInstanceDataSourceProperties.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ComputeInstanceDataSourceProperties"; - }; - - return ComputeInstanceDataSourceProperties; - })(); - - v1.AdvancedMachineFeatures = (function() { - - /** - * Properties of an AdvancedMachineFeatures. - * @memberof google.cloud.backupdr.v1 - * @interface IAdvancedMachineFeatures - * @property {boolean|null} [enableNestedVirtualization] AdvancedMachineFeatures enableNestedVirtualization - * @property {number|null} [threadsPerCore] AdvancedMachineFeatures threadsPerCore - * @property {number|null} [visibleCoreCount] AdvancedMachineFeatures visibleCoreCount - * @property {boolean|null} [enableUefiNetworking] AdvancedMachineFeatures enableUefiNetworking - */ - - /** - * Constructs a new AdvancedMachineFeatures. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an AdvancedMachineFeatures. - * @implements IAdvancedMachineFeatures - * @constructor - * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set - */ - function AdvancedMachineFeatures(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AdvancedMachineFeatures enableNestedVirtualization. - * @member {boolean|null|undefined} enableNestedVirtualization - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @instance - */ - AdvancedMachineFeatures.prototype.enableNestedVirtualization = null; - - /** - * AdvancedMachineFeatures threadsPerCore. - * @member {number|null|undefined} threadsPerCore - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @instance - */ - AdvancedMachineFeatures.prototype.threadsPerCore = null; - - /** - * AdvancedMachineFeatures visibleCoreCount. - * @member {number|null|undefined} visibleCoreCount - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @instance - */ - AdvancedMachineFeatures.prototype.visibleCoreCount = null; - - /** - * AdvancedMachineFeatures enableUefiNetworking. - * @member {boolean|null|undefined} enableUefiNetworking - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @instance - */ - AdvancedMachineFeatures.prototype.enableUefiNetworking = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableNestedVirtualization", { - get: $util.oneOfGetter($oneOfFields = ["enableNestedVirtualization"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AdvancedMachineFeatures.prototype, "_threadsPerCore", { - get: $util.oneOfGetter($oneOfFields = ["threadsPerCore"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AdvancedMachineFeatures.prototype, "_visibleCoreCount", { - get: $util.oneOfGetter($oneOfFields = ["visibleCoreCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AdvancedMachineFeatures.prototype, "_enableUefiNetworking", { - get: $util.oneOfGetter($oneOfFields = ["enableUefiNetworking"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AdvancedMachineFeatures instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures instance - */ - AdvancedMachineFeatures.create = function create(properties) { - return new AdvancedMachineFeatures(properties); - }; - - /** - * Encodes the specified AdvancedMachineFeatures message. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdvancedMachineFeatures.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableNestedVirtualization != null && Object.hasOwnProperty.call(message, "enableNestedVirtualization")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableNestedVirtualization); - if (message.threadsPerCore != null && Object.hasOwnProperty.call(message, "threadsPerCore")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.threadsPerCore); - if (message.visibleCoreCount != null && Object.hasOwnProperty.call(message, "visibleCoreCount")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.visibleCoreCount); - if (message.enableUefiNetworking != null && Object.hasOwnProperty.call(message, "enableUefiNetworking")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.enableUefiNetworking); - return writer; - }; - - /** - * Encodes the specified AdvancedMachineFeatures message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AdvancedMachineFeatures.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {google.cloud.backupdr.v1.IAdvancedMachineFeatures} message AdvancedMachineFeatures message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AdvancedMachineFeatures.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AdvancedMachineFeatures message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdvancedMachineFeatures.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableNestedVirtualization = reader.bool(); - break; - } - case 2: { - message.threadsPerCore = reader.int32(); - break; - } - case 3: { - message.visibleCoreCount = reader.int32(); - break; - } - case 4: { - message.enableUefiNetworking = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AdvancedMachineFeatures message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AdvancedMachineFeatures.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AdvancedMachineFeatures message. - * @function verify - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AdvancedMachineFeatures.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { - properties._enableNestedVirtualization = 1; - if (typeof message.enableNestedVirtualization !== "boolean") - return "enableNestedVirtualization: boolean expected"; - } - if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { - properties._threadsPerCore = 1; - if (!$util.isInteger(message.threadsPerCore)) - return "threadsPerCore: integer expected"; - } - if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { - properties._visibleCoreCount = 1; - if (!$util.isInteger(message.visibleCoreCount)) - return "visibleCoreCount: integer expected"; - } - if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { - properties._enableUefiNetworking = 1; - if (typeof message.enableUefiNetworking !== "boolean") - return "enableUefiNetworking: boolean expected"; - } - return null; - }; - - /** - * Creates an AdvancedMachineFeatures message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AdvancedMachineFeatures} AdvancedMachineFeatures - */ - AdvancedMachineFeatures.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AdvancedMachineFeatures) - return object; - var message = new $root.google.cloud.backupdr.v1.AdvancedMachineFeatures(); - if (object.enableNestedVirtualization != null) - message.enableNestedVirtualization = Boolean(object.enableNestedVirtualization); - if (object.threadsPerCore != null) - message.threadsPerCore = object.threadsPerCore | 0; - if (object.visibleCoreCount != null) - message.visibleCoreCount = object.visibleCoreCount | 0; - if (object.enableUefiNetworking != null) - message.enableUefiNetworking = Boolean(object.enableUefiNetworking); - return message; - }; - - /** - * Creates a plain object from an AdvancedMachineFeatures message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {google.cloud.backupdr.v1.AdvancedMachineFeatures} message AdvancedMachineFeatures - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AdvancedMachineFeatures.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.enableNestedVirtualization != null && message.hasOwnProperty("enableNestedVirtualization")) { - object.enableNestedVirtualization = message.enableNestedVirtualization; - if (options.oneofs) - object._enableNestedVirtualization = "enableNestedVirtualization"; - } - if (message.threadsPerCore != null && message.hasOwnProperty("threadsPerCore")) { - object.threadsPerCore = message.threadsPerCore; - if (options.oneofs) - object._threadsPerCore = "threadsPerCore"; - } - if (message.visibleCoreCount != null && message.hasOwnProperty("visibleCoreCount")) { - object.visibleCoreCount = message.visibleCoreCount; - if (options.oneofs) - object._visibleCoreCount = "visibleCoreCount"; - } - if (message.enableUefiNetworking != null && message.hasOwnProperty("enableUefiNetworking")) { - object.enableUefiNetworking = message.enableUefiNetworking; - if (options.oneofs) - object._enableUefiNetworking = "enableUefiNetworking"; - } - return object; - }; - - /** - * Converts this AdvancedMachineFeatures to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @instance - * @returns {Object.} JSON object - */ - AdvancedMachineFeatures.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AdvancedMachineFeatures - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.AdvancedMachineFeatures - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AdvancedMachineFeatures.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.AdvancedMachineFeatures"; - }; - - return AdvancedMachineFeatures; - })(); - - v1.ConfidentialInstanceConfig = (function() { - - /** - * Properties of a ConfidentialInstanceConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IConfidentialInstanceConfig - * @property {boolean|null} [enableConfidentialCompute] ConfidentialInstanceConfig enableConfidentialCompute - */ - - /** - * Constructs a new ConfidentialInstanceConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ConfidentialInstanceConfig. - * @implements IConfidentialInstanceConfig - * @constructor - * @param {google.cloud.backupdr.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|null|undefined} enableConfidentialCompute - * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig - * @instance - */ - ConfidentialInstanceConfig.prototype.enableConfidentialCompute = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ConfidentialInstanceConfig.prototype, "_enableConfidentialCompute", { - get: $util.oneOfGetter($oneOfFields = ["enableConfidentialCompute"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ConfidentialInstanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.backupdr.v1.IConfidentialInstanceConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig instance - */ - ConfidentialInstanceConfig.create = function create(properties) { - return new ConfidentialInstanceConfig(properties); - }; - - /** - * Encodes the specified ConfidentialInstanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.backupdr.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.backupdr.v1.ConfidentialInstanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.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.backupdr.v1.ConfidentialInstanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.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.backupdr.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"; - var properties = {}; - if (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { - properties._enableConfidentialCompute = 1; - 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.backupdr.v1.ConfidentialInstanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ConfidentialInstanceConfig} ConfidentialInstanceConfig - */ - ConfidentialInstanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ConfidentialInstanceConfig) - return object; - var message = new $root.google.cloud.backupdr.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.backupdr.v1.ConfidentialInstanceConfig - * @static - * @param {google.cloud.backupdr.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 (message.enableConfidentialCompute != null && message.hasOwnProperty("enableConfidentialCompute")) { - object.enableConfidentialCompute = message.enableConfidentialCompute; - if (options.oneofs) - object._enableConfidentialCompute = "enableConfidentialCompute"; - } - return object; - }; - - /** - * Converts this ConfidentialInstanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.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.backupdr.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.backupdr.v1.ConfidentialInstanceConfig"; - }; - - return ConfidentialInstanceConfig; - })(); - - v1.DisplayDevice = (function() { - - /** - * Properties of a DisplayDevice. - * @memberof google.cloud.backupdr.v1 - * @interface IDisplayDevice - * @property {boolean|null} [enableDisplay] DisplayDevice enableDisplay - */ - - /** - * Constructs a new DisplayDevice. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DisplayDevice. - * @implements IDisplayDevice - * @constructor - * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set - */ - function DisplayDevice(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DisplayDevice enableDisplay. - * @member {boolean|null|undefined} enableDisplay - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @instance - */ - DisplayDevice.prototype.enableDisplay = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DisplayDevice.prototype, "_enableDisplay", { - get: $util.oneOfGetter($oneOfFields = ["enableDisplay"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DisplayDevice instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {google.cloud.backupdr.v1.IDisplayDevice=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice instance - */ - DisplayDevice.create = function create(properties) { - return new DisplayDevice(properties); - }; - - /** - * Encodes the specified DisplayDevice message. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisplayDevice.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.enableDisplay != null && Object.hasOwnProperty.call(message, "enableDisplay")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.enableDisplay); - return writer; - }; - - /** - * Encodes the specified DisplayDevice message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DisplayDevice.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {google.cloud.backupdr.v1.IDisplayDevice} message DisplayDevice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DisplayDevice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DisplayDevice message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisplayDevice.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DisplayDevice(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.enableDisplay = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DisplayDevice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DisplayDevice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DisplayDevice message. - * @function verify - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DisplayDevice.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { - properties._enableDisplay = 1; - if (typeof message.enableDisplay !== "boolean") - return "enableDisplay: boolean expected"; - } - return null; - }; - - /** - * Creates a DisplayDevice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DisplayDevice} DisplayDevice - */ - DisplayDevice.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DisplayDevice) - return object; - var message = new $root.google.cloud.backupdr.v1.DisplayDevice(); - if (object.enableDisplay != null) - message.enableDisplay = Boolean(object.enableDisplay); - return message; - }; - - /** - * Creates a plain object from a DisplayDevice message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {google.cloud.backupdr.v1.DisplayDevice} message DisplayDevice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DisplayDevice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.enableDisplay != null && message.hasOwnProperty("enableDisplay")) { - object.enableDisplay = message.enableDisplay; - if (options.oneofs) - object._enableDisplay = "enableDisplay"; - } - return object; - }; - - /** - * Converts this DisplayDevice to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @instance - * @returns {Object.} JSON object - */ - DisplayDevice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DisplayDevice - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DisplayDevice - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DisplayDevice.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DisplayDevice"; - }; - - return DisplayDevice; - })(); - - v1.AcceleratorConfig = (function() { - - /** - * Properties of an AcceleratorConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IAcceleratorConfig - * @property {string|null} [acceleratorType] AcceleratorConfig acceleratorType - * @property {number|null} [acceleratorCount] AcceleratorConfig acceleratorCount - */ - - /** - * Constructs a new AcceleratorConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an AcceleratorConfig. - * @implements IAcceleratorConfig - * @constructor - * @param {google.cloud.backupdr.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 acceleratorType. - * @member {string|null|undefined} acceleratorType - * @memberof google.cloud.backupdr.v1.AcceleratorConfig - * @instance - */ - AcceleratorConfig.prototype.acceleratorType = null; - - /** - * AcceleratorConfig acceleratorCount. - * @member {number|null|undefined} acceleratorCount - * @memberof google.cloud.backupdr.v1.AcceleratorConfig - * @instance - */ - AcceleratorConfig.prototype.acceleratorCount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorType", { - get: $util.oneOfGetter($oneOfFields = ["acceleratorType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AcceleratorConfig.prototype, "_acceleratorCount", { - get: $util.oneOfGetter($oneOfFields = ["acceleratorCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AcceleratorConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AcceleratorConfig - * @static - * @param {google.cloud.backupdr.v1.IAcceleratorConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig instance - */ - AcceleratorConfig.create = function create(properties) { - return new AcceleratorConfig(properties); - }; - - /** - * Encodes the specified AcceleratorConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AcceleratorConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AcceleratorConfig - * @static - * @param {google.cloud.backupdr.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.acceleratorType != null && Object.hasOwnProperty.call(message, "acceleratorType")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.acceleratorType); - 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.backupdr.v1.AcceleratorConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AcceleratorConfig - * @static - * @param {google.cloud.backupdr.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.backupdr.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.backupdr.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.backupdr.v1.AcceleratorConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.acceleratorType = 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.backupdr.v1.AcceleratorConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.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.backupdr.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"; - var properties = {}; - if (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { - properties._acceleratorType = 1; - if (!$util.isString(message.acceleratorType)) - return "acceleratorType: string expected"; - } - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { - properties._acceleratorCount = 1; - 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.backupdr.v1.AcceleratorConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AcceleratorConfig} AcceleratorConfig - */ - AcceleratorConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AcceleratorConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.AcceleratorConfig(); - if (object.acceleratorType != null) - message.acceleratorType = String(object.acceleratorType); - 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.backupdr.v1.AcceleratorConfig - * @static - * @param {google.cloud.backupdr.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 (message.acceleratorType != null && message.hasOwnProperty("acceleratorType")) { - object.acceleratorType = message.acceleratorType; - if (options.oneofs) - object._acceleratorType = "acceleratorType"; - } - if (message.acceleratorCount != null && message.hasOwnProperty("acceleratorCount")) { - object.acceleratorCount = message.acceleratorCount; - if (options.oneofs) - object._acceleratorCount = "acceleratorCount"; - } - return object; - }; - - /** - * Converts this AcceleratorConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.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.backupdr.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.backupdr.v1.AcceleratorConfig"; - }; - - return AcceleratorConfig; - })(); - - v1.CustomerEncryptionKey = (function() { - - /** - * Properties of a CustomerEncryptionKey. - * @memberof google.cloud.backupdr.v1 - * @interface ICustomerEncryptionKey - * @property {string|null} [rawKey] CustomerEncryptionKey rawKey - * @property {string|null} [rsaEncryptedKey] CustomerEncryptionKey rsaEncryptedKey - * @property {string|null} [kmsKeyName] CustomerEncryptionKey kmsKeyName - * @property {string|null} [kmsKeyServiceAccount] CustomerEncryptionKey kmsKeyServiceAccount - */ - - /** - * Constructs a new CustomerEncryptionKey. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a CustomerEncryptionKey. - * @implements ICustomerEncryptionKey - * @constructor - * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set - */ - function CustomerEncryptionKey(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * CustomerEncryptionKey rawKey. - * @member {string|null|undefined} rawKey - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @instance - */ - CustomerEncryptionKey.prototype.rawKey = null; - - /** - * CustomerEncryptionKey rsaEncryptedKey. - * @member {string|null|undefined} rsaEncryptedKey - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @instance - */ - CustomerEncryptionKey.prototype.rsaEncryptedKey = null; - - /** - * CustomerEncryptionKey kmsKeyName. - * @member {string|null|undefined} kmsKeyName - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @instance - */ - CustomerEncryptionKey.prototype.kmsKeyName = null; - - /** - * CustomerEncryptionKey kmsKeyServiceAccount. - * @member {string|null|undefined} kmsKeyServiceAccount - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @instance - */ - CustomerEncryptionKey.prototype.kmsKeyServiceAccount = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * CustomerEncryptionKey key. - * @member {"rawKey"|"rsaEncryptedKey"|"kmsKeyName"|undefined} key - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @instance - */ - Object.defineProperty(CustomerEncryptionKey.prototype, "key", { - get: $util.oneOfGetter($oneOfFields = ["rawKey", "rsaEncryptedKey", "kmsKeyName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(CustomerEncryptionKey.prototype, "_kmsKeyServiceAccount", { - get: $util.oneOfGetter($oneOfFields = ["kmsKeyServiceAccount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new CustomerEncryptionKey instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey instance - */ - CustomerEncryptionKey.create = function create(properties) { - return new CustomerEncryptionKey(properties); - }; - - /** - * Encodes the specified CustomerEncryptionKey message. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomerEncryptionKey.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.rawKey != null && Object.hasOwnProperty.call(message, "rawKey")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.rawKey); - if (message.rsaEncryptedKey != null && Object.hasOwnProperty.call(message, "rsaEncryptedKey")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.rsaEncryptedKey); - if (message.kmsKeyName != null && Object.hasOwnProperty.call(message, "kmsKeyName")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.kmsKeyName); - if (message.kmsKeyServiceAccount != null && Object.hasOwnProperty.call(message, "kmsKeyServiceAccount")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.kmsKeyServiceAccount); - return writer; - }; - - /** - * Encodes the specified CustomerEncryptionKey message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.CustomerEncryptionKey.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {google.cloud.backupdr.v1.ICustomerEncryptionKey} message CustomerEncryptionKey message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - CustomerEncryptionKey.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a CustomerEncryptionKey message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomerEncryptionKey.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.rawKey = reader.string(); - break; - } - case 2: { - message.rsaEncryptedKey = reader.string(); - break; - } - case 3: { - message.kmsKeyName = reader.string(); - break; - } - case 4: { - message.kmsKeyServiceAccount = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a CustomerEncryptionKey message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - CustomerEncryptionKey.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a CustomerEncryptionKey message. - * @function verify - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - CustomerEncryptionKey.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.rawKey != null && message.hasOwnProperty("rawKey")) { - properties.key = 1; - if (!$util.isString(message.rawKey)) - return "rawKey: string expected"; - } - if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { - if (properties.key === 1) - return "key: multiple values"; - properties.key = 1; - if (!$util.isString(message.rsaEncryptedKey)) - return "rsaEncryptedKey: string expected"; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { - if (properties.key === 1) - return "key: multiple values"; - properties.key = 1; - if (!$util.isString(message.kmsKeyName)) - return "kmsKeyName: string expected"; - } - if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { - properties._kmsKeyServiceAccount = 1; - if (!$util.isString(message.kmsKeyServiceAccount)) - return "kmsKeyServiceAccount: string expected"; - } - return null; - }; - - /** - * Creates a CustomerEncryptionKey message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.CustomerEncryptionKey} CustomerEncryptionKey - */ - CustomerEncryptionKey.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.CustomerEncryptionKey) - return object; - var message = new $root.google.cloud.backupdr.v1.CustomerEncryptionKey(); - if (object.rawKey != null) - message.rawKey = String(object.rawKey); - if (object.rsaEncryptedKey != null) - message.rsaEncryptedKey = String(object.rsaEncryptedKey); - if (object.kmsKeyName != null) - message.kmsKeyName = String(object.kmsKeyName); - if (object.kmsKeyServiceAccount != null) - message.kmsKeyServiceAccount = String(object.kmsKeyServiceAccount); - return message; - }; - - /** - * Creates a plain object from a CustomerEncryptionKey message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {google.cloud.backupdr.v1.CustomerEncryptionKey} message CustomerEncryptionKey - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - CustomerEncryptionKey.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.rawKey != null && message.hasOwnProperty("rawKey")) { - object.rawKey = message.rawKey; - if (options.oneofs) - object.key = "rawKey"; - } - if (message.rsaEncryptedKey != null && message.hasOwnProperty("rsaEncryptedKey")) { - object.rsaEncryptedKey = message.rsaEncryptedKey; - if (options.oneofs) - object.key = "rsaEncryptedKey"; - } - if (message.kmsKeyName != null && message.hasOwnProperty("kmsKeyName")) { - object.kmsKeyName = message.kmsKeyName; - if (options.oneofs) - object.key = "kmsKeyName"; - } - if (message.kmsKeyServiceAccount != null && message.hasOwnProperty("kmsKeyServiceAccount")) { - object.kmsKeyServiceAccount = message.kmsKeyServiceAccount; - if (options.oneofs) - object._kmsKeyServiceAccount = "kmsKeyServiceAccount"; - } - return object; - }; - - /** - * Converts this CustomerEncryptionKey to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @instance - * @returns {Object.} JSON object - */ - CustomerEncryptionKey.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for CustomerEncryptionKey - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.CustomerEncryptionKey - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - CustomerEncryptionKey.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.CustomerEncryptionKey"; - }; - - return CustomerEncryptionKey; - })(); - - v1.Entry = (function() { - - /** - * Properties of an Entry. - * @memberof google.cloud.backupdr.v1 - * @interface IEntry - * @property {string|null} [key] Entry key - * @property {string|null} [value] Entry value - */ - - /** - * Constructs a new Entry. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an Entry. - * @implements IEntry - * @constructor - * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set - */ - function Entry(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Entry key. - * @member {string|null|undefined} key - * @memberof google.cloud.backupdr.v1.Entry - * @instance - */ - Entry.prototype.key = null; - - /** - * Entry value. - * @member {string|null|undefined} value - * @memberof google.cloud.backupdr.v1.Entry - * @instance - */ - Entry.prototype.value = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Entry.prototype, "_key", { - get: $util.oneOfGetter($oneOfFields = ["key"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Entry.prototype, "_value", { - get: $util.oneOfGetter($oneOfFields = ["value"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Entry instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {google.cloud.backupdr.v1.IEntry=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Entry} Entry instance - */ - Entry.create = function create(properties) { - return new Entry(properties); - }; - - /** - * Encodes the specified Entry message. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entry.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - return writer; - }; - - /** - * Encodes the specified Entry message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Entry.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {google.cloud.backupdr.v1.IEntry} message Entry message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Entry.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Entry message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Entry} Entry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entry.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Entry(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.key = reader.string(); - break; - } - case 2: { - message.value = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Entry message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Entry} Entry - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Entry.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Entry message. - * @function verify - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Entry.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.key != null && message.hasOwnProperty("key")) { - properties._key = 1; - if (!$util.isString(message.key)) - return "key: string expected"; - } - if (message.value != null && message.hasOwnProperty("value")) { - properties._value = 1; - if (!$util.isString(message.value)) - return "value: string expected"; - } - return null; - }; - - /** - * Creates an Entry message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Entry} Entry - */ - Entry.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Entry) - return object; - var message = new $root.google.cloud.backupdr.v1.Entry(); - if (object.key != null) - message.key = String(object.key); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from an Entry message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {google.cloud.backupdr.v1.Entry} message Entry - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Entry.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.key != null && message.hasOwnProperty("key")) { - object.key = message.key; - if (options.oneofs) - object._key = "key"; - } - if (message.value != null && message.hasOwnProperty("value")) { - object.value = message.value; - if (options.oneofs) - object._value = "value"; - } - return object; - }; - - /** - * Converts this Entry to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Entry - * @instance - * @returns {Object.} JSON object - */ - Entry.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Entry - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Entry - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Entry.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Entry"; - }; - - return Entry; - })(); - - v1.Metadata = (function() { - - /** - * Properties of a Metadata. - * @memberof google.cloud.backupdr.v1 - * @interface IMetadata - * @property {Array.|null} [items] Metadata items - */ - - /** - * Constructs a new Metadata. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a Metadata. - * @implements IMetadata - * @constructor - * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set - */ - function Metadata(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Metadata items. - * @member {Array.} items - * @memberof google.cloud.backupdr.v1.Metadata - * @instance - */ - Metadata.prototype.items = $util.emptyArray; - - /** - * Creates a new Metadata instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {google.cloud.backupdr.v1.IMetadata=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Metadata} Metadata instance - */ - Metadata.create = function create(properties) { - return new Metadata(properties); - }; - - /** - * Encodes the specified Metadata message. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - $root.google.cloud.backupdr.v1.Entry.encode(message.items[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Metadata message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Metadata.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {google.cloud.backupdr.v1.IMetadata} message Metadata message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Metadata.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Metadata message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Metadata(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.items && message.items.length)) - message.items = []; - message.items.push($root.google.cloud.backupdr.v1.Entry.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Metadata message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Metadata} Metadata - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Metadata.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Metadata message. - * @function verify - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Metadata.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) { - var error = $root.google.cloud.backupdr.v1.Entry.verify(message.items[i]); - if (error) - return "items." + error; - } - } - return null; - }; - - /** - * Creates a Metadata message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Metadata} Metadata - */ - Metadata.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Metadata) - return object; - var message = new $root.google.cloud.backupdr.v1.Metadata(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.backupdr.v1.Metadata.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) { - if (typeof object.items[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.Metadata.items: object expected"); - message.items[i] = $root.google.cloud.backupdr.v1.Entry.fromObject(object.items[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a Metadata message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {google.cloud.backupdr.v1.Metadata} message Metadata - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Metadata.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = $root.google.cloud.backupdr.v1.Entry.toObject(message.items[j], options); - } - return object; - }; - - /** - * Converts this Metadata to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Metadata - * @instance - * @returns {Object.} JSON object - */ - Metadata.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Metadata - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Metadata - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Metadata.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Metadata"; - }; - - return Metadata; - })(); - - v1.NetworkInterface = (function() { - - /** - * Properties of a NetworkInterface. - * @memberof google.cloud.backupdr.v1 - * @interface INetworkInterface - * @property {string|null} [network] NetworkInterface network - * @property {string|null} [subnetwork] NetworkInterface subnetwork - * @property {string|null} [ipAddress] NetworkInterface ipAddress - * @property {string|null} [ipv6Address] NetworkInterface ipv6Address - * @property {number|null} [internalIpv6PrefixLength] NetworkInterface internalIpv6PrefixLength - * @property {string|null} [name] NetworkInterface name - * @property {Array.|null} [accessConfigs] NetworkInterface accessConfigs - * @property {Array.|null} [ipv6AccessConfigs] NetworkInterface ipv6AccessConfigs - * @property {Array.|null} [aliasIpRanges] NetworkInterface aliasIpRanges - * @property {google.cloud.backupdr.v1.NetworkInterface.StackType|null} [stackType] NetworkInterface stackType - * @property {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null} [ipv6AccessType] NetworkInterface ipv6AccessType - * @property {number|null} [queueCount] NetworkInterface queueCount - * @property {google.cloud.backupdr.v1.NetworkInterface.NicType|null} [nicType] NetworkInterface nicType - * @property {string|null} [networkAttachment] NetworkInterface networkAttachment - */ - - /** - * Constructs a new NetworkInterface. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a NetworkInterface. - * @implements INetworkInterface - * @constructor - * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set - */ - function NetworkInterface(properties) { - this.accessConfigs = []; - this.ipv6AccessConfigs = []; - this.aliasIpRanges = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkInterface network. - * @member {string|null|undefined} network - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.network = null; - - /** - * NetworkInterface subnetwork. - * @member {string|null|undefined} subnetwork - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.subnetwork = null; - - /** - * NetworkInterface ipAddress. - * @member {string|null|undefined} ipAddress - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.ipAddress = null; - - /** - * NetworkInterface ipv6Address. - * @member {string|null|undefined} ipv6Address - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.ipv6Address = null; - - /** - * NetworkInterface internalIpv6PrefixLength. - * @member {number|null|undefined} internalIpv6PrefixLength - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.internalIpv6PrefixLength = null; - - /** - * NetworkInterface name. - * @member {string|null|undefined} name - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.name = null; - - /** - * NetworkInterface accessConfigs. - * @member {Array.} accessConfigs - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.accessConfigs = $util.emptyArray; - - /** - * NetworkInterface ipv6AccessConfigs. - * @member {Array.} ipv6AccessConfigs - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.ipv6AccessConfigs = $util.emptyArray; - - /** - * NetworkInterface aliasIpRanges. - * @member {Array.} aliasIpRanges - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.aliasIpRanges = $util.emptyArray; - - /** - * NetworkInterface stackType. - * @member {google.cloud.backupdr.v1.NetworkInterface.StackType|null|undefined} stackType - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.stackType = null; - - /** - * NetworkInterface ipv6AccessType. - * @member {google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType|null|undefined} ipv6AccessType - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.ipv6AccessType = null; - - /** - * NetworkInterface queueCount. - * @member {number|null|undefined} queueCount - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.queueCount = null; - - /** - * NetworkInterface nicType. - * @member {google.cloud.backupdr.v1.NetworkInterface.NicType|null|undefined} nicType - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.nicType = null; - - /** - * NetworkInterface networkAttachment. - * @member {string|null|undefined} networkAttachment - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - */ - NetworkInterface.prototype.networkAttachment = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_network", { - get: $util.oneOfGetter($oneOfFields = ["network"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_subnetwork", { - get: $util.oneOfGetter($oneOfFields = ["subnetwork"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_ipAddress", { - get: $util.oneOfGetter($oneOfFields = ["ipAddress"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_ipv6Address", { - get: $util.oneOfGetter($oneOfFields = ["ipv6Address"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_internalIpv6PrefixLength", { - get: $util.oneOfGetter($oneOfFields = ["internalIpv6PrefixLength"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_stackType", { - get: $util.oneOfGetter($oneOfFields = ["stackType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_ipv6AccessType", { - get: $util.oneOfGetter($oneOfFields = ["ipv6AccessType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_queueCount", { - get: $util.oneOfGetter($oneOfFields = ["queueCount"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_nicType", { - get: $util.oneOfGetter($oneOfFields = ["nicType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkInterface.prototype, "_networkAttachment", { - get: $util.oneOfGetter($oneOfFields = ["networkAttachment"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new NetworkInterface instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {google.cloud.backupdr.v1.INetworkInterface=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface instance - */ - NetworkInterface.create = function create(properties) { - return new NetworkInterface(properties); - }; - - /** - * Encodes the specified NetworkInterface message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.network != null && Object.hasOwnProperty.call(message, "network")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.network); - if (message.subnetwork != null && Object.hasOwnProperty.call(message, "subnetwork")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetwork); - if (message.ipAddress != null && Object.hasOwnProperty.call(message, "ipAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.ipAddress); - if (message.ipv6Address != null && Object.hasOwnProperty.call(message, "ipv6Address")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.ipv6Address); - if (message.internalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "internalIpv6PrefixLength")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.internalIpv6PrefixLength); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.name); - if (message.accessConfigs != null && message.accessConfigs.length) - for (var i = 0; i < message.accessConfigs.length; ++i) - $root.google.cloud.backupdr.v1.AccessConfig.encode(message.accessConfigs[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.ipv6AccessConfigs != null && message.ipv6AccessConfigs.length) - for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) - $root.google.cloud.backupdr.v1.AccessConfig.encode(message.ipv6AccessConfigs[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.aliasIpRanges != null && message.aliasIpRanges.length) - for (var i = 0; i < message.aliasIpRanges.length; ++i) - $root.google.cloud.backupdr.v1.AliasIpRange.encode(message.aliasIpRanges[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.stackType != null && Object.hasOwnProperty.call(message, "stackType")) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.stackType); - if (message.ipv6AccessType != null && Object.hasOwnProperty.call(message, "ipv6AccessType")) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.ipv6AccessType); - if (message.queueCount != null && Object.hasOwnProperty.call(message, "queueCount")) - writer.uint32(/* id 12, wireType 0 =*/96).int32(message.queueCount); - if (message.nicType != null && Object.hasOwnProperty.call(message, "nicType")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.nicType); - if (message.networkAttachment != null && Object.hasOwnProperty.call(message, "networkAttachment")) - writer.uint32(/* id 14, wireType 2 =*/114).string(message.networkAttachment); - return writer; - }; - - /** - * Encodes the specified NetworkInterface message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkInterface.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {google.cloud.backupdr.v1.INetworkInterface} message NetworkInterface message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkInterface.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkInterface(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.network = reader.string(); - break; - } - case 2: { - message.subnetwork = reader.string(); - break; - } - case 3: { - message.ipAddress = reader.string(); - break; - } - case 4: { - message.ipv6Address = reader.string(); - break; - } - case 5: { - message.internalIpv6PrefixLength = reader.int32(); - break; - } - case 6: { - message.name = reader.string(); - break; - } - case 7: { - if (!(message.accessConfigs && message.accessConfigs.length)) - message.accessConfigs = []; - message.accessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); - break; - } - case 8: { - if (!(message.ipv6AccessConfigs && message.ipv6AccessConfigs.length)) - message.ipv6AccessConfigs = []; - message.ipv6AccessConfigs.push($root.google.cloud.backupdr.v1.AccessConfig.decode(reader, reader.uint32())); - break; - } - case 9: { - if (!(message.aliasIpRanges && message.aliasIpRanges.length)) - message.aliasIpRanges = []; - message.aliasIpRanges.push($root.google.cloud.backupdr.v1.AliasIpRange.decode(reader, reader.uint32())); - break; - } - case 10: { - message.stackType = reader.int32(); - break; - } - case 11: { - message.ipv6AccessType = reader.int32(); - break; - } - case 12: { - message.queueCount = reader.int32(); - break; - } - case 13: { - message.nicType = reader.int32(); - break; - } - case 14: { - message.networkAttachment = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkInterface message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkInterface.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkInterface message. - * @function verify - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkInterface.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.network != null && message.hasOwnProperty("network")) { - properties._network = 1; - if (!$util.isString(message.network)) - return "network: string expected"; - } - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { - properties._subnetwork = 1; - if (!$util.isString(message.subnetwork)) - return "subnetwork: string expected"; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { - properties._ipAddress = 1; - if (!$util.isString(message.ipAddress)) - return "ipAddress: string expected"; - } - if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { - properties._ipv6Address = 1; - if (!$util.isString(message.ipv6Address)) - return "ipv6Address: string expected"; - } - if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { - properties._internalIpv6PrefixLength = 1; - if (!$util.isInteger(message.internalIpv6PrefixLength)) - return "internalIpv6PrefixLength: integer expected"; - } - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.accessConfigs != null && message.hasOwnProperty("accessConfigs")) { - if (!Array.isArray(message.accessConfigs)) - return "accessConfigs: array expected"; - for (var i = 0; i < message.accessConfigs.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.accessConfigs[i]); - if (error) - return "accessConfigs." + error; - } - } - if (message.ipv6AccessConfigs != null && message.hasOwnProperty("ipv6AccessConfigs")) { - if (!Array.isArray(message.ipv6AccessConfigs)) - return "ipv6AccessConfigs: array expected"; - for (var i = 0; i < message.ipv6AccessConfigs.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AccessConfig.verify(message.ipv6AccessConfigs[i]); - if (error) - return "ipv6AccessConfigs." + error; - } - } - if (message.aliasIpRanges != null && message.hasOwnProperty("aliasIpRanges")) { - if (!Array.isArray(message.aliasIpRanges)) - return "aliasIpRanges: array expected"; - for (var i = 0; i < message.aliasIpRanges.length; ++i) { - var error = $root.google.cloud.backupdr.v1.AliasIpRange.verify(message.aliasIpRanges[i]); - if (error) - return "aliasIpRanges." + error; - } - } - if (message.stackType != null && message.hasOwnProperty("stackType")) { - properties._stackType = 1; - switch (message.stackType) { - default: - return "stackType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { - properties._ipv6AccessType = 1; - switch (message.ipv6AccessType) { - default: - return "ipv6AccessType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.queueCount != null && message.hasOwnProperty("queueCount")) { - properties._queueCount = 1; - if (!$util.isInteger(message.queueCount)) - return "queueCount: integer expected"; - } - if (message.nicType != null && message.hasOwnProperty("nicType")) { - properties._nicType = 1; - switch (message.nicType) { - default: - return "nicType: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { - properties._networkAttachment = 1; - if (!$util.isString(message.networkAttachment)) - return "networkAttachment: string expected"; - } - return null; - }; - - /** - * Creates a NetworkInterface message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.NetworkInterface} NetworkInterface - */ - NetworkInterface.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.NetworkInterface) - return object; - var message = new $root.google.cloud.backupdr.v1.NetworkInterface(); - if (object.network != null) - message.network = String(object.network); - if (object.subnetwork != null) - message.subnetwork = String(object.subnetwork); - if (object.ipAddress != null) - message.ipAddress = String(object.ipAddress); - if (object.ipv6Address != null) - message.ipv6Address = String(object.ipv6Address); - if (object.internalIpv6PrefixLength != null) - message.internalIpv6PrefixLength = object.internalIpv6PrefixLength | 0; - if (object.name != null) - message.name = String(object.name); - if (object.accessConfigs) { - if (!Array.isArray(object.accessConfigs)) - throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: array expected"); - message.accessConfigs = []; - for (var i = 0; i < object.accessConfigs.length; ++i) { - if (typeof object.accessConfigs[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.accessConfigs: object expected"); - message.accessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.accessConfigs[i]); - } - } - if (object.ipv6AccessConfigs) { - if (!Array.isArray(object.ipv6AccessConfigs)) - throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: array expected"); - message.ipv6AccessConfigs = []; - for (var i = 0; i < object.ipv6AccessConfigs.length; ++i) { - if (typeof object.ipv6AccessConfigs[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.ipv6AccessConfigs: object expected"); - message.ipv6AccessConfigs[i] = $root.google.cloud.backupdr.v1.AccessConfig.fromObject(object.ipv6AccessConfigs[i]); - } - } - if (object.aliasIpRanges) { - if (!Array.isArray(object.aliasIpRanges)) - throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: array expected"); - message.aliasIpRanges = []; - for (var i = 0; i < object.aliasIpRanges.length; ++i) { - if (typeof object.aliasIpRanges[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.NetworkInterface.aliasIpRanges: object expected"); - message.aliasIpRanges[i] = $root.google.cloud.backupdr.v1.AliasIpRange.fromObject(object.aliasIpRanges[i]); - } - } - switch (object.stackType) { - default: - if (typeof object.stackType === "number") { - message.stackType = object.stackType; - break; - } - break; - case "STACK_TYPE_UNSPECIFIED": - case 0: - message.stackType = 0; - break; - case "IPV4_ONLY": - case 1: - message.stackType = 1; - break; - case "IPV4_IPV6": - case 2: - message.stackType = 2; - break; - } - switch (object.ipv6AccessType) { - default: - if (typeof object.ipv6AccessType === "number") { - message.ipv6AccessType = object.ipv6AccessType; - break; - } - break; - case "UNSPECIFIED_IPV6_ACCESS_TYPE": - case 0: - message.ipv6AccessType = 0; - break; - case "INTERNAL": - case 1: - message.ipv6AccessType = 1; - break; - case "EXTERNAL": - case 2: - message.ipv6AccessType = 2; - break; - } - if (object.queueCount != null) - message.queueCount = object.queueCount | 0; - switch (object.nicType) { - default: - if (typeof object.nicType === "number") { - message.nicType = object.nicType; - break; - } - break; - case "NIC_TYPE_UNSPECIFIED": - case 0: - message.nicType = 0; - break; - case "VIRTIO_NET": - case 1: - message.nicType = 1; - break; - case "GVNIC": - case 2: - message.nicType = 2; - break; - } - if (object.networkAttachment != null) - message.networkAttachment = String(object.networkAttachment); - return message; - }; - - /** - * Creates a plain object from a NetworkInterface message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {google.cloud.backupdr.v1.NetworkInterface} message NetworkInterface - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkInterface.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.accessConfigs = []; - object.ipv6AccessConfigs = []; - object.aliasIpRanges = []; - } - if (message.network != null && message.hasOwnProperty("network")) { - object.network = message.network; - if (options.oneofs) - object._network = "network"; - } - if (message.subnetwork != null && message.hasOwnProperty("subnetwork")) { - object.subnetwork = message.subnetwork; - if (options.oneofs) - object._subnetwork = "subnetwork"; - } - if (message.ipAddress != null && message.hasOwnProperty("ipAddress")) { - object.ipAddress = message.ipAddress; - if (options.oneofs) - object._ipAddress = "ipAddress"; - } - if (message.ipv6Address != null && message.hasOwnProperty("ipv6Address")) { - object.ipv6Address = message.ipv6Address; - if (options.oneofs) - object._ipv6Address = "ipv6Address"; - } - if (message.internalIpv6PrefixLength != null && message.hasOwnProperty("internalIpv6PrefixLength")) { - object.internalIpv6PrefixLength = message.internalIpv6PrefixLength; - if (options.oneofs) - object._internalIpv6PrefixLength = "internalIpv6PrefixLength"; - } - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.accessConfigs && message.accessConfigs.length) { - object.accessConfigs = []; - for (var j = 0; j < message.accessConfigs.length; ++j) - object.accessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.accessConfigs[j], options); - } - if (message.ipv6AccessConfigs && message.ipv6AccessConfigs.length) { - object.ipv6AccessConfigs = []; - for (var j = 0; j < message.ipv6AccessConfigs.length; ++j) - object.ipv6AccessConfigs[j] = $root.google.cloud.backupdr.v1.AccessConfig.toObject(message.ipv6AccessConfigs[j], options); - } - if (message.aliasIpRanges && message.aliasIpRanges.length) { - object.aliasIpRanges = []; - for (var j = 0; j < message.aliasIpRanges.length; ++j) - object.aliasIpRanges[j] = $root.google.cloud.backupdr.v1.AliasIpRange.toObject(message.aliasIpRanges[j], options); - } - if (message.stackType != null && message.hasOwnProperty("stackType")) { - object.stackType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] === undefined ? message.stackType : $root.google.cloud.backupdr.v1.NetworkInterface.StackType[message.stackType] : message.stackType; - if (options.oneofs) - object._stackType = "stackType"; - } - if (message.ipv6AccessType != null && message.hasOwnProperty("ipv6AccessType")) { - object.ipv6AccessType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] === undefined ? message.ipv6AccessType : $root.google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType[message.ipv6AccessType] : message.ipv6AccessType; - if (options.oneofs) - object._ipv6AccessType = "ipv6AccessType"; - } - if (message.queueCount != null && message.hasOwnProperty("queueCount")) { - object.queueCount = message.queueCount; - if (options.oneofs) - object._queueCount = "queueCount"; - } - if (message.nicType != null && message.hasOwnProperty("nicType")) { - object.nicType = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] === undefined ? message.nicType : $root.google.cloud.backupdr.v1.NetworkInterface.NicType[message.nicType] : message.nicType; - if (options.oneofs) - object._nicType = "nicType"; - } - if (message.networkAttachment != null && message.hasOwnProperty("networkAttachment")) { - object.networkAttachment = message.networkAttachment; - if (options.oneofs) - object._networkAttachment = "networkAttachment"; - } - return object; - }; - - /** - * Converts this NetworkInterface to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @instance - * @returns {Object.} JSON object - */ - NetworkInterface.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkInterface - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.NetworkInterface - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkInterface.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkInterface"; - }; - - /** - * StackType enum. - * @name google.cloud.backupdr.v1.NetworkInterface.StackType - * @enum {number} - * @property {number} STACK_TYPE_UNSPECIFIED=0 STACK_TYPE_UNSPECIFIED value - * @property {number} IPV4_ONLY=1 IPV4_ONLY value - * @property {number} IPV4_IPV6=2 IPV4_IPV6 value - */ - NetworkInterface.StackType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STACK_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "IPV4_ONLY"] = 1; - values[valuesById[2] = "IPV4_IPV6"] = 2; - return values; - })(); - - /** - * Ipv6AccessType enum. - * @name google.cloud.backupdr.v1.NetworkInterface.Ipv6AccessType - * @enum {number} - * @property {number} UNSPECIFIED_IPV6_ACCESS_TYPE=0 UNSPECIFIED_IPV6_ACCESS_TYPE value - * @property {number} INTERNAL=1 INTERNAL value - * @property {number} EXTERNAL=2 EXTERNAL value - */ - NetworkInterface.Ipv6AccessType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "UNSPECIFIED_IPV6_ACCESS_TYPE"] = 0; - values[valuesById[1] = "INTERNAL"] = 1; - values[valuesById[2] = "EXTERNAL"] = 2; - return values; - })(); - - /** - * NicType enum. - * @name google.cloud.backupdr.v1.NetworkInterface.NicType - * @enum {number} - * @property {number} NIC_TYPE_UNSPECIFIED=0 NIC_TYPE_UNSPECIFIED value - * @property {number} VIRTIO_NET=1 VIRTIO_NET value - * @property {number} GVNIC=2 GVNIC value - */ - NetworkInterface.NicType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NIC_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "VIRTIO_NET"] = 1; - values[valuesById[2] = "GVNIC"] = 2; - return values; - })(); - - return NetworkInterface; - })(); - - v1.NetworkPerformanceConfig = (function() { - - /** - * Properties of a NetworkPerformanceConfig. - * @memberof google.cloud.backupdr.v1 - * @interface INetworkPerformanceConfig - * @property {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null} [totalEgressBandwidthTier] NetworkPerformanceConfig totalEgressBandwidthTier - */ - - /** - * Constructs a new NetworkPerformanceConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a NetworkPerformanceConfig. - * @implements INetworkPerformanceConfig - * @constructor - * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set - */ - function NetworkPerformanceConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * NetworkPerformanceConfig totalEgressBandwidthTier. - * @member {google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier|null|undefined} totalEgressBandwidthTier - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @instance - */ - NetworkPerformanceConfig.prototype.totalEgressBandwidthTier = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NetworkPerformanceConfig.prototype, "_totalEgressBandwidthTier", { - get: $util.oneOfGetter($oneOfFields = ["totalEgressBandwidthTier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new NetworkPerformanceConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig instance - */ - NetworkPerformanceConfig.create = function create(properties) { - return new NetworkPerformanceConfig(properties); - }; - - /** - * Encodes the specified NetworkPerformanceConfig message. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPerformanceConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.totalEgressBandwidthTier != null && Object.hasOwnProperty.call(message, "totalEgressBandwidthTier")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.totalEgressBandwidthTier); - return writer; - }; - - /** - * Encodes the specified NetworkPerformanceConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.NetworkPerformanceConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {google.cloud.backupdr.v1.INetworkPerformanceConfig} message NetworkPerformanceConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkPerformanceConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkPerformanceConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPerformanceConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.totalEgressBandwidthTier = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkPerformanceConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkPerformanceConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkPerformanceConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkPerformanceConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { - properties._totalEgressBandwidthTier = 1; - switch (message.totalEgressBandwidthTier) { - default: - return "totalEgressBandwidthTier: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - return null; - }; - - /** - * Creates a NetworkPerformanceConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.NetworkPerformanceConfig} NetworkPerformanceConfig - */ - NetworkPerformanceConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.NetworkPerformanceConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.NetworkPerformanceConfig(); - switch (object.totalEgressBandwidthTier) { - default: - if (typeof object.totalEgressBandwidthTier === "number") { - message.totalEgressBandwidthTier = object.totalEgressBandwidthTier; - break; - } - break; - case "TIER_UNSPECIFIED": - case 0: - message.totalEgressBandwidthTier = 0; - break; - case "DEFAULT": - case 1: - message.totalEgressBandwidthTier = 1; - break; - case "TIER_1": - case 2: - message.totalEgressBandwidthTier = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from a NetworkPerformanceConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {google.cloud.backupdr.v1.NetworkPerformanceConfig} message NetworkPerformanceConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkPerformanceConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.totalEgressBandwidthTier != null && message.hasOwnProperty("totalEgressBandwidthTier")) { - object.totalEgressBandwidthTier = options.enums === String ? $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] === undefined ? message.totalEgressBandwidthTier : $root.google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier[message.totalEgressBandwidthTier] : message.totalEgressBandwidthTier; - if (options.oneofs) - object._totalEgressBandwidthTier = "totalEgressBandwidthTier"; - } - return object; - }; - - /** - * Converts this NetworkPerformanceConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @instance - * @returns {Object.} JSON object - */ - NetworkPerformanceConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NetworkPerformanceConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.NetworkPerformanceConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NetworkPerformanceConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.NetworkPerformanceConfig"; - }; - - /** - * Tier enum. - * @name google.cloud.backupdr.v1.NetworkPerformanceConfig.Tier - * @enum {number} - * @property {number} TIER_UNSPECIFIED=0 TIER_UNSPECIFIED value - * @property {number} DEFAULT=1 DEFAULT value - * @property {number} TIER_1=2 TIER_1 value - */ - NetworkPerformanceConfig.Tier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "DEFAULT"] = 1; - values[valuesById[2] = "TIER_1"] = 2; - return values; - })(); - - return NetworkPerformanceConfig; - })(); - - v1.AccessConfig = (function() { - - /** - * Properties of an AccessConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IAccessConfig - * @property {google.cloud.backupdr.v1.AccessConfig.AccessType|null} [type] AccessConfig type - * @property {string|null} [name] AccessConfig name - * @property {string|null} [externalIp] AccessConfig externalIp - * @property {string|null} [externalIpv6] AccessConfig externalIpv6 - * @property {number|null} [externalIpv6PrefixLength] AccessConfig externalIpv6PrefixLength - * @property {boolean|null} [setPublicPtr] AccessConfig setPublicPtr - * @property {string|null} [publicPtrDomainName] AccessConfig publicPtrDomainName - * @property {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null} [networkTier] AccessConfig networkTier - */ - - /** - * Constructs a new AccessConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an AccessConfig. - * @implements IAccessConfig - * @constructor - * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set - */ - function AccessConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AccessConfig type. - * @member {google.cloud.backupdr.v1.AccessConfig.AccessType|null|undefined} type - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.type = null; - - /** - * AccessConfig name. - * @member {string|null|undefined} name - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.name = null; - - /** - * AccessConfig externalIp. - * @member {string|null|undefined} externalIp - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.externalIp = null; - - /** - * AccessConfig externalIpv6. - * @member {string|null|undefined} externalIpv6 - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.externalIpv6 = null; - - /** - * AccessConfig externalIpv6PrefixLength. - * @member {number|null|undefined} externalIpv6PrefixLength - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.externalIpv6PrefixLength = null; - - /** - * AccessConfig setPublicPtr. - * @member {boolean|null|undefined} setPublicPtr - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.setPublicPtr = null; - - /** - * AccessConfig publicPtrDomainName. - * @member {string|null|undefined} publicPtrDomainName - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.publicPtrDomainName = null; - - /** - * AccessConfig networkTier. - * @member {google.cloud.backupdr.v1.AccessConfig.NetworkTier|null|undefined} networkTier - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - */ - AccessConfig.prototype.networkTier = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_type", { - get: $util.oneOfGetter($oneOfFields = ["type"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_name", { - get: $util.oneOfGetter($oneOfFields = ["name"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_externalIp", { - get: $util.oneOfGetter($oneOfFields = ["externalIp"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_externalIpv6", { - get: $util.oneOfGetter($oneOfFields = ["externalIpv6"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_externalIpv6PrefixLength", { - get: $util.oneOfGetter($oneOfFields = ["externalIpv6PrefixLength"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_setPublicPtr", { - get: $util.oneOfGetter($oneOfFields = ["setPublicPtr"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_publicPtrDomainName", { - get: $util.oneOfGetter($oneOfFields = ["publicPtrDomainName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AccessConfig.prototype, "_networkTier", { - get: $util.oneOfGetter($oneOfFields = ["networkTier"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AccessConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {google.cloud.backupdr.v1.IAccessConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig instance - */ - AccessConfig.create = function create(properties) { - return new AccessConfig(properties); - }; - - /** - * Encodes the specified AccessConfig message. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.name); - if (message.externalIp != null && Object.hasOwnProperty.call(message, "externalIp")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.externalIp); - if (message.externalIpv6 != null && Object.hasOwnProperty.call(message, "externalIpv6")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.externalIpv6); - if (message.externalIpv6PrefixLength != null && Object.hasOwnProperty.call(message, "externalIpv6PrefixLength")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.externalIpv6PrefixLength); - if (message.setPublicPtr != null && Object.hasOwnProperty.call(message, "setPublicPtr")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.setPublicPtr); - if (message.publicPtrDomainName != null && Object.hasOwnProperty.call(message, "publicPtrDomainName")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.publicPtrDomainName); - if (message.networkTier != null && Object.hasOwnProperty.call(message, "networkTier")) - writer.uint32(/* id 8, wireType 0 =*/64).int32(message.networkTier); - return writer; - }; - - /** - * Encodes the specified AccessConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AccessConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {google.cloud.backupdr.v1.IAccessConfig} message AccessConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AccessConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AccessConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AccessConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.name = reader.string(); - break; - } - case 3: { - message.externalIp = reader.string(); - break; - } - case 4: { - message.externalIpv6 = reader.string(); - break; - } - case 5: { - message.externalIpv6PrefixLength = reader.int32(); - break; - } - case 6: { - message.setPublicPtr = reader.bool(); - break; - } - case 7: { - message.publicPtrDomainName = reader.string(); - break; - } - case 8: { - message.networkTier = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AccessConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AccessConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AccessConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AccessConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) { - properties._type = 1; - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.name != null && message.hasOwnProperty("name")) { - properties._name = 1; - if (!$util.isString(message.name)) - return "name: string expected"; - } - if (message.externalIp != null && message.hasOwnProperty("externalIp")) { - properties._externalIp = 1; - if (!$util.isString(message.externalIp)) - return "externalIp: string expected"; - } - if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { - properties._externalIpv6 = 1; - if (!$util.isString(message.externalIpv6)) - return "externalIpv6: string expected"; - } - if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { - properties._externalIpv6PrefixLength = 1; - if (!$util.isInteger(message.externalIpv6PrefixLength)) - return "externalIpv6PrefixLength: integer expected"; - } - if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { - properties._setPublicPtr = 1; - if (typeof message.setPublicPtr !== "boolean") - return "setPublicPtr: boolean expected"; - } - if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { - properties._publicPtrDomainName = 1; - if (!$util.isString(message.publicPtrDomainName)) - return "publicPtrDomainName: string expected"; - } - if (message.networkTier != null && message.hasOwnProperty("networkTier")) { - properties._networkTier = 1; - switch (message.networkTier) { - default: - return "networkTier: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - return null; - }; - - /** - * Creates an AccessConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AccessConfig} AccessConfig - */ - AccessConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AccessConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.AccessConfig(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "ACCESS_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ONE_TO_ONE_NAT": - case 1: - message.type = 1; - break; - case "DIRECT_IPV6": - case 2: - message.type = 2; - break; - } - if (object.name != null) - message.name = String(object.name); - if (object.externalIp != null) - message.externalIp = String(object.externalIp); - if (object.externalIpv6 != null) - message.externalIpv6 = String(object.externalIpv6); - if (object.externalIpv6PrefixLength != null) - message.externalIpv6PrefixLength = object.externalIpv6PrefixLength | 0; - if (object.setPublicPtr != null) - message.setPublicPtr = Boolean(object.setPublicPtr); - if (object.publicPtrDomainName != null) - message.publicPtrDomainName = String(object.publicPtrDomainName); - switch (object.networkTier) { - default: - if (typeof object.networkTier === "number") { - message.networkTier = object.networkTier; - break; - } - break; - case "NETWORK_TIER_UNSPECIFIED": - case 0: - message.networkTier = 0; - break; - case "PREMIUM": - case 1: - message.networkTier = 1; - break; - case "STANDARD": - case 2: - message.networkTier = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an AccessConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {google.cloud.backupdr.v1.AccessConfig} message AccessConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AccessConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.type != null && message.hasOwnProperty("type")) { - object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AccessConfig.AccessType[message.type] : message.type; - if (options.oneofs) - object._type = "type"; - } - if (message.name != null && message.hasOwnProperty("name")) { - object.name = message.name; - if (options.oneofs) - object._name = "name"; - } - if (message.externalIp != null && message.hasOwnProperty("externalIp")) { - object.externalIp = message.externalIp; - if (options.oneofs) - object._externalIp = "externalIp"; - } - if (message.externalIpv6 != null && message.hasOwnProperty("externalIpv6")) { - object.externalIpv6 = message.externalIpv6; - if (options.oneofs) - object._externalIpv6 = "externalIpv6"; - } - if (message.externalIpv6PrefixLength != null && message.hasOwnProperty("externalIpv6PrefixLength")) { - object.externalIpv6PrefixLength = message.externalIpv6PrefixLength; - if (options.oneofs) - object._externalIpv6PrefixLength = "externalIpv6PrefixLength"; - } - if (message.setPublicPtr != null && message.hasOwnProperty("setPublicPtr")) { - object.setPublicPtr = message.setPublicPtr; - if (options.oneofs) - object._setPublicPtr = "setPublicPtr"; - } - if (message.publicPtrDomainName != null && message.hasOwnProperty("publicPtrDomainName")) { - object.publicPtrDomainName = message.publicPtrDomainName; - if (options.oneofs) - object._publicPtrDomainName = "publicPtrDomainName"; - } - if (message.networkTier != null && message.hasOwnProperty("networkTier")) { - object.networkTier = options.enums === String ? $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] === undefined ? message.networkTier : $root.google.cloud.backupdr.v1.AccessConfig.NetworkTier[message.networkTier] : message.networkTier; - if (options.oneofs) - object._networkTier = "networkTier"; - } - return object; - }; - - /** - * Converts this AccessConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.AccessConfig - * @instance - * @returns {Object.} JSON object - */ - AccessConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AccessConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.AccessConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AccessConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.AccessConfig"; - }; - - /** - * AccessType enum. - * @name google.cloud.backupdr.v1.AccessConfig.AccessType - * @enum {number} - * @property {number} ACCESS_TYPE_UNSPECIFIED=0 ACCESS_TYPE_UNSPECIFIED value - * @property {number} ONE_TO_ONE_NAT=1 ONE_TO_ONE_NAT value - * @property {number} DIRECT_IPV6=2 DIRECT_IPV6 value - */ - AccessConfig.AccessType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ACCESS_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ONE_TO_ONE_NAT"] = 1; - values[valuesById[2] = "DIRECT_IPV6"] = 2; - return values; - })(); - - /** - * NetworkTier enum. - * @name google.cloud.backupdr.v1.AccessConfig.NetworkTier - * @enum {number} - * @property {number} NETWORK_TIER_UNSPECIFIED=0 NETWORK_TIER_UNSPECIFIED value - * @property {number} PREMIUM=1 PREMIUM value - * @property {number} STANDARD=2 STANDARD value - */ - AccessConfig.NetworkTier = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "NETWORK_TIER_UNSPECIFIED"] = 0; - values[valuesById[1] = "PREMIUM"] = 1; - values[valuesById[2] = "STANDARD"] = 2; - return values; - })(); - - return AccessConfig; - })(); - - v1.AliasIpRange = (function() { - - /** - * Properties of an AliasIpRange. - * @memberof google.cloud.backupdr.v1 - * @interface IAliasIpRange - * @property {string|null} [ipCidrRange] AliasIpRange ipCidrRange - * @property {string|null} [subnetworkRangeName] AliasIpRange subnetworkRangeName - */ - - /** - * Constructs a new AliasIpRange. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an AliasIpRange. - * @implements IAliasIpRange - * @constructor - * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set - */ - function AliasIpRange(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AliasIpRange ipCidrRange. - * @member {string|null|undefined} ipCidrRange - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @instance - */ - AliasIpRange.prototype.ipCidrRange = null; - - /** - * AliasIpRange subnetworkRangeName. - * @member {string|null|undefined} subnetworkRangeName - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @instance - */ - AliasIpRange.prototype.subnetworkRangeName = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AliasIpRange.prototype, "_ipCidrRange", { - get: $util.oneOfGetter($oneOfFields = ["ipCidrRange"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AliasIpRange.prototype, "_subnetworkRangeName", { - get: $util.oneOfGetter($oneOfFields = ["subnetworkRangeName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AliasIpRange instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {google.cloud.backupdr.v1.IAliasIpRange=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange instance - */ - AliasIpRange.create = function create(properties) { - return new AliasIpRange(properties); - }; - - /** - * Encodes the specified AliasIpRange message. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AliasIpRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ipCidrRange != null && Object.hasOwnProperty.call(message, "ipCidrRange")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ipCidrRange); - if (message.subnetworkRangeName != null && Object.hasOwnProperty.call(message, "subnetworkRangeName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.subnetworkRangeName); - return writer; - }; - - /** - * Encodes the specified AliasIpRange message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AliasIpRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {google.cloud.backupdr.v1.IAliasIpRange} message AliasIpRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AliasIpRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AliasIpRange message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AliasIpRange.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AliasIpRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ipCidrRange = reader.string(); - break; - } - case 2: { - message.subnetworkRangeName = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AliasIpRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AliasIpRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AliasIpRange message. - * @function verify - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AliasIpRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { - properties._ipCidrRange = 1; - if (!$util.isString(message.ipCidrRange)) - return "ipCidrRange: string expected"; - } - if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { - properties._subnetworkRangeName = 1; - if (!$util.isString(message.subnetworkRangeName)) - return "subnetworkRangeName: string expected"; - } - return null; - }; - - /** - * Creates an AliasIpRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AliasIpRange} AliasIpRange - */ - AliasIpRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AliasIpRange) - return object; - var message = new $root.google.cloud.backupdr.v1.AliasIpRange(); - if (object.ipCidrRange != null) - message.ipCidrRange = String(object.ipCidrRange); - if (object.subnetworkRangeName != null) - message.subnetworkRangeName = String(object.subnetworkRangeName); - return message; - }; - - /** - * Creates a plain object from an AliasIpRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {google.cloud.backupdr.v1.AliasIpRange} message AliasIpRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AliasIpRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.ipCidrRange != null && message.hasOwnProperty("ipCidrRange")) { - object.ipCidrRange = message.ipCidrRange; - if (options.oneofs) - object._ipCidrRange = "ipCidrRange"; - } - if (message.subnetworkRangeName != null && message.hasOwnProperty("subnetworkRangeName")) { - object.subnetworkRangeName = message.subnetworkRangeName; - if (options.oneofs) - object._subnetworkRangeName = "subnetworkRangeName"; - } - return object; - }; - - /** - * Converts this AliasIpRange to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @instance - * @returns {Object.} JSON object - */ - AliasIpRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AliasIpRange - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.AliasIpRange - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AliasIpRange.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.AliasIpRange"; - }; - - return AliasIpRange; - })(); - - v1.InstanceParams = (function() { - - /** - * Properties of an InstanceParams. - * @memberof google.cloud.backupdr.v1 - * @interface IInstanceParams - * @property {Object.|null} [resourceManagerTags] InstanceParams resourceManagerTags - */ - - /** - * Constructs a new InstanceParams. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an InstanceParams. - * @implements IInstanceParams - * @constructor - * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set - */ - function InstanceParams(properties) { - this.resourceManagerTags = {}; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InstanceParams resourceManagerTags. - * @member {Object.} resourceManagerTags - * @memberof google.cloud.backupdr.v1.InstanceParams - * @instance - */ - InstanceParams.prototype.resourceManagerTags = $util.emptyObject; - - /** - * Creates a new InstanceParams instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {google.cloud.backupdr.v1.IInstanceParams=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams instance - */ - InstanceParams.create = function create(properties) { - return new InstanceParams(properties); - }; - - /** - * Encodes the specified InstanceParams message. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceManagerTags != null && Object.hasOwnProperty.call(message, "resourceManagerTags")) - for (var keys = Object.keys(message.resourceManagerTags), 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.resourceManagerTags[keys[i]]).ldelim(); - return writer; - }; - - /** - * Encodes the specified InstanceParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.InstanceParams.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {google.cloud.backupdr.v1.IInstanceParams} message InstanceParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InstanceParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InstanceParams message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceParams.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.InstanceParams(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (message.resourceManagerTags === $util.emptyObject) - message.resourceManagerTags = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.resourceManagerTags[key] = value; - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InstanceParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InstanceParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InstanceParams message. - * @function verify - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InstanceParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceManagerTags != null && message.hasOwnProperty("resourceManagerTags")) { - if (!$util.isObject(message.resourceManagerTags)) - return "resourceManagerTags: object expected"; - var key = Object.keys(message.resourceManagerTags); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.resourceManagerTags[key[i]])) - return "resourceManagerTags: string{k:string} expected"; - } - return null; - }; - - /** - * Creates an InstanceParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.InstanceParams} InstanceParams - */ - InstanceParams.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.InstanceParams) - return object; - var message = new $root.google.cloud.backupdr.v1.InstanceParams(); - if (object.resourceManagerTags) { - if (typeof object.resourceManagerTags !== "object") - throw TypeError(".google.cloud.backupdr.v1.InstanceParams.resourceManagerTags: object expected"); - message.resourceManagerTags = {}; - for (var keys = Object.keys(object.resourceManagerTags), i = 0; i < keys.length; ++i) - message.resourceManagerTags[keys[i]] = String(object.resourceManagerTags[keys[i]]); - } - return message; - }; - - /** - * Creates a plain object from an InstanceParams message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {google.cloud.backupdr.v1.InstanceParams} message InstanceParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InstanceParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.objects || options.defaults) - object.resourceManagerTags = {}; - var keys2; - if (message.resourceManagerTags && (keys2 = Object.keys(message.resourceManagerTags)).length) { - object.resourceManagerTags = {}; - for (var j = 0; j < keys2.length; ++j) - object.resourceManagerTags[keys2[j]] = message.resourceManagerTags[keys2[j]]; - } - return object; - }; - - /** - * Converts this InstanceParams to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.InstanceParams - * @instance - * @returns {Object.} JSON object - */ - InstanceParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InstanceParams - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.InstanceParams - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InstanceParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.InstanceParams"; - }; - - return InstanceParams; - })(); - - v1.AllocationAffinity = (function() { - - /** - * Properties of an AllocationAffinity. - * @memberof google.cloud.backupdr.v1 - * @interface IAllocationAffinity - * @property {google.cloud.backupdr.v1.AllocationAffinity.Type|null} [consumeAllocationType] AllocationAffinity consumeAllocationType - * @property {string|null} [key] AllocationAffinity key - * @property {Array.|null} [values] AllocationAffinity values - */ - - /** - * Constructs a new AllocationAffinity. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an AllocationAffinity. - * @implements IAllocationAffinity - * @constructor - * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set - */ - function AllocationAffinity(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]]; - } - - /** - * AllocationAffinity consumeAllocationType. - * @member {google.cloud.backupdr.v1.AllocationAffinity.Type|null|undefined} consumeAllocationType - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @instance - */ - AllocationAffinity.prototype.consumeAllocationType = null; - - /** - * AllocationAffinity key. - * @member {string|null|undefined} key - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @instance - */ - AllocationAffinity.prototype.key = null; - - /** - * AllocationAffinity values. - * @member {Array.} values - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @instance - */ - AllocationAffinity.prototype.values = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AllocationAffinity.prototype, "_consumeAllocationType", { - get: $util.oneOfGetter($oneOfFields = ["consumeAllocationType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AllocationAffinity.prototype, "_key", { - get: $util.oneOfGetter($oneOfFields = ["key"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AllocationAffinity instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {google.cloud.backupdr.v1.IAllocationAffinity=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity instance - */ - AllocationAffinity.create = function create(properties) { - return new AllocationAffinity(properties); - }; - - /** - * Encodes the specified AllocationAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationAffinity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.consumeAllocationType != null && Object.hasOwnProperty.call(message, "consumeAllocationType")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.consumeAllocationType); - 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 AllocationAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AllocationAffinity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {google.cloud.backupdr.v1.IAllocationAffinity} message AllocationAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AllocationAffinity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AllocationAffinity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationAffinity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.consumeAllocationType = 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 an AllocationAffinity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AllocationAffinity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AllocationAffinity message. - * @function verify - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AllocationAffinity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { - properties._consumeAllocationType = 1; - switch (message.consumeAllocationType) { - default: - return "consumeAllocationType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.key != null && message.hasOwnProperty("key")) { - properties._key = 1; - 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 an AllocationAffinity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AllocationAffinity} AllocationAffinity - */ - AllocationAffinity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AllocationAffinity) - return object; - var message = new $root.google.cloud.backupdr.v1.AllocationAffinity(); - switch (object.consumeAllocationType) { - default: - if (typeof object.consumeAllocationType === "number") { - message.consumeAllocationType = object.consumeAllocationType; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.consumeAllocationType = 0; - break; - case "NO_RESERVATION": - case 1: - message.consumeAllocationType = 1; - break; - case "ANY_RESERVATION": - case 2: - message.consumeAllocationType = 2; - break; - case "SPECIFIC_RESERVATION": - case 3: - message.consumeAllocationType = 3; - break; - } - if (object.key != null) - message.key = String(object.key); - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.backupdr.v1.AllocationAffinity.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 an AllocationAffinity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {google.cloud.backupdr.v1.AllocationAffinity} message AllocationAffinity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AllocationAffinity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.consumeAllocationType != null && message.hasOwnProperty("consumeAllocationType")) { - object.consumeAllocationType = options.enums === String ? $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] === undefined ? message.consumeAllocationType : $root.google.cloud.backupdr.v1.AllocationAffinity.Type[message.consumeAllocationType] : message.consumeAllocationType; - if (options.oneofs) - object._consumeAllocationType = "consumeAllocationType"; - } - if (message.key != null && message.hasOwnProperty("key")) { - object.key = message.key; - if (options.oneofs) - object._key = "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 AllocationAffinity to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @instance - * @returns {Object.} JSON object - */ - AllocationAffinity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AllocationAffinity - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.AllocationAffinity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AllocationAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.AllocationAffinity"; - }; - - /** - * Type enum. - * @name google.cloud.backupdr.v1.AllocationAffinity.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 - */ - AllocationAffinity.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 AllocationAffinity; - })(); - - v1.Scheduling = (function() { - - /** - * Properties of a Scheduling. - * @memberof google.cloud.backupdr.v1 - * @interface IScheduling - * @property {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null} [onHostMaintenance] Scheduling onHostMaintenance - * @property {boolean|null} [automaticRestart] Scheduling automaticRestart - * @property {boolean|null} [preemptible] Scheduling preemptible - * @property {Array.|null} [nodeAffinities] Scheduling nodeAffinities - * @property {number|null} [minNodeCpus] Scheduling minNodeCpus - * @property {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null} [provisioningModel] Scheduling provisioningModel - * @property {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null} [instanceTerminationAction] Scheduling instanceTerminationAction - * @property {google.cloud.backupdr.v1.ISchedulingDuration|null} [localSsdRecoveryTimeout] Scheduling localSsdRecoveryTimeout - */ - - /** - * Constructs a new Scheduling. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a Scheduling. - * @implements IScheduling - * @constructor - * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set - */ - function Scheduling(properties) { - this.nodeAffinities = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Scheduling onHostMaintenance. - * @member {google.cloud.backupdr.v1.Scheduling.OnHostMaintenance|null|undefined} onHostMaintenance - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.onHostMaintenance = null; - - /** - * Scheduling automaticRestart. - * @member {boolean|null|undefined} automaticRestart - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.automaticRestart = null; - - /** - * Scheduling preemptible. - * @member {boolean|null|undefined} preemptible - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.preemptible = null; - - /** - * Scheduling nodeAffinities. - * @member {Array.} nodeAffinities - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.nodeAffinities = $util.emptyArray; - - /** - * Scheduling minNodeCpus. - * @member {number|null|undefined} minNodeCpus - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.minNodeCpus = null; - - /** - * Scheduling provisioningModel. - * @member {google.cloud.backupdr.v1.Scheduling.ProvisioningModel|null|undefined} provisioningModel - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.provisioningModel = null; - - /** - * Scheduling instanceTerminationAction. - * @member {google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction|null|undefined} instanceTerminationAction - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.instanceTerminationAction = null; - - /** - * Scheduling localSsdRecoveryTimeout. - * @member {google.cloud.backupdr.v1.ISchedulingDuration|null|undefined} localSsdRecoveryTimeout - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - */ - Scheduling.prototype.localSsdRecoveryTimeout = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_onHostMaintenance", { - get: $util.oneOfGetter($oneOfFields = ["onHostMaintenance"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_automaticRestart", { - get: $util.oneOfGetter($oneOfFields = ["automaticRestart"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_preemptible", { - get: $util.oneOfGetter($oneOfFields = ["preemptible"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_minNodeCpus", { - get: $util.oneOfGetter($oneOfFields = ["minNodeCpus"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_provisioningModel", { - get: $util.oneOfGetter($oneOfFields = ["provisioningModel"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_instanceTerminationAction", { - get: $util.oneOfGetter($oneOfFields = ["instanceTerminationAction"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(Scheduling.prototype, "_localSsdRecoveryTimeout", { - get: $util.oneOfGetter($oneOfFields = ["localSsdRecoveryTimeout"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new Scheduling instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {google.cloud.backupdr.v1.IScheduling=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling instance - */ - Scheduling.create = function create(properties) { - return new Scheduling(properties); - }; - - /** - * Encodes the specified Scheduling message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Scheduling.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.onHostMaintenance != null && Object.hasOwnProperty.call(message, "onHostMaintenance")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.onHostMaintenance); - if (message.automaticRestart != null && Object.hasOwnProperty.call(message, "automaticRestart")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.automaticRestart); - if (message.preemptible != null && Object.hasOwnProperty.call(message, "preemptible")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.preemptible); - if (message.nodeAffinities != null && message.nodeAffinities.length) - for (var i = 0; i < message.nodeAffinities.length; ++i) - $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.encode(message.nodeAffinities[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.minNodeCpus != null && Object.hasOwnProperty.call(message, "minNodeCpus")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.minNodeCpus); - if (message.provisioningModel != null && Object.hasOwnProperty.call(message, "provisioningModel")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.provisioningModel); - if (message.instanceTerminationAction != null && Object.hasOwnProperty.call(message, "instanceTerminationAction")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.instanceTerminationAction); - if (message.localSsdRecoveryTimeout != null && Object.hasOwnProperty.call(message, "localSsdRecoveryTimeout")) - $root.google.cloud.backupdr.v1.SchedulingDuration.encode(message.localSsdRecoveryTimeout, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified Scheduling message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {google.cloud.backupdr.v1.IScheduling} message Scheduling message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Scheduling.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Scheduling message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Scheduling.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.onHostMaintenance = reader.int32(); - break; - } - case 2: { - message.automaticRestart = reader.bool(); - break; - } - case 3: { - message.preemptible = reader.bool(); - break; - } - case 4: { - if (!(message.nodeAffinities && message.nodeAffinities.length)) - message.nodeAffinities = []; - message.nodeAffinities.push($root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.decode(reader, reader.uint32())); - break; - } - case 5: { - message.minNodeCpus = reader.int32(); - break; - } - case 6: { - message.provisioningModel = reader.int32(); - break; - } - case 7: { - message.instanceTerminationAction = reader.int32(); - break; - } - case 10: { - message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Scheduling message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Scheduling.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Scheduling message. - * @function verify - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Scheduling.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { - properties._onHostMaintenance = 1; - switch (message.onHostMaintenance) { - default: - return "onHostMaintenance: enum value expected"; - case 0: - case 1: - case 1000: - break; - } - } - if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { - properties._automaticRestart = 1; - if (typeof message.automaticRestart !== "boolean") - return "automaticRestart: boolean expected"; - } - if (message.preemptible != null && message.hasOwnProperty("preemptible")) { - properties._preemptible = 1; - if (typeof message.preemptible !== "boolean") - return "preemptible: boolean expected"; - } - if (message.nodeAffinities != null && message.hasOwnProperty("nodeAffinities")) { - if (!Array.isArray(message.nodeAffinities)) - return "nodeAffinities: array expected"; - for (var i = 0; i < message.nodeAffinities.length; ++i) { - var error = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify(message.nodeAffinities[i]); - if (error) - return "nodeAffinities." + error; - } - } - if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { - properties._minNodeCpus = 1; - if (!$util.isInteger(message.minNodeCpus)) - return "minNodeCpus: integer expected"; - } - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { - properties._provisioningModel = 1; - switch (message.provisioningModel) { - default: - return "provisioningModel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { - properties._instanceTerminationAction = 1; - switch (message.instanceTerminationAction) { - default: - return "instanceTerminationAction: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { - properties._localSsdRecoveryTimeout = 1; - { - var error = $root.google.cloud.backupdr.v1.SchedulingDuration.verify(message.localSsdRecoveryTimeout); - if (error) - return "localSsdRecoveryTimeout." + error; - } - } - return null; - }; - - /** - * Creates a Scheduling message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Scheduling} Scheduling - */ - Scheduling.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Scheduling) - return object; - var message = new $root.google.cloud.backupdr.v1.Scheduling(); - switch (object.onHostMaintenance) { - default: - if (typeof object.onHostMaintenance === "number") { - message.onHostMaintenance = object.onHostMaintenance; - break; - } - break; - case "ON_HOST_MAINTENANCE_UNSPECIFIED": - case 0: - message.onHostMaintenance = 0; - break; - case "TERMINATE": - case 1: - message.onHostMaintenance = 1; - break; - case "MIGRATE": - case 1000: - message.onHostMaintenance = 1000; - break; - } - if (object.automaticRestart != null) - message.automaticRestart = Boolean(object.automaticRestart); - if (object.preemptible != null) - message.preemptible = Boolean(object.preemptible); - if (object.nodeAffinities) { - if (!Array.isArray(object.nodeAffinities)) - throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: array expected"); - message.nodeAffinities = []; - for (var i = 0; i < object.nodeAffinities.length; ++i) { - if (typeof object.nodeAffinities[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.Scheduling.nodeAffinities: object expected"); - message.nodeAffinities[i] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.fromObject(object.nodeAffinities[i]); - } - } - if (object.minNodeCpus != null) - message.minNodeCpus = object.minNodeCpus | 0; - switch (object.provisioningModel) { - default: - if (typeof object.provisioningModel === "number") { - message.provisioningModel = object.provisioningModel; - break; - } - break; - case "PROVISIONING_MODEL_UNSPECIFIED": - case 0: - message.provisioningModel = 0; - break; - case "STANDARD": - case 1: - message.provisioningModel = 1; - break; - case "SPOT": - case 2: - message.provisioningModel = 2; - break; - } - switch (object.instanceTerminationAction) { - default: - if (typeof object.instanceTerminationAction === "number") { - message.instanceTerminationAction = object.instanceTerminationAction; - break; - } - break; - case "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": - case 0: - message.instanceTerminationAction = 0; - break; - case "DELETE": - case 1: - message.instanceTerminationAction = 1; - break; - case "STOP": - case 2: - message.instanceTerminationAction = 2; - break; - } - if (object.localSsdRecoveryTimeout != null) { - if (typeof object.localSsdRecoveryTimeout !== "object") - throw TypeError(".google.cloud.backupdr.v1.Scheduling.localSsdRecoveryTimeout: object expected"); - message.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.fromObject(object.localSsdRecoveryTimeout); - } - return message; - }; - - /** - * Creates a plain object from a Scheduling message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {google.cloud.backupdr.v1.Scheduling} message Scheduling - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Scheduling.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.nodeAffinities = []; - if (message.onHostMaintenance != null && message.hasOwnProperty("onHostMaintenance")) { - object.onHostMaintenance = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] === undefined ? message.onHostMaintenance : $root.google.cloud.backupdr.v1.Scheduling.OnHostMaintenance[message.onHostMaintenance] : message.onHostMaintenance; - if (options.oneofs) - object._onHostMaintenance = "onHostMaintenance"; - } - if (message.automaticRestart != null && message.hasOwnProperty("automaticRestart")) { - object.automaticRestart = message.automaticRestart; - if (options.oneofs) - object._automaticRestart = "automaticRestart"; - } - if (message.preemptible != null && message.hasOwnProperty("preemptible")) { - object.preemptible = message.preemptible; - if (options.oneofs) - object._preemptible = "preemptible"; - } - if (message.nodeAffinities && message.nodeAffinities.length) { - object.nodeAffinities = []; - for (var j = 0; j < message.nodeAffinities.length; ++j) - object.nodeAffinities[j] = $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.toObject(message.nodeAffinities[j], options); - } - if (message.minNodeCpus != null && message.hasOwnProperty("minNodeCpus")) { - object.minNodeCpus = message.minNodeCpus; - if (options.oneofs) - object._minNodeCpus = "minNodeCpus"; - } - if (message.provisioningModel != null && message.hasOwnProperty("provisioningModel")) { - object.provisioningModel = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] === undefined ? message.provisioningModel : $root.google.cloud.backupdr.v1.Scheduling.ProvisioningModel[message.provisioningModel] : message.provisioningModel; - if (options.oneofs) - object._provisioningModel = "provisioningModel"; - } - if (message.instanceTerminationAction != null && message.hasOwnProperty("instanceTerminationAction")) { - object.instanceTerminationAction = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] === undefined ? message.instanceTerminationAction : $root.google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction[message.instanceTerminationAction] : message.instanceTerminationAction; - if (options.oneofs) - object._instanceTerminationAction = "instanceTerminationAction"; - } - if (message.localSsdRecoveryTimeout != null && message.hasOwnProperty("localSsdRecoveryTimeout")) { - object.localSsdRecoveryTimeout = $root.google.cloud.backupdr.v1.SchedulingDuration.toObject(message.localSsdRecoveryTimeout, options); - if (options.oneofs) - object._localSsdRecoveryTimeout = "localSsdRecoveryTimeout"; - } - return object; - }; - - /** - * Converts this Scheduling to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Scheduling - * @instance - * @returns {Object.} JSON object - */ - Scheduling.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Scheduling - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Scheduling - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Scheduling.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling"; - }; - - /** - * OnHostMaintenance enum. - * @name google.cloud.backupdr.v1.Scheduling.OnHostMaintenance - * @enum {number} - * @property {number} ON_HOST_MAINTENANCE_UNSPECIFIED=0 ON_HOST_MAINTENANCE_UNSPECIFIED value - * @property {number} TERMINATE=1 TERMINATE value - * @property {number} MIGRATE=1000 MIGRATE value - */ - Scheduling.OnHostMaintenance = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "ON_HOST_MAINTENANCE_UNSPECIFIED"] = 0; - values[valuesById[1] = "TERMINATE"] = 1; - values[valuesById[1000] = "MIGRATE"] = 1000; - return values; - })(); - - Scheduling.NodeAffinity = (function() { - - /** - * Properties of a NodeAffinity. - * @memberof google.cloud.backupdr.v1.Scheduling - * @interface INodeAffinity - * @property {string|null} [key] NodeAffinity key - * @property {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null} [operator] NodeAffinity operator - * @property {Array.|null} [values] NodeAffinity values - */ - - /** - * Constructs a new NodeAffinity. - * @memberof google.cloud.backupdr.v1.Scheduling - * @classdesc Represents a NodeAffinity. - * @implements INodeAffinity - * @constructor - * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set - */ - function NodeAffinity(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]]; - } - - /** - * NodeAffinity key. - * @member {string|null|undefined} key - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @instance - */ - NodeAffinity.prototype.key = null; - - /** - * NodeAffinity operator. - * @member {google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator|null|undefined} operator - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @instance - */ - NodeAffinity.prototype.operator = null; - - /** - * NodeAffinity values. - * @member {Array.} values - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @instance - */ - NodeAffinity.prototype.values = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NodeAffinity.prototype, "_key", { - get: $util.oneOfGetter($oneOfFields = ["key"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(NodeAffinity.prototype, "_operator", { - get: $util.oneOfGetter($oneOfFields = ["operator"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new NodeAffinity instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity instance - */ - NodeAffinity.create = function create(properties) { - return new NodeAffinity(properties); - }; - - /** - * Encodes the specified NodeAffinity message. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeAffinity.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.key != null && Object.hasOwnProperty.call(message, "key")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.key); - if (message.operator != null && Object.hasOwnProperty.call(message, "operator")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.operator); - 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 NodeAffinity message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Scheduling.NodeAffinity.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {google.cloud.backupdr.v1.Scheduling.INodeAffinity} message NodeAffinity message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NodeAffinity.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NodeAffinity message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeAffinity.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.key = reader.string(); - break; - } - case 2: { - message.operator = reader.int32(); - 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 NodeAffinity message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NodeAffinity.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NodeAffinity message. - * @function verify - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NodeAffinity.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.key != null && message.hasOwnProperty("key")) { - properties._key = 1; - if (!$util.isString(message.key)) - return "key: string expected"; - } - if (message.operator != null && message.hasOwnProperty("operator")) { - properties._operator = 1; - switch (message.operator) { - default: - return "operator: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - 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 NodeAffinity message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Scheduling.NodeAffinity} NodeAffinity - */ - NodeAffinity.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity) - return object; - var message = new $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity(); - if (object.key != null) - message.key = String(object.key); - switch (object.operator) { - default: - if (typeof object.operator === "number") { - message.operator = object.operator; - break; - } - break; - case "OPERATOR_UNSPECIFIED": - case 0: - message.operator = 0; - break; - case "IN": - case 1: - message.operator = 1; - break; - case "NOT_IN": - case 2: - message.operator = 2; - break; - } - if (object.values) { - if (!Array.isArray(object.values)) - throw TypeError(".google.cloud.backupdr.v1.Scheduling.NodeAffinity.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 NodeAffinity message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {google.cloud.backupdr.v1.Scheduling.NodeAffinity} message NodeAffinity - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NodeAffinity.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.values = []; - if (message.key != null && message.hasOwnProperty("key")) { - object.key = message.key; - if (options.oneofs) - object._key = "key"; - } - if (message.operator != null && message.hasOwnProperty("operator")) { - object.operator = options.enums === String ? $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] === undefined ? message.operator : $root.google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator[message.operator] : message.operator; - if (options.oneofs) - object._operator = "operator"; - } - 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 NodeAffinity to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @instance - * @returns {Object.} JSON object - */ - NodeAffinity.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for NodeAffinity - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Scheduling.NodeAffinity - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - NodeAffinity.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Scheduling.NodeAffinity"; - }; - - /** - * Operator enum. - * @name google.cloud.backupdr.v1.Scheduling.NodeAffinity.Operator - * @enum {number} - * @property {number} OPERATOR_UNSPECIFIED=0 OPERATOR_UNSPECIFIED value - * @property {number} IN=1 IN value - * @property {number} NOT_IN=2 NOT_IN value - */ - NodeAffinity.Operator = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "OPERATOR_UNSPECIFIED"] = 0; - values[valuesById[1] = "IN"] = 1; - values[valuesById[2] = "NOT_IN"] = 2; - return values; - })(); - - return NodeAffinity; - })(); - - /** - * ProvisioningModel enum. - * @name google.cloud.backupdr.v1.Scheduling.ProvisioningModel - * @enum {number} - * @property {number} PROVISIONING_MODEL_UNSPECIFIED=0 PROVISIONING_MODEL_UNSPECIFIED value - * @property {number} STANDARD=1 STANDARD value - * @property {number} SPOT=2 SPOT value - */ - Scheduling.ProvisioningModel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "PROVISIONING_MODEL_UNSPECIFIED"] = 0; - values[valuesById[1] = "STANDARD"] = 1; - values[valuesById[2] = "SPOT"] = 2; - return values; - })(); - - /** - * InstanceTerminationAction enum. - * @name google.cloud.backupdr.v1.Scheduling.InstanceTerminationAction - * @enum {number} - * @property {number} INSTANCE_TERMINATION_ACTION_UNSPECIFIED=0 INSTANCE_TERMINATION_ACTION_UNSPECIFIED value - * @property {number} DELETE=1 DELETE value - * @property {number} STOP=2 STOP value - */ - Scheduling.InstanceTerminationAction = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "INSTANCE_TERMINATION_ACTION_UNSPECIFIED"] = 0; - values[valuesById[1] = "DELETE"] = 1; - values[valuesById[2] = "STOP"] = 2; - return values; - })(); - - return Scheduling; - })(); - - v1.SchedulingDuration = (function() { - - /** - * Properties of a SchedulingDuration. - * @memberof google.cloud.backupdr.v1 - * @interface ISchedulingDuration - * @property {number|Long|null} [seconds] SchedulingDuration seconds - * @property {number|null} [nanos] SchedulingDuration nanos - */ - - /** - * Constructs a new SchedulingDuration. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a SchedulingDuration. - * @implements ISchedulingDuration - * @constructor - * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set - */ - function SchedulingDuration(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * SchedulingDuration seconds. - * @member {number|Long|null|undefined} seconds - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @instance - */ - SchedulingDuration.prototype.seconds = null; - - /** - * SchedulingDuration nanos. - * @member {number|null|undefined} nanos - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @instance - */ - SchedulingDuration.prototype.nanos = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SchedulingDuration.prototype, "_seconds", { - get: $util.oneOfGetter($oneOfFields = ["seconds"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(SchedulingDuration.prototype, "_nanos", { - get: $util.oneOfGetter($oneOfFields = ["nanos"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new SchedulingDuration instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {google.cloud.backupdr.v1.ISchedulingDuration=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration instance - */ - SchedulingDuration.create = function create(properties) { - return new SchedulingDuration(properties); - }; - - /** - * Encodes the specified SchedulingDuration message. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchedulingDuration.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 SchedulingDuration message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.SchedulingDuration.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {google.cloud.backupdr.v1.ISchedulingDuration} message SchedulingDuration message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SchedulingDuration.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SchedulingDuration message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchedulingDuration.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); - 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 SchedulingDuration message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SchedulingDuration.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SchedulingDuration message. - * @function verify - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SchedulingDuration.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.seconds != null && message.hasOwnProperty("seconds")) { - properties._seconds = 1; - 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")) { - properties._nanos = 1; - if (!$util.isInteger(message.nanos)) - return "nanos: integer expected"; - } - return null; - }; - - /** - * Creates a SchedulingDuration message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.SchedulingDuration} SchedulingDuration - */ - SchedulingDuration.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.SchedulingDuration) - return object; - var message = new $root.google.cloud.backupdr.v1.SchedulingDuration(); - 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 SchedulingDuration message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {google.cloud.backupdr.v1.SchedulingDuration} message SchedulingDuration - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SchedulingDuration.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - 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 (options.oneofs) - object._seconds = "seconds"; - } - if (message.nanos != null && message.hasOwnProperty("nanos")) { - object.nanos = message.nanos; - if (options.oneofs) - object._nanos = "nanos"; - } - return object; - }; - - /** - * Converts this SchedulingDuration to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @instance - * @returns {Object.} JSON object - */ - SchedulingDuration.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for SchedulingDuration - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.SchedulingDuration - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - SchedulingDuration.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.SchedulingDuration"; - }; - - return SchedulingDuration; - })(); - - v1.ServiceAccount = (function() { - - /** - * Properties of a ServiceAccount. - * @memberof google.cloud.backupdr.v1 - * @interface IServiceAccount - * @property {string|null} [email] ServiceAccount email - * @property {Array.|null} [scopes] ServiceAccount scopes - */ - - /** - * Constructs a new ServiceAccount. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ServiceAccount. - * @implements IServiceAccount - * @constructor - * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set - */ - function ServiceAccount(properties) { - this.scopes = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ServiceAccount email. - * @member {string|null|undefined} email - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @instance - */ - ServiceAccount.prototype.email = null; - - /** - * ServiceAccount scopes. - * @member {Array.} scopes - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @instance - */ - ServiceAccount.prototype.scopes = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(ServiceAccount.prototype, "_email", { - get: $util.oneOfGetter($oneOfFields = ["email"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new ServiceAccount instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {google.cloud.backupdr.v1.IServiceAccount=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount instance - */ - ServiceAccount.create = function create(properties) { - return new ServiceAccount(properties); - }; - - /** - * Encodes the specified ServiceAccount message. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.email != null && Object.hasOwnProperty.call(message, "email")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.email); - if (message.scopes != null && message.scopes.length) - for (var i = 0; i < message.scopes.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.scopes[i]); - return writer; - }; - - /** - * Encodes the specified ServiceAccount message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ServiceAccount.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {google.cloud.backupdr.v1.IServiceAccount} message ServiceAccount message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceAccount.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ServiceAccount(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.email = reader.string(); - break; - } - case 2: { - if (!(message.scopes && message.scopes.length)) - message.scopes = []; - message.scopes.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceAccount message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceAccount.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceAccount message. - * @function verify - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceAccount.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.email != null && message.hasOwnProperty("email")) { - properties._email = 1; - if (!$util.isString(message.email)) - return "email: string expected"; - } - if (message.scopes != null && message.hasOwnProperty("scopes")) { - if (!Array.isArray(message.scopes)) - return "scopes: array expected"; - for (var i = 0; i < message.scopes.length; ++i) - if (!$util.isString(message.scopes[i])) - return "scopes: string[] expected"; - } - return null; - }; - - /** - * Creates a ServiceAccount message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ServiceAccount} ServiceAccount - */ - ServiceAccount.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ServiceAccount) - return object; - var message = new $root.google.cloud.backupdr.v1.ServiceAccount(); - if (object.email != null) - message.email = String(object.email); - if (object.scopes) { - if (!Array.isArray(object.scopes)) - throw TypeError(".google.cloud.backupdr.v1.ServiceAccount.scopes: array expected"); - message.scopes = []; - for (var i = 0; i < object.scopes.length; ++i) - message.scopes[i] = String(object.scopes[i]); - } - return message; - }; - - /** - * Creates a plain object from a ServiceAccount message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {google.cloud.backupdr.v1.ServiceAccount} message ServiceAccount - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceAccount.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.scopes = []; - if (message.email != null && message.hasOwnProperty("email")) { - object.email = message.email; - if (options.oneofs) - object._email = "email"; - } - if (message.scopes && message.scopes.length) { - object.scopes = []; - for (var j = 0; j < message.scopes.length; ++j) - object.scopes[j] = message.scopes[j]; - } - return object; - }; - - /** - * Converts this ServiceAccount to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @instance - * @returns {Object.} JSON object - */ - ServiceAccount.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ServiceAccount - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ServiceAccount - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ServiceAccount.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ServiceAccount"; - }; - - return ServiceAccount; - })(); - - v1.Tags = (function() { - - /** - * Properties of a Tags. - * @memberof google.cloud.backupdr.v1 - * @interface ITags - * @property {Array.|null} [items] Tags items - */ - - /** - * Constructs a new Tags. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a Tags. - * @implements ITags - * @constructor - * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set - */ - function Tags(properties) { - this.items = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * Tags items. - * @member {Array.} items - * @memberof google.cloud.backupdr.v1.Tags - * @instance - */ - Tags.prototype.items = $util.emptyArray; - - /** - * Creates a new Tags instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {google.cloud.backupdr.v1.ITags=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.Tags} Tags instance - */ - Tags.create = function create(properties) { - return new Tags(properties); - }; - - /** - * Encodes the specified Tags message. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tags.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.items != null && message.items.length) - for (var i = 0; i < message.items.length; ++i) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.items[i]); - return writer; - }; - - /** - * Encodes the specified Tags message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.Tags.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {google.cloud.backupdr.v1.ITags} message Tags message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Tags.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Tags message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.Tags} Tags - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tags.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.Tags(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.items && message.items.length)) - message.items = []; - message.items.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Tags message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.Tags} Tags - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Tags.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Tags message. - * @function verify - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Tags.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.items != null && message.hasOwnProperty("items")) { - if (!Array.isArray(message.items)) - return "items: array expected"; - for (var i = 0; i < message.items.length; ++i) - if (!$util.isString(message.items[i])) - return "items: string[] expected"; - } - return null; - }; - - /** - * Creates a Tags message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.Tags} Tags - */ - Tags.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.Tags) - return object; - var message = new $root.google.cloud.backupdr.v1.Tags(); - if (object.items) { - if (!Array.isArray(object.items)) - throw TypeError(".google.cloud.backupdr.v1.Tags.items: array expected"); - message.items = []; - for (var i = 0; i < object.items.length; ++i) - message.items[i] = String(object.items[i]); - } - return message; - }; - - /** - * Creates a plain object from a Tags message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {google.cloud.backupdr.v1.Tags} message Tags - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tags.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.items = []; - if (message.items && message.items.length) { - object.items = []; - for (var j = 0; j < message.items.length; ++j) - object.items[j] = message.items[j]; - } - return object; - }; - - /** - * Converts this Tags to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.Tags - * @instance - * @returns {Object.} JSON object - */ - Tags.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for Tags - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.Tags - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - Tags.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.Tags"; - }; - - return Tags; - })(); - - v1.AttachedDisk = (function() { - - /** - * Properties of an AttachedDisk. - * @memberof google.cloud.backupdr.v1 - * @interface IAttachedDisk - * @property {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null} [initializeParams] AttachedDisk initializeParams - * @property {string|null} [deviceName] AttachedDisk deviceName - * @property {string|null} [kind] AttachedDisk kind - * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [diskTypeDeprecated] AttachedDisk diskTypeDeprecated - * @property {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null} [mode] AttachedDisk mode - * @property {string|null} [source] AttachedDisk source - * @property {number|Long|null} [index] AttachedDisk index - * @property {boolean|null} [boot] AttachedDisk boot - * @property {boolean|null} [autoDelete] AttachedDisk autoDelete - * @property {Array.|null} [license] AttachedDisk license - * @property {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null} [diskInterface] AttachedDisk diskInterface - * @property {Array.|null} [guestOsFeature] AttachedDisk guestOsFeature - * @property {google.cloud.backupdr.v1.ICustomerEncryptionKey|null} [diskEncryptionKey] AttachedDisk diskEncryptionKey - * @property {number|Long|null} [diskSizeGb] AttachedDisk diskSizeGb - * @property {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null} [savedState] AttachedDisk savedState - * @property {string|null} [diskType] AttachedDisk diskType - * @property {google.cloud.backupdr.v1.AttachedDisk.DiskType|null} [type] AttachedDisk type - */ - - /** - * Constructs a new AttachedDisk. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents an AttachedDisk. - * @implements IAttachedDisk - * @constructor - * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set - */ - function AttachedDisk(properties) { - this.license = []; - this.guestOsFeature = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * AttachedDisk initializeParams. - * @member {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams|null|undefined} initializeParams - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.initializeParams = null; - - /** - * AttachedDisk deviceName. - * @member {string|null|undefined} deviceName - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.deviceName = null; - - /** - * AttachedDisk kind. - * @member {string|null|undefined} kind - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.kind = null; - - /** - * AttachedDisk diskTypeDeprecated. - * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} diskTypeDeprecated - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.diskTypeDeprecated = null; - - /** - * AttachedDisk mode. - * @member {google.cloud.backupdr.v1.AttachedDisk.DiskMode|null|undefined} mode - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.mode = null; - - /** - * AttachedDisk source. - * @member {string|null|undefined} source - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.source = null; - - /** - * AttachedDisk index. - * @member {number|Long|null|undefined} index - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.index = null; - - /** - * AttachedDisk boot. - * @member {boolean|null|undefined} boot - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.boot = null; - - /** - * AttachedDisk autoDelete. - * @member {boolean|null|undefined} autoDelete - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.autoDelete = null; - - /** - * AttachedDisk license. - * @member {Array.} license - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.license = $util.emptyArray; - - /** - * AttachedDisk diskInterface. - * @member {google.cloud.backupdr.v1.AttachedDisk.DiskInterface|null|undefined} diskInterface - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.diskInterface = null; - - /** - * AttachedDisk guestOsFeature. - * @member {Array.} guestOsFeature - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.guestOsFeature = $util.emptyArray; - - /** - * AttachedDisk diskEncryptionKey. - * @member {google.cloud.backupdr.v1.ICustomerEncryptionKey|null|undefined} diskEncryptionKey - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.diskEncryptionKey = null; - - /** - * AttachedDisk diskSizeGb. - * @member {number|Long|null|undefined} diskSizeGb - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.diskSizeGb = null; - - /** - * AttachedDisk savedState. - * @member {google.cloud.backupdr.v1.AttachedDisk.DiskSavedState|null|undefined} savedState - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.savedState = null; - - /** - * AttachedDisk diskType. - * @member {string|null|undefined} diskType - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.diskType = null; - - /** - * AttachedDisk type. - * @member {google.cloud.backupdr.v1.AttachedDisk.DiskType|null|undefined} type - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - */ - AttachedDisk.prototype.type = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_initializeParams", { - get: $util.oneOfGetter($oneOfFields = ["initializeParams"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_deviceName", { - get: $util.oneOfGetter($oneOfFields = ["deviceName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_kind", { - get: $util.oneOfGetter($oneOfFields = ["kind"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_diskTypeDeprecated", { - get: $util.oneOfGetter($oneOfFields = ["diskTypeDeprecated"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_mode", { - get: $util.oneOfGetter($oneOfFields = ["mode"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_source", { - get: $util.oneOfGetter($oneOfFields = ["source"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_index", { - get: $util.oneOfGetter($oneOfFields = ["index"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_boot", { - get: $util.oneOfGetter($oneOfFields = ["boot"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_autoDelete", { - get: $util.oneOfGetter($oneOfFields = ["autoDelete"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_diskInterface", { - get: $util.oneOfGetter($oneOfFields = ["diskInterface"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_diskEncryptionKey", { - get: $util.oneOfGetter($oneOfFields = ["diskEncryptionKey"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_diskSizeGb", { - get: $util.oneOfGetter($oneOfFields = ["diskSizeGb"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_savedState", { - get: $util.oneOfGetter($oneOfFields = ["savedState"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_diskType", { - get: $util.oneOfGetter($oneOfFields = ["diskType"]), - set: $util.oneOfSetter($oneOfFields) - }); - - // Virtual OneOf for proto3 optional field - Object.defineProperty(AttachedDisk.prototype, "_type", { - get: $util.oneOfGetter($oneOfFields = ["type"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new AttachedDisk instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {google.cloud.backupdr.v1.IAttachedDisk=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk instance - */ - AttachedDisk.create = function create(properties) { - return new AttachedDisk(properties); - }; - - /** - * Encodes the specified AttachedDisk message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.initializeParams != null && Object.hasOwnProperty.call(message, "initializeParams")) - $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.encode(message.initializeParams, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.deviceName != null && Object.hasOwnProperty.call(message, "deviceName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.deviceName); - if (message.kind != null && Object.hasOwnProperty.call(message, "kind")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.kind); - if (message.diskTypeDeprecated != null && Object.hasOwnProperty.call(message, "diskTypeDeprecated")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.diskTypeDeprecated); - if (message.mode != null && Object.hasOwnProperty.call(message, "mode")) - writer.uint32(/* id 7, wireType 0 =*/56).int32(message.mode); - if (message.source != null && Object.hasOwnProperty.call(message, "source")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.source); - if (message.index != null && Object.hasOwnProperty.call(message, "index")) - writer.uint32(/* id 9, wireType 0 =*/72).int64(message.index); - if (message.boot != null && Object.hasOwnProperty.call(message, "boot")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.boot); - if (message.autoDelete != null && Object.hasOwnProperty.call(message, "autoDelete")) - writer.uint32(/* id 11, wireType 0 =*/88).bool(message.autoDelete); - if (message.license != null && message.license.length) - for (var i = 0; i < message.license.length; ++i) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.license[i]); - if (message.diskInterface != null && Object.hasOwnProperty.call(message, "diskInterface")) - writer.uint32(/* id 13, wireType 0 =*/104).int32(message.diskInterface); - if (message.guestOsFeature != null && message.guestOsFeature.length) - for (var i = 0; i < message.guestOsFeature.length; ++i) - $root.google.cloud.backupdr.v1.GuestOsFeature.encode(message.guestOsFeature[i], writer.uint32(/* id 14, wireType 2 =*/114).fork()).ldelim(); - if (message.diskEncryptionKey != null && Object.hasOwnProperty.call(message, "diskEncryptionKey")) - $root.google.cloud.backupdr.v1.CustomerEncryptionKey.encode(message.diskEncryptionKey, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim(); - if (message.diskSizeGb != null && Object.hasOwnProperty.call(message, "diskSizeGb")) - writer.uint32(/* id 16, wireType 0 =*/128).int64(message.diskSizeGb); - if (message.savedState != null && Object.hasOwnProperty.call(message, "savedState")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.savedState); - if (message.diskType != null && Object.hasOwnProperty.call(message, "diskType")) - writer.uint32(/* id 18, wireType 2 =*/146).string(message.diskType); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.type); - return writer; - }; - - /** - * Encodes the specified AttachedDisk message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {google.cloud.backupdr.v1.IAttachedDisk} message AttachedDisk message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttachedDisk.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.decode(reader, reader.uint32()); - break; - } - case 4: { - message.deviceName = reader.string(); - break; - } - case 5: { - message.kind = reader.string(); - break; - } - case 6: { - message.diskTypeDeprecated = reader.int32(); - break; - } - case 7: { - message.mode = reader.int32(); - break; - } - case 8: { - message.source = reader.string(); - break; - } - case 9: { - message.index = reader.int64(); - break; - } - case 10: { - message.boot = reader.bool(); - break; - } - case 11: { - message.autoDelete = reader.bool(); - break; - } - case 12: { - if (!(message.license && message.license.length)) - message.license = []; - message.license.push(reader.string()); - break; - } - case 13: { - message.diskInterface = reader.int32(); - break; - } - case 14: { - if (!(message.guestOsFeature && message.guestOsFeature.length)) - message.guestOsFeature = []; - message.guestOsFeature.push($root.google.cloud.backupdr.v1.GuestOsFeature.decode(reader, reader.uint32())); - break; - } - case 15: { - message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.decode(reader, reader.uint32()); - break; - } - case 16: { - message.diskSizeGb = reader.int64(); - break; - } - case 17: { - message.savedState = reader.int32(); - break; - } - case 18: { - message.diskType = reader.string(); - break; - } - case 19: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttachedDisk message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttachedDisk.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttachedDisk message. - * @function verify - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttachedDisk.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { - properties._initializeParams = 1; - { - var error = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify(message.initializeParams); - if (error) - return "initializeParams." + error; - } - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - properties._deviceName = 1; - if (!$util.isString(message.deviceName)) - return "deviceName: string expected"; - } - if (message.kind != null && message.hasOwnProperty("kind")) { - properties._kind = 1; - if (!$util.isString(message.kind)) - return "kind: string expected"; - } - if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { - properties._diskTypeDeprecated = 1; - switch (message.diskTypeDeprecated) { - default: - return "diskTypeDeprecated: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - if (message.mode != null && message.hasOwnProperty("mode")) { - properties._mode = 1; - switch (message.mode) { - default: - return "mode: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - } - if (message.source != null && message.hasOwnProperty("source")) { - properties._source = 1; - if (!$util.isString(message.source)) - return "source: string expected"; - } - if (message.index != null && message.hasOwnProperty("index")) { - properties._index = 1; - if (!$util.isInteger(message.index) && !(message.index && $util.isInteger(message.index.low) && $util.isInteger(message.index.high))) - return "index: integer|Long expected"; - } - if (message.boot != null && message.hasOwnProperty("boot")) { - properties._boot = 1; - if (typeof message.boot !== "boolean") - return "boot: boolean expected"; - } - if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { - properties._autoDelete = 1; - if (typeof message.autoDelete !== "boolean") - return "autoDelete: boolean expected"; - } - if (message.license != null && message.hasOwnProperty("license")) { - if (!Array.isArray(message.license)) - return "license: array expected"; - for (var i = 0; i < message.license.length; ++i) - if (!$util.isString(message.license[i])) - return "license: string[] expected"; - } - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { - properties._diskInterface = 1; - switch (message.diskInterface) { - default: - return "diskInterface: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - } - if (message.guestOsFeature != null && message.hasOwnProperty("guestOsFeature")) { - if (!Array.isArray(message.guestOsFeature)) - return "guestOsFeature: array expected"; - for (var i = 0; i < message.guestOsFeature.length; ++i) { - var error = $root.google.cloud.backupdr.v1.GuestOsFeature.verify(message.guestOsFeature[i]); - if (error) - return "guestOsFeature." + error; - } - } - if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { - properties._diskEncryptionKey = 1; - { - var error = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.verify(message.diskEncryptionKey); - if (error) - return "diskEncryptionKey." + error; - } - } - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { - properties._diskSizeGb = 1; - if (!$util.isInteger(message.diskSizeGb) && !(message.diskSizeGb && $util.isInteger(message.diskSizeGb.low) && $util.isInteger(message.diskSizeGb.high))) - return "diskSizeGb: integer|Long expected"; - } - if (message.savedState != null && message.hasOwnProperty("savedState")) { - properties._savedState = 1; - switch (message.savedState) { - default: - return "savedState: enum value expected"; - case 0: - case 1: - break; - } - } - if (message.diskType != null && message.hasOwnProperty("diskType")) { - properties._diskType = 1; - if (!$util.isString(message.diskType)) - return "diskType: string expected"; - } - if (message.type != null && message.hasOwnProperty("type")) { - properties._type = 1; - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - break; - } - } - return null; - }; - - /** - * Creates an AttachedDisk message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AttachedDisk} AttachedDisk - */ - AttachedDisk.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk) - return object; - var message = new $root.google.cloud.backupdr.v1.AttachedDisk(); - if (object.initializeParams != null) { - if (typeof object.initializeParams !== "object") - throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.initializeParams: object expected"); - message.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.fromObject(object.initializeParams); - } - if (object.deviceName != null) - message.deviceName = String(object.deviceName); - if (object.kind != null) - message.kind = String(object.kind); - switch (object.diskTypeDeprecated) { - default: - if (typeof object.diskTypeDeprecated === "number") { - message.diskTypeDeprecated = object.diskTypeDeprecated; - break; - } - break; - case "DISK_TYPE_UNSPECIFIED": - case 0: - message.diskTypeDeprecated = 0; - break; - case "SCRATCH": - case 1: - message.diskTypeDeprecated = 1; - break; - case "PERSISTENT": - case 2: - message.diskTypeDeprecated = 2; - break; - } - switch (object.mode) { - default: - if (typeof object.mode === "number") { - message.mode = object.mode; - break; - } - break; - case "DISK_MODE_UNSPECIFIED": - case 0: - message.mode = 0; - break; - case "READ_WRITE": - case 1: - message.mode = 1; - break; - case "READ_ONLY": - case 2: - message.mode = 2; - break; - case "LOCKED": - case 3: - message.mode = 3; - break; - } - if (object.source != null) - message.source = String(object.source); - if (object.index != null) - if ($util.Long) - (message.index = $util.Long.fromValue(object.index)).unsigned = false; - else if (typeof object.index === "string") - message.index = parseInt(object.index, 10); - else if (typeof object.index === "number") - message.index = object.index; - else if (typeof object.index === "object") - message.index = new $util.LongBits(object.index.low >>> 0, object.index.high >>> 0).toNumber(); - if (object.boot != null) - message.boot = Boolean(object.boot); - if (object.autoDelete != null) - message.autoDelete = Boolean(object.autoDelete); - if (object.license) { - if (!Array.isArray(object.license)) - throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.license: array expected"); - message.license = []; - for (var i = 0; i < object.license.length; ++i) - message.license[i] = String(object.license[i]); - } - switch (object.diskInterface) { - default: - if (typeof object.diskInterface === "number") { - message.diskInterface = object.diskInterface; - break; - } - break; - case "DISK_INTERFACE_UNSPECIFIED": - case 0: - message.diskInterface = 0; - break; - case "SCSI": - case 1: - message.diskInterface = 1; - break; - case "NVME": - case 2: - message.diskInterface = 2; - break; - case "NVDIMM": - case 3: - message.diskInterface = 3; - break; - case "ISCSI": - case 4: - message.diskInterface = 4; - break; - } - if (object.guestOsFeature) { - if (!Array.isArray(object.guestOsFeature)) - throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: array expected"); - message.guestOsFeature = []; - for (var i = 0; i < object.guestOsFeature.length; ++i) { - if (typeof object.guestOsFeature[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.guestOsFeature: object expected"); - message.guestOsFeature[i] = $root.google.cloud.backupdr.v1.GuestOsFeature.fromObject(object.guestOsFeature[i]); - } - } - if (object.diskEncryptionKey != null) { - if (typeof object.diskEncryptionKey !== "object") - throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.diskEncryptionKey: object expected"); - message.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.fromObject(object.diskEncryptionKey); - } - if (object.diskSizeGb != null) - if ($util.Long) - (message.diskSizeGb = $util.Long.fromValue(object.diskSizeGb)).unsigned = false; - else if (typeof object.diskSizeGb === "string") - message.diskSizeGb = parseInt(object.diskSizeGb, 10); - else if (typeof object.diskSizeGb === "number") - message.diskSizeGb = object.diskSizeGb; - else if (typeof object.diskSizeGb === "object") - message.diskSizeGb = new $util.LongBits(object.diskSizeGb.low >>> 0, object.diskSizeGb.high >>> 0).toNumber(); - switch (object.savedState) { - default: - if (typeof object.savedState === "number") { - message.savedState = object.savedState; - break; - } - break; - case "DISK_SAVED_STATE_UNSPECIFIED": - case 0: - message.savedState = 0; - break; - case "PRESERVED": - case 1: - message.savedState = 1; - break; - } - if (object.diskType != null) - message.diskType = String(object.diskType); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "DISK_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "SCRATCH": - case 1: - message.type = 1; - break; - case "PERSISTENT": - case 2: - message.type = 2; - break; - } - return message; - }; - - /** - * Creates a plain object from an AttachedDisk message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {google.cloud.backupdr.v1.AttachedDisk} message AttachedDisk - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttachedDisk.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.license = []; - object.guestOsFeature = []; - } - if (message.initializeParams != null && message.hasOwnProperty("initializeParams")) { - object.initializeParams = $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams.toObject(message.initializeParams, options); - if (options.oneofs) - object._initializeParams = "initializeParams"; - } - if (message.deviceName != null && message.hasOwnProperty("deviceName")) { - object.deviceName = message.deviceName; - if (options.oneofs) - object._deviceName = "deviceName"; - } - if (message.kind != null && message.hasOwnProperty("kind")) { - object.kind = message.kind; - if (options.oneofs) - object._kind = "kind"; - } - if (message.diskTypeDeprecated != null && message.hasOwnProperty("diskTypeDeprecated")) { - object.diskTypeDeprecated = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] === undefined ? message.diskTypeDeprecated : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.diskTypeDeprecated] : message.diskTypeDeprecated; - if (options.oneofs) - object._diskTypeDeprecated = "diskTypeDeprecated"; - } - if (message.mode != null && message.hasOwnProperty("mode")) { - object.mode = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] === undefined ? message.mode : $root.google.cloud.backupdr.v1.AttachedDisk.DiskMode[message.mode] : message.mode; - if (options.oneofs) - object._mode = "mode"; - } - if (message.source != null && message.hasOwnProperty("source")) { - object.source = message.source; - if (options.oneofs) - object._source = "source"; - } - if (message.index != null && message.hasOwnProperty("index")) { - if (typeof message.index === "number") - object.index = options.longs === String ? String(message.index) : message.index; - else - object.index = options.longs === String ? $util.Long.prototype.toString.call(message.index) : options.longs === Number ? new $util.LongBits(message.index.low >>> 0, message.index.high >>> 0).toNumber() : message.index; - if (options.oneofs) - object._index = "index"; - } - if (message.boot != null && message.hasOwnProperty("boot")) { - object.boot = message.boot; - if (options.oneofs) - object._boot = "boot"; - } - if (message.autoDelete != null && message.hasOwnProperty("autoDelete")) { - object.autoDelete = message.autoDelete; - if (options.oneofs) - object._autoDelete = "autoDelete"; - } - if (message.license && message.license.length) { - object.license = []; - for (var j = 0; j < message.license.length; ++j) - object.license[j] = message.license[j]; - } - if (message.diskInterface != null && message.hasOwnProperty("diskInterface")) { - object.diskInterface = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] === undefined ? message.diskInterface : $root.google.cloud.backupdr.v1.AttachedDisk.DiskInterface[message.diskInterface] : message.diskInterface; - if (options.oneofs) - object._diskInterface = "diskInterface"; - } - if (message.guestOsFeature && message.guestOsFeature.length) { - object.guestOsFeature = []; - for (var j = 0; j < message.guestOsFeature.length; ++j) - object.guestOsFeature[j] = $root.google.cloud.backupdr.v1.GuestOsFeature.toObject(message.guestOsFeature[j], options); - } - if (message.diskEncryptionKey != null && message.hasOwnProperty("diskEncryptionKey")) { - object.diskEncryptionKey = $root.google.cloud.backupdr.v1.CustomerEncryptionKey.toObject(message.diskEncryptionKey, options); - if (options.oneofs) - object._diskEncryptionKey = "diskEncryptionKey"; - } - if (message.diskSizeGb != null && message.hasOwnProperty("diskSizeGb")) { - if (typeof message.diskSizeGb === "number") - object.diskSizeGb = options.longs === String ? String(message.diskSizeGb) : message.diskSizeGb; - else - object.diskSizeGb = options.longs === String ? $util.Long.prototype.toString.call(message.diskSizeGb) : options.longs === Number ? new $util.LongBits(message.diskSizeGb.low >>> 0, message.diskSizeGb.high >>> 0).toNumber() : message.diskSizeGb; - if (options.oneofs) - object._diskSizeGb = "diskSizeGb"; - } - if (message.savedState != null && message.hasOwnProperty("savedState")) { - object.savedState = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] === undefined ? message.savedState : $root.google.cloud.backupdr.v1.AttachedDisk.DiskSavedState[message.savedState] : message.savedState; - if (options.oneofs) - object._savedState = "savedState"; - } - if (message.diskType != null && message.hasOwnProperty("diskType")) { - object.diskType = message.diskType; - if (options.oneofs) - object._diskType = "diskType"; - } - if (message.type != null && message.hasOwnProperty("type")) { - object.type = options.enums === String ? $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.AttachedDisk.DiskType[message.type] : message.type; - if (options.oneofs) - object._type = "type"; - } - return object; - }; - - /** - * Converts this AttachedDisk to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @instance - * @returns {Object.} JSON object - */ - AttachedDisk.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for AttachedDisk - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - AttachedDisk.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk"; - }; - - AttachedDisk.InitializeParams = (function() { - - /** - * Properties of an InitializeParams. - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @interface IInitializeParams - * @property {string|null} [diskName] InitializeParams diskName - * @property {Array.|null} [replicaZones] InitializeParams replicaZones - */ - - /** - * Constructs a new InitializeParams. - * @memberof google.cloud.backupdr.v1.AttachedDisk - * @classdesc Represents an InitializeParams. - * @implements IInitializeParams - * @constructor - * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set - */ - function InitializeParams(properties) { - this.replicaZones = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * InitializeParams diskName. - * @member {string|null|undefined} diskName - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @instance - */ - InitializeParams.prototype.diskName = null; - - /** - * InitializeParams replicaZones. - * @member {Array.} replicaZones - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @instance - */ - InitializeParams.prototype.replicaZones = $util.emptyArray; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(InitializeParams.prototype, "_diskName", { - get: $util.oneOfGetter($oneOfFields = ["diskName"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new InitializeParams instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams instance - */ - InitializeParams.create = function create(properties) { - return new InitializeParams(properties); - }; - - /** - * Encodes the specified InitializeParams message. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InitializeParams.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.diskName != null && Object.hasOwnProperty.call(message, "diskName")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.diskName); - if (message.replicaZones != null && message.replicaZones.length) - for (var i = 0; i < message.replicaZones.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.replicaZones[i]); - return writer; - }; - - /** - * Encodes the specified InitializeParams message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.AttachedDisk.InitializeParams.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {google.cloud.backupdr.v1.AttachedDisk.IInitializeParams} message InitializeParams message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - InitializeParams.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an InitializeParams message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InitializeParams.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.diskName = reader.string(); - break; - } - case 2: { - if (!(message.replicaZones && message.replicaZones.length)) - message.replicaZones = []; - message.replicaZones.push(reader.string()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an InitializeParams message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - InitializeParams.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an InitializeParams message. - * @function verify - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - InitializeParams.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.diskName != null && message.hasOwnProperty("diskName")) { - properties._diskName = 1; - if (!$util.isString(message.diskName)) - return "diskName: string expected"; - } - if (message.replicaZones != null && message.hasOwnProperty("replicaZones")) { - if (!Array.isArray(message.replicaZones)) - return "replicaZones: array expected"; - for (var i = 0; i < message.replicaZones.length; ++i) - if (!$util.isString(message.replicaZones[i])) - return "replicaZones: string[] expected"; - } - return null; - }; - - /** - * Creates an InitializeParams message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} InitializeParams - */ - InitializeParams.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams) - return object; - var message = new $root.google.cloud.backupdr.v1.AttachedDisk.InitializeParams(); - if (object.diskName != null) - message.diskName = String(object.diskName); - if (object.replicaZones) { - if (!Array.isArray(object.replicaZones)) - throw TypeError(".google.cloud.backupdr.v1.AttachedDisk.InitializeParams.replicaZones: array expected"); - message.replicaZones = []; - for (var i = 0; i < object.replicaZones.length; ++i) - message.replicaZones[i] = String(object.replicaZones[i]); - } - return message; - }; - - /** - * Creates a plain object from an InitializeParams message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {google.cloud.backupdr.v1.AttachedDisk.InitializeParams} message InitializeParams - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - InitializeParams.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.replicaZones = []; - if (message.diskName != null && message.hasOwnProperty("diskName")) { - object.diskName = message.diskName; - if (options.oneofs) - object._diskName = "diskName"; - } - if (message.replicaZones && message.replicaZones.length) { - object.replicaZones = []; - for (var j = 0; j < message.replicaZones.length; ++j) - object.replicaZones[j] = message.replicaZones[j]; - } - return object; - }; - - /** - * Converts this InitializeParams to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @instance - * @returns {Object.} JSON object - */ - InitializeParams.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for InitializeParams - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.AttachedDisk.InitializeParams - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - InitializeParams.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.AttachedDisk.InitializeParams"; - }; - - return InitializeParams; - })(); - - /** - * DiskType enum. - * @name google.cloud.backupdr.v1.AttachedDisk.DiskType - * @enum {number} - * @property {number} DISK_TYPE_UNSPECIFIED=0 DISK_TYPE_UNSPECIFIED value - * @property {number} SCRATCH=1 SCRATCH value - * @property {number} PERSISTENT=2 PERSISTENT value - */ - AttachedDisk.DiskType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISK_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCRATCH"] = 1; - values[valuesById[2] = "PERSISTENT"] = 2; - return values; - })(); - - /** - * DiskMode enum. - * @name google.cloud.backupdr.v1.AttachedDisk.DiskMode - * @enum {number} - * @property {number} DISK_MODE_UNSPECIFIED=0 DISK_MODE_UNSPECIFIED value - * @property {number} READ_WRITE=1 READ_WRITE value - * @property {number} READ_ONLY=2 READ_ONLY value - * @property {number} LOCKED=3 LOCKED value - */ - AttachedDisk.DiskMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISK_MODE_UNSPECIFIED"] = 0; - values[valuesById[1] = "READ_WRITE"] = 1; - values[valuesById[2] = "READ_ONLY"] = 2; - values[valuesById[3] = "LOCKED"] = 3; - return values; - })(); - - /** - * DiskInterface enum. - * @name google.cloud.backupdr.v1.AttachedDisk.DiskInterface - * @enum {number} - * @property {number} DISK_INTERFACE_UNSPECIFIED=0 DISK_INTERFACE_UNSPECIFIED value - * @property {number} SCSI=1 SCSI value - * @property {number} NVME=2 NVME value - * @property {number} NVDIMM=3 NVDIMM value - * @property {number} ISCSI=4 ISCSI value - */ - AttachedDisk.DiskInterface = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISK_INTERFACE_UNSPECIFIED"] = 0; - values[valuesById[1] = "SCSI"] = 1; - values[valuesById[2] = "NVME"] = 2; - values[valuesById[3] = "NVDIMM"] = 3; - values[valuesById[4] = "ISCSI"] = 4; - return values; - })(); - - /** - * DiskSavedState enum. - * @name google.cloud.backupdr.v1.AttachedDisk.DiskSavedState - * @enum {number} - * @property {number} DISK_SAVED_STATE_UNSPECIFIED=0 DISK_SAVED_STATE_UNSPECIFIED value - * @property {number} PRESERVED=1 PRESERVED value - */ - AttachedDisk.DiskSavedState = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DISK_SAVED_STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "PRESERVED"] = 1; - return values; - })(); - - return AttachedDisk; - })(); - - v1.GuestOsFeature = (function() { - - /** - * Properties of a GuestOsFeature. - * @memberof google.cloud.backupdr.v1 - * @interface IGuestOsFeature - * @property {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null} [type] GuestOsFeature type - */ - - /** - * Constructs a new GuestOsFeature. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GuestOsFeature. - * @implements IGuestOsFeature - * @constructor - * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set - */ - function GuestOsFeature(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GuestOsFeature type. - * @member {google.cloud.backupdr.v1.GuestOsFeature.FeatureType|null|undefined} type - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @instance - */ - GuestOsFeature.prototype.type = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(GuestOsFeature.prototype, "_type", { - get: $util.oneOfGetter($oneOfFields = ["type"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new GuestOsFeature instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {google.cloud.backupdr.v1.IGuestOsFeature=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature instance - */ - GuestOsFeature.create = function create(properties) { - return new GuestOsFeature(properties); - }; - - /** - * Encodes the specified GuestOsFeature message. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GuestOsFeature.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - return writer; - }; - - /** - * Encodes the specified GuestOsFeature message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GuestOsFeature.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {google.cloud.backupdr.v1.IGuestOsFeature} message GuestOsFeature message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GuestOsFeature.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GuestOsFeature message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GuestOsFeature.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GuestOsFeature message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GuestOsFeature.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GuestOsFeature message. - * @function verify - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GuestOsFeature.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.type != null && message.hasOwnProperty("type")) { - properties._type = 1; - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - break; - } - } - return null; - }; - - /** - * Creates a GuestOsFeature message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GuestOsFeature} GuestOsFeature - */ - GuestOsFeature.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GuestOsFeature) - return object; - var message = new $root.google.cloud.backupdr.v1.GuestOsFeature(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "FEATURE_TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "VIRTIO_SCSI_MULTIQUEUE": - case 1: - message.type = 1; - break; - case "WINDOWS": - case 2: - message.type = 2; - break; - case "MULTI_IP_SUBNET": - case 3: - message.type = 3; - break; - case "UEFI_COMPATIBLE": - case 4: - message.type = 4; - break; - case "SECURE_BOOT": - case 5: - message.type = 5; - break; - case "GVNIC": - case 6: - message.type = 6; - break; - case "SEV_CAPABLE": - case 7: - message.type = 7; - break; - case "BARE_METAL_LINUX_COMPATIBLE": - case 8: - message.type = 8; - break; - case "SUSPEND_RESUME_COMPATIBLE": - case 9: - message.type = 9; - break; - case "SEV_LIVE_MIGRATABLE": - case 10: - message.type = 10; - break; - case "SEV_SNP_CAPABLE": - case 11: - message.type = 11; - break; - case "TDX_CAPABLE": - case 12: - message.type = 12; - break; - case "IDPF": - case 13: - message.type = 13; - break; - case "SEV_LIVE_MIGRATABLE_V2": - case 14: - message.type = 14; - break; - } - return message; - }; - - /** - * Creates a plain object from a GuestOsFeature message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {google.cloud.backupdr.v1.GuestOsFeature} message GuestOsFeature - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GuestOsFeature.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (message.type != null && message.hasOwnProperty("type")) { - object.type = options.enums === String ? $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.GuestOsFeature.FeatureType[message.type] : message.type; - if (options.oneofs) - object._type = "type"; - } - return object; - }; - - /** - * Converts this GuestOsFeature to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @instance - * @returns {Object.} JSON object - */ - GuestOsFeature.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GuestOsFeature - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GuestOsFeature - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GuestOsFeature.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GuestOsFeature"; - }; - - /** - * FeatureType enum. - * @name google.cloud.backupdr.v1.GuestOsFeature.FeatureType - * @enum {number} - * @property {number} FEATURE_TYPE_UNSPECIFIED=0 FEATURE_TYPE_UNSPECIFIED value - * @property {number} VIRTIO_SCSI_MULTIQUEUE=1 VIRTIO_SCSI_MULTIQUEUE value - * @property {number} WINDOWS=2 WINDOWS value - * @property {number} MULTI_IP_SUBNET=3 MULTI_IP_SUBNET value - * @property {number} UEFI_COMPATIBLE=4 UEFI_COMPATIBLE value - * @property {number} SECURE_BOOT=5 SECURE_BOOT value - * @property {number} GVNIC=6 GVNIC value - * @property {number} SEV_CAPABLE=7 SEV_CAPABLE value - * @property {number} BARE_METAL_LINUX_COMPATIBLE=8 BARE_METAL_LINUX_COMPATIBLE value - * @property {number} SUSPEND_RESUME_COMPATIBLE=9 SUSPEND_RESUME_COMPATIBLE value - * @property {number} SEV_LIVE_MIGRATABLE=10 SEV_LIVE_MIGRATABLE value - * @property {number} SEV_SNP_CAPABLE=11 SEV_SNP_CAPABLE value - * @property {number} TDX_CAPABLE=12 TDX_CAPABLE value - * @property {number} IDPF=13 IDPF value - * @property {number} SEV_LIVE_MIGRATABLE_V2=14 SEV_LIVE_MIGRATABLE_V2 value - */ - GuestOsFeature.FeatureType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FEATURE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "VIRTIO_SCSI_MULTIQUEUE"] = 1; - values[valuesById[2] = "WINDOWS"] = 2; - values[valuesById[3] = "MULTI_IP_SUBNET"] = 3; - values[valuesById[4] = "UEFI_COMPATIBLE"] = 4; - values[valuesById[5] = "SECURE_BOOT"] = 5; - values[valuesById[6] = "GVNIC"] = 6; - values[valuesById[7] = "SEV_CAPABLE"] = 7; - values[valuesById[8] = "BARE_METAL_LINUX_COMPATIBLE"] = 8; - values[valuesById[9] = "SUSPEND_RESUME_COMPATIBLE"] = 9; - values[valuesById[10] = "SEV_LIVE_MIGRATABLE"] = 10; - values[valuesById[11] = "SEV_SNP_CAPABLE"] = 11; - values[valuesById[12] = "TDX_CAPABLE"] = 12; - values[valuesById[13] = "IDPF"] = 13; - values[valuesById[14] = "SEV_LIVE_MIGRATABLE_V2"] = 14; - return values; - })(); - - return GuestOsFeature; - })(); - - /** - * KeyRevocationActionType enum. - * @name google.cloud.backupdr.v1.KeyRevocationActionType - * @enum {number} - * @property {number} KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED=0 KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED value - * @property {number} NONE=1 NONE value - * @property {number} STOP=2 STOP value - */ - v1.KeyRevocationActionType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "NONE"] = 1; - values[valuesById[2] = "STOP"] = 2; - return values; - })(); - - v1.DataSourceReference = (function() { - - /** - * Properties of a DataSourceReference. - * @memberof google.cloud.backupdr.v1 - * @interface IDataSourceReference - * @property {string|null} [name] DataSourceReference name - * @property {string|null} [dataSource] DataSourceReference dataSource - * @property {google.protobuf.ITimestamp|null} [createTime] DataSourceReference createTime - * @property {google.cloud.backupdr.v1.BackupConfigState|null} [dataSourceBackupConfigState] DataSourceReference dataSourceBackupConfigState - * @property {number|Long|null} [dataSourceBackupCount] DataSourceReference dataSourceBackupCount - * @property {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null} [dataSourceBackupConfigInfo] DataSourceReference dataSourceBackupConfigInfo - * @property {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null} [dataSourceGcpResourceInfo] DataSourceReference dataSourceGcpResourceInfo - * @property {number|Long|null} [totalStoredBytes] DataSourceReference totalStoredBytes - */ - - /** - * Constructs a new DataSourceReference. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DataSourceReference. - * @implements IDataSourceReference - * @constructor - * @param {google.cloud.backupdr.v1.IDataSourceReference=} [properties] Properties to set - */ - function DataSourceReference(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataSourceReference name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.name = ""; - - /** - * DataSourceReference dataSource. - * @member {string} dataSource - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.dataSource = ""; - - /** - * DataSourceReference createTime. - * @member {google.protobuf.ITimestamp|null|undefined} createTime - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.createTime = null; - - /** - * DataSourceReference dataSourceBackupConfigState. - * @member {google.cloud.backupdr.v1.BackupConfigState} dataSourceBackupConfigState - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.dataSourceBackupConfigState = 0; - - /** - * DataSourceReference dataSourceBackupCount. - * @member {number|Long} dataSourceBackupCount - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.dataSourceBackupCount = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * DataSourceReference dataSourceBackupConfigInfo. - * @member {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo|null|undefined} dataSourceBackupConfigInfo - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.dataSourceBackupConfigInfo = null; - - /** - * DataSourceReference dataSourceGcpResourceInfo. - * @member {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo|null|undefined} dataSourceGcpResourceInfo - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.dataSourceGcpResourceInfo = null; - - /** - * DataSourceReference totalStoredBytes. - * @member {number|Long|null|undefined} totalStoredBytes - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - */ - DataSourceReference.prototype.totalStoredBytes = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - // Virtual OneOf for proto3 optional field - Object.defineProperty(DataSourceReference.prototype, "_totalStoredBytes", { - get: $util.oneOfGetter($oneOfFields = ["totalStoredBytes"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DataSourceReference instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {google.cloud.backupdr.v1.IDataSourceReference=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference instance - */ - DataSourceReference.create = function create(properties) { - return new DataSourceReference(properties); - }; - - /** - * Encodes the specified DataSourceReference message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {google.cloud.backupdr.v1.IDataSourceReference} message DataSourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceReference.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.dataSource != null && Object.hasOwnProperty.call(message, "dataSource")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.dataSource); - 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.dataSourceBackupConfigState != null && Object.hasOwnProperty.call(message, "dataSourceBackupConfigState")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.dataSourceBackupConfigState); - if (message.dataSourceBackupCount != null && Object.hasOwnProperty.call(message, "dataSourceBackupCount")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.dataSourceBackupCount); - if (message.dataSourceBackupConfigInfo != null && Object.hasOwnProperty.call(message, "dataSourceBackupConfigInfo")) - $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.encode(message.dataSourceBackupConfigInfo, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.dataSourceGcpResourceInfo != null && Object.hasOwnProperty.call(message, "dataSourceGcpResourceInfo")) - $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.encode(message.dataSourceGcpResourceInfo, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.totalStoredBytes != null && Object.hasOwnProperty.call(message, "totalStoredBytes")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.totalStoredBytes); - return writer; - }; - - /** - * Encodes the specified DataSourceReference message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceReference.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {google.cloud.backupdr.v1.IDataSourceReference} message DataSourceReference message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceReference.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataSourceReference message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceReference.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceReference(); - 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.dataSource = reader.string(); - break; - } - case 3: { - message.createTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 4: { - message.dataSourceBackupConfigState = reader.int32(); - break; - } - case 5: { - message.dataSourceBackupCount = reader.int64(); - break; - } - case 6: { - message.dataSourceBackupConfigInfo = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.decode(reader, reader.uint32()); - break; - } - case 7: { - message.dataSourceGcpResourceInfo = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.decode(reader, reader.uint32()); - break; - } - case 8: { - message.totalStoredBytes = reader.int64(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataSourceReference message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceReference.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataSourceReference message. - * @function verify - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataSourceReference.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.dataSource != null && message.hasOwnProperty("dataSource")) - if (!$util.isString(message.dataSource)) - return "dataSource: 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.dataSourceBackupConfigState != null && message.hasOwnProperty("dataSourceBackupConfigState")) - switch (message.dataSourceBackupConfigState) { - default: - return "dataSourceBackupConfigState: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.dataSourceBackupCount != null && message.hasOwnProperty("dataSourceBackupCount")) - if (!$util.isInteger(message.dataSourceBackupCount) && !(message.dataSourceBackupCount && $util.isInteger(message.dataSourceBackupCount.low) && $util.isInteger(message.dataSourceBackupCount.high))) - return "dataSourceBackupCount: integer|Long expected"; - if (message.dataSourceBackupConfigInfo != null && message.hasOwnProperty("dataSourceBackupConfigInfo")) { - var error = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify(message.dataSourceBackupConfigInfo); - if (error) - return "dataSourceBackupConfigInfo." + error; - } - if (message.dataSourceGcpResourceInfo != null && message.hasOwnProperty("dataSourceGcpResourceInfo")) { - var error = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify(message.dataSourceGcpResourceInfo); - if (error) - return "dataSourceGcpResourceInfo." + error; - } - if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { - properties._totalStoredBytes = 1; - if (!$util.isInteger(message.totalStoredBytes) && !(message.totalStoredBytes && $util.isInteger(message.totalStoredBytes.low) && $util.isInteger(message.totalStoredBytes.high))) - return "totalStoredBytes: integer|Long expected"; - } - return null; - }; - - /** - * Creates a DataSourceReference message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DataSourceReference} DataSourceReference - */ - DataSourceReference.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DataSourceReference) - return object; - var message = new $root.google.cloud.backupdr.v1.DataSourceReference(); - if (object.name != null) - message.name = String(object.name); - if (object.dataSource != null) - message.dataSource = String(object.dataSource); - if (object.createTime != null) { - if (typeof object.createTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceReference.createTime: object expected"); - message.createTime = $root.google.protobuf.Timestamp.fromObject(object.createTime); - } - switch (object.dataSourceBackupConfigState) { - default: - if (typeof object.dataSourceBackupConfigState === "number") { - message.dataSourceBackupConfigState = object.dataSourceBackupConfigState; - break; - } - break; - case "BACKUP_CONFIG_STATE_UNSPECIFIED": - case 0: - message.dataSourceBackupConfigState = 0; - break; - case "ACTIVE": - case 1: - message.dataSourceBackupConfigState = 1; - break; - case "PASSIVE": - case 2: - message.dataSourceBackupConfigState = 2; - break; - } - if (object.dataSourceBackupCount != null) - if ($util.Long) - (message.dataSourceBackupCount = $util.Long.fromValue(object.dataSourceBackupCount)).unsigned = false; - else if (typeof object.dataSourceBackupCount === "string") - message.dataSourceBackupCount = parseInt(object.dataSourceBackupCount, 10); - else if (typeof object.dataSourceBackupCount === "number") - message.dataSourceBackupCount = object.dataSourceBackupCount; - else if (typeof object.dataSourceBackupCount === "object") - message.dataSourceBackupCount = new $util.LongBits(object.dataSourceBackupCount.low >>> 0, object.dataSourceBackupCount.high >>> 0).toNumber(); - if (object.dataSourceBackupConfigInfo != null) { - if (typeof object.dataSourceBackupConfigInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceReference.dataSourceBackupConfigInfo: object expected"); - message.dataSourceBackupConfigInfo = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.fromObject(object.dataSourceBackupConfigInfo); - } - if (object.dataSourceGcpResourceInfo != null) { - if (typeof object.dataSourceGcpResourceInfo !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceReference.dataSourceGcpResourceInfo: object expected"); - message.dataSourceGcpResourceInfo = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.fromObject(object.dataSourceGcpResourceInfo); - } - if (object.totalStoredBytes != null) - if ($util.Long) - (message.totalStoredBytes = $util.Long.fromValue(object.totalStoredBytes)).unsigned = false; - else if (typeof object.totalStoredBytes === "string") - message.totalStoredBytes = parseInt(object.totalStoredBytes, 10); - else if (typeof object.totalStoredBytes === "number") - message.totalStoredBytes = object.totalStoredBytes; - else if (typeof object.totalStoredBytes === "object") - message.totalStoredBytes = new $util.LongBits(object.totalStoredBytes.low >>> 0, object.totalStoredBytes.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a DataSourceReference message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {google.cloud.backupdr.v1.DataSourceReference} message DataSourceReference - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataSourceReference.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.dataSource = ""; - object.createTime = null; - object.dataSourceBackupConfigState = options.enums === String ? "BACKUP_CONFIG_STATE_UNSPECIFIED" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.dataSourceBackupCount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.dataSourceBackupCount = options.longs === String ? "0" : 0; - object.dataSourceBackupConfigInfo = null; - object.dataSourceGcpResourceInfo = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.dataSource != null && message.hasOwnProperty("dataSource")) - object.dataSource = message.dataSource; - if (message.createTime != null && message.hasOwnProperty("createTime")) - object.createTime = $root.google.protobuf.Timestamp.toObject(message.createTime, options); - if (message.dataSourceBackupConfigState != null && message.hasOwnProperty("dataSourceBackupConfigState")) - object.dataSourceBackupConfigState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigState[message.dataSourceBackupConfigState] === undefined ? message.dataSourceBackupConfigState : $root.google.cloud.backupdr.v1.BackupConfigState[message.dataSourceBackupConfigState] : message.dataSourceBackupConfigState; - if (message.dataSourceBackupCount != null && message.hasOwnProperty("dataSourceBackupCount")) - if (typeof message.dataSourceBackupCount === "number") - object.dataSourceBackupCount = options.longs === String ? String(message.dataSourceBackupCount) : message.dataSourceBackupCount; - else - object.dataSourceBackupCount = options.longs === String ? $util.Long.prototype.toString.call(message.dataSourceBackupCount) : options.longs === Number ? new $util.LongBits(message.dataSourceBackupCount.low >>> 0, message.dataSourceBackupCount.high >>> 0).toNumber() : message.dataSourceBackupCount; - if (message.dataSourceBackupConfigInfo != null && message.hasOwnProperty("dataSourceBackupConfigInfo")) - object.dataSourceBackupConfigInfo = $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo.toObject(message.dataSourceBackupConfigInfo, options); - if (message.dataSourceGcpResourceInfo != null && message.hasOwnProperty("dataSourceGcpResourceInfo")) - object.dataSourceGcpResourceInfo = $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo.toObject(message.dataSourceGcpResourceInfo, options); - if (message.totalStoredBytes != null && message.hasOwnProperty("totalStoredBytes")) { - if (typeof message.totalStoredBytes === "number") - object.totalStoredBytes = options.longs === String ? String(message.totalStoredBytes) : message.totalStoredBytes; - else - object.totalStoredBytes = options.longs === String ? $util.Long.prototype.toString.call(message.totalStoredBytes) : options.longs === Number ? new $util.LongBits(message.totalStoredBytes.low >>> 0, message.totalStoredBytes.high >>> 0).toNumber() : message.totalStoredBytes; - if (options.oneofs) - object._totalStoredBytes = "totalStoredBytes"; - } - return object; - }; - - /** - * Converts this DataSourceReference to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @instance - * @returns {Object.} JSON object - */ - DataSourceReference.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataSourceReference - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DataSourceReference - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataSourceReference.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceReference"; - }; - - return DataSourceReference; - })(); - - v1.DataSourceBackupConfigInfo = (function() { - - /** - * Properties of a DataSourceBackupConfigInfo. - * @memberof google.cloud.backupdr.v1 - * @interface IDataSourceBackupConfigInfo - * @property {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState|null} [lastBackupState] DataSourceBackupConfigInfo lastBackupState - * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupConsistencyTime] DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime - */ - - /** - * Constructs a new DataSourceBackupConfigInfo. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DataSourceBackupConfigInfo. - * @implements IDataSourceBackupConfigInfo - * @constructor - * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo=} [properties] Properties to set - */ - function DataSourceBackupConfigInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataSourceBackupConfigInfo lastBackupState. - * @member {google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState} lastBackupState - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @instance - */ - DataSourceBackupConfigInfo.prototype.lastBackupState = 0; - - /** - * DataSourceBackupConfigInfo lastSuccessfulBackupConsistencyTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupConsistencyTime - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @instance - */ - DataSourceBackupConfigInfo.prototype.lastSuccessfulBackupConsistencyTime = null; - - /** - * Creates a new DataSourceBackupConfigInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo instance - */ - DataSourceBackupConfigInfo.create = function create(properties) { - return new DataSourceBackupConfigInfo(properties); - }; - - /** - * Encodes the specified DataSourceBackupConfigInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo} message DataSourceBackupConfigInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceBackupConfigInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.lastBackupState != null && Object.hasOwnProperty.call(message, "lastBackupState")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.lastBackupState); - if (message.lastSuccessfulBackupConsistencyTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupConsistencyTime")) - $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupConsistencyTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataSourceBackupConfigInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceBackupConfigInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.IDataSourceBackupConfigInfo} message DataSourceBackupConfigInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceBackupConfigInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceBackupConfigInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.lastBackupState = reader.int32(); - break; - } - case 2: { - message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataSourceBackupConfigInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceBackupConfigInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataSourceBackupConfigInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataSourceBackupConfigInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) - switch (message.lastBackupState) { - default: - return "lastBackupState: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupConsistencyTime); - if (error) - return "lastSuccessfulBackupConsistencyTime." + error; - } - return null; - }; - - /** - * Creates a DataSourceBackupConfigInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} DataSourceBackupConfigInfo - */ - DataSourceBackupConfigInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.DataSourceBackupConfigInfo(); - switch (object.lastBackupState) { - default: - if (typeof object.lastBackupState === "number") { - message.lastBackupState = object.lastBackupState; - break; - } - break; - case "LAST_BACKUP_STATE_UNSPECIFIED": - case 0: - message.lastBackupState = 0; - break; - case "FIRST_BACKUP_PENDING": - case 1: - message.lastBackupState = 1; - break; - case "SUCCEEDED": - case 2: - message.lastBackupState = 2; - break; - case "FAILED": - case 3: - message.lastBackupState = 3; - break; - case "PERMISSION_DENIED": - case 4: - message.lastBackupState = 4; - break; - } - if (object.lastSuccessfulBackupConsistencyTime != null) { - if (typeof object.lastSuccessfulBackupConsistencyTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceBackupConfigInfo.lastSuccessfulBackupConsistencyTime: object expected"); - message.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupConsistencyTime); - } - return message; - }; - - /** - * Creates a plain object from a DataSourceBackupConfigInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {google.cloud.backupdr.v1.DataSourceBackupConfigInfo} message DataSourceBackupConfigInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataSourceBackupConfigInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.lastBackupState = options.enums === String ? "LAST_BACKUP_STATE_UNSPECIFIED" : 0; - object.lastSuccessfulBackupConsistencyTime = null; - } - if (message.lastBackupState != null && message.hasOwnProperty("lastBackupState")) - object.lastBackupState = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] === undefined ? message.lastBackupState : $root.google.cloud.backupdr.v1.BackupConfigInfo.LastBackupState[message.lastBackupState] : message.lastBackupState; - if (message.lastSuccessfulBackupConsistencyTime != null && message.hasOwnProperty("lastSuccessfulBackupConsistencyTime")) - object.lastSuccessfulBackupConsistencyTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupConsistencyTime, options); - return object; - }; - - /** - * Converts this DataSourceBackupConfigInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @instance - * @returns {Object.} JSON object - */ - DataSourceBackupConfigInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataSourceBackupConfigInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DataSourceBackupConfigInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataSourceBackupConfigInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceBackupConfigInfo"; - }; - - return DataSourceBackupConfigInfo; - })(); - - v1.DataSourceGcpResourceInfo = (function() { - - /** - * Properties of a DataSourceGcpResourceInfo. - * @memberof google.cloud.backupdr.v1 - * @interface IDataSourceGcpResourceInfo - * @property {string|null} [gcpResourcename] DataSourceGcpResourceInfo gcpResourcename - * @property {string|null} [type] DataSourceGcpResourceInfo type - * @property {string|null} [location] DataSourceGcpResourceInfo location - * @property {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null} [cloudSqlInstanceProperties] DataSourceGcpResourceInfo cloudSqlInstanceProperties - */ - - /** - * Constructs a new DataSourceGcpResourceInfo. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a DataSourceGcpResourceInfo. - * @implements IDataSourceGcpResourceInfo - * @constructor - * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo=} [properties] Properties to set - */ - function DataSourceGcpResourceInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * DataSourceGcpResourceInfo gcpResourcename. - * @member {string} gcpResourcename - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @instance - */ - DataSourceGcpResourceInfo.prototype.gcpResourcename = ""; - - /** - * DataSourceGcpResourceInfo type. - * @member {string} type - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @instance - */ - DataSourceGcpResourceInfo.prototype.type = ""; - - /** - * DataSourceGcpResourceInfo location. - * @member {string} location - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @instance - */ - DataSourceGcpResourceInfo.prototype.location = ""; - - /** - * DataSourceGcpResourceInfo cloudSqlInstanceProperties. - * @member {google.cloud.backupdr.v1.ICloudSqlInstanceDataSourceReferenceProperties|null|undefined} cloudSqlInstanceProperties - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @instance - */ - DataSourceGcpResourceInfo.prototype.cloudSqlInstanceProperties = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * DataSourceGcpResourceInfo resourceProperties. - * @member {"cloudSqlInstanceProperties"|undefined} resourceProperties - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @instance - */ - Object.defineProperty(DataSourceGcpResourceInfo.prototype, "resourceProperties", { - get: $util.oneOfGetter($oneOfFields = ["cloudSqlInstanceProperties"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new DataSourceGcpResourceInfo instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo instance - */ - DataSourceGcpResourceInfo.create = function create(properties) { - return new DataSourceGcpResourceInfo(properties); - }; - - /** - * Encodes the specified DataSourceGcpResourceInfo message. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo} message DataSourceGcpResourceInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceGcpResourceInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.gcpResourcename != null && Object.hasOwnProperty.call(message, "gcpResourcename")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.gcpResourcename); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.type); - if (message.location != null && Object.hasOwnProperty.call(message, "location")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.location); - if (message.cloudSqlInstanceProperties != null && Object.hasOwnProperty.call(message, "cloudSqlInstanceProperties")) - $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.encode(message.cloudSqlInstanceProperties, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified DataSourceGcpResourceInfo message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.DataSourceGcpResourceInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {google.cloud.backupdr.v1.IDataSourceGcpResourceInfo} message DataSourceGcpResourceInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DataSourceGcpResourceInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceGcpResourceInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.gcpResourcename = reader.string(); - break; - } - case 2: { - message.type = reader.string(); - break; - } - case 3: { - message.location = reader.string(); - break; - } - case 4: { - message.cloudSqlInstanceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DataSourceGcpResourceInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DataSourceGcpResourceInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DataSourceGcpResourceInfo message. - * @function verify - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DataSourceGcpResourceInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - if (!$util.isString(message.gcpResourcename)) - return "gcpResourcename: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - if (!$util.isString(message.type)) - return "type: string expected"; - if (message.location != null && message.hasOwnProperty("location")) - if (!$util.isString(message.location)) - return "location: string expected"; - if (message.cloudSqlInstanceProperties != null && message.hasOwnProperty("cloudSqlInstanceProperties")) { - properties.resourceProperties = 1; - { - var error = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.verify(message.cloudSqlInstanceProperties); - if (error) - return "cloudSqlInstanceProperties." + error; - } - } - return null; - }; - - /** - * Creates a DataSourceGcpResourceInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} DataSourceGcpResourceInfo - */ - DataSourceGcpResourceInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo) - return object; - var message = new $root.google.cloud.backupdr.v1.DataSourceGcpResourceInfo(); - if (object.gcpResourcename != null) - message.gcpResourcename = String(object.gcpResourcename); - if (object.type != null) - message.type = String(object.type); - if (object.location != null) - message.location = String(object.location); - if (object.cloudSqlInstanceProperties != null) { - if (typeof object.cloudSqlInstanceProperties !== "object") - throw TypeError(".google.cloud.backupdr.v1.DataSourceGcpResourceInfo.cloudSqlInstanceProperties: object expected"); - message.cloudSqlInstanceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.fromObject(object.cloudSqlInstanceProperties); - } - return message; - }; - - /** - * Creates a plain object from a DataSourceGcpResourceInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {google.cloud.backupdr.v1.DataSourceGcpResourceInfo} message DataSourceGcpResourceInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DataSourceGcpResourceInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.gcpResourcename = ""; - object.type = ""; - object.location = ""; - } - if (message.gcpResourcename != null && message.hasOwnProperty("gcpResourcename")) - object.gcpResourcename = message.gcpResourcename; - if (message.type != null && message.hasOwnProperty("type")) - object.type = message.type; - if (message.location != null && message.hasOwnProperty("location")) - object.location = message.location; - if (message.cloudSqlInstanceProperties != null && message.hasOwnProperty("cloudSqlInstanceProperties")) { - object.cloudSqlInstanceProperties = $root.google.cloud.backupdr.v1.CloudSqlInstanceDataSourceReferenceProperties.toObject(message.cloudSqlInstanceProperties, options); - if (options.oneofs) - object.resourceProperties = "cloudSqlInstanceProperties"; - } - return object; - }; - - /** - * Converts this DataSourceGcpResourceInfo to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @instance - * @returns {Object.} JSON object - */ - DataSourceGcpResourceInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for DataSourceGcpResourceInfo - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.DataSourceGcpResourceInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - DataSourceGcpResourceInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.DataSourceGcpResourceInfo"; - }; - - return DataSourceGcpResourceInfo; - })(); - - v1.GetDataSourceReferenceRequest = (function() { - - /** - * Properties of a GetDataSourceReferenceRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IGetDataSourceReferenceRequest - * @property {string|null} [name] GetDataSourceReferenceRequest name - */ - - /** - * Constructs a new GetDataSourceReferenceRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a GetDataSourceReferenceRequest. - * @implements IGetDataSourceReferenceRequest - * @constructor - * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest=} [properties] Properties to set - */ - function GetDataSourceReferenceRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * GetDataSourceReferenceRequest name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @instance - */ - GetDataSourceReferenceRequest.prototype.name = ""; - - /** - * Creates a new GetDataSourceReferenceRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest instance - */ - GetDataSourceReferenceRequest.create = function create(properties) { - return new GetDataSourceReferenceRequest(properties); - }; - - /** - * Encodes the specified GetDataSourceReferenceRequest message. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} message GetDataSourceReferenceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataSourceReferenceRequest.encode = function encode(message, writer) { - 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 GetDataSourceReferenceRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.GetDataSourceReferenceRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {google.cloud.backupdr.v1.IGetDataSourceReferenceRequest} message GetDataSourceReferenceRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GetDataSourceReferenceRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GetDataSourceReferenceRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataSourceReferenceRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest(); - 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 GetDataSourceReferenceRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GetDataSourceReferenceRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GetDataSourceReferenceRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GetDataSourceReferenceRequest.verify = function verify(message) { - if (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 GetDataSourceReferenceRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} GetDataSourceReferenceRequest - */ - GetDataSourceReferenceRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.GetDataSourceReferenceRequest(); - if (object.name != null) - message.name = String(object.name); - return message; - }; - - /** - * Creates a plain object from a GetDataSourceReferenceRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {google.cloud.backupdr.v1.GetDataSourceReferenceRequest} message GetDataSourceReferenceRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GetDataSourceReferenceRequest.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 GetDataSourceReferenceRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @instance - * @returns {Object.} JSON object - */ - GetDataSourceReferenceRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for GetDataSourceReferenceRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.GetDataSourceReferenceRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - GetDataSourceReferenceRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.GetDataSourceReferenceRequest"; - }; - - return GetDataSourceReferenceRequest; - })(); - - v1.ListDataSourceReferencesRequest = (function() { - - /** - * Properties of a ListDataSourceReferencesRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListDataSourceReferencesRequest - * @property {string|null} [parent] ListDataSourceReferencesRequest parent - * @property {number|null} [pageSize] ListDataSourceReferencesRequest pageSize - * @property {string|null} [pageToken] ListDataSourceReferencesRequest pageToken - * @property {string|null} [filter] ListDataSourceReferencesRequest filter - * @property {string|null} [orderBy] ListDataSourceReferencesRequest orderBy - */ - - /** - * Constructs a new ListDataSourceReferencesRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListDataSourceReferencesRequest. - * @implements IListDataSourceReferencesRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest=} [properties] Properties to set - */ - function ListDataSourceReferencesRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListDataSourceReferencesRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @instance - */ - ListDataSourceReferencesRequest.prototype.parent = ""; - - /** - * ListDataSourceReferencesRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @instance - */ - ListDataSourceReferencesRequest.prototype.pageSize = 0; - - /** - * ListDataSourceReferencesRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @instance - */ - ListDataSourceReferencesRequest.prototype.pageToken = ""; - - /** - * ListDataSourceReferencesRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @instance - */ - ListDataSourceReferencesRequest.prototype.filter = ""; - - /** - * ListDataSourceReferencesRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @instance - */ - ListDataSourceReferencesRequest.prototype.orderBy = ""; - - /** - * Creates a new ListDataSourceReferencesRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest instance - */ - ListDataSourceReferencesRequest.create = function create(properties) { - return new ListDataSourceReferencesRequest(properties); - }; - - /** - * Encodes the specified ListDataSourceReferencesRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} message ListDataSourceReferencesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourceReferencesRequest.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 ListDataSourceReferencesRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesRequest} message ListDataSourceReferencesRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourceReferencesRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDataSourceReferencesRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourceReferencesRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest(); - 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 ListDataSourceReferencesRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourceReferencesRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDataSourceReferencesRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDataSourceReferencesRequest.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 ListDataSourceReferencesRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} ListDataSourceReferencesRequest - */ - ListDataSourceReferencesRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesRequest(); - 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 ListDataSourceReferencesRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {google.cloud.backupdr.v1.ListDataSourceReferencesRequest} message ListDataSourceReferencesRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDataSourceReferencesRequest.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 ListDataSourceReferencesRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @instance - * @returns {Object.} JSON object - */ - ListDataSourceReferencesRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDataSourceReferencesRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDataSourceReferencesRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourceReferencesRequest"; - }; - - return ListDataSourceReferencesRequest; - })(); - - v1.ListDataSourceReferencesResponse = (function() { - - /** - * Properties of a ListDataSourceReferencesResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListDataSourceReferencesResponse - * @property {Array.|null} [dataSourceReferences] ListDataSourceReferencesResponse dataSourceReferences - * @property {string|null} [nextPageToken] ListDataSourceReferencesResponse nextPageToken - * @property {Array.|null} [unreachable] ListDataSourceReferencesResponse unreachable - */ - - /** - * Constructs a new ListDataSourceReferencesResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListDataSourceReferencesResponse. - * @implements IListDataSourceReferencesResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse=} [properties] Properties to set - */ - function ListDataSourceReferencesResponse(properties) { - this.dataSourceReferences = []; - 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]]; - } - - /** - * ListDataSourceReferencesResponse dataSourceReferences. - * @member {Array.} dataSourceReferences - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @instance - */ - ListDataSourceReferencesResponse.prototype.dataSourceReferences = $util.emptyArray; - - /** - * ListDataSourceReferencesResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @instance - */ - ListDataSourceReferencesResponse.prototype.nextPageToken = ""; - - /** - * ListDataSourceReferencesResponse unreachable. - * @member {Array.} unreachable - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @instance - */ - ListDataSourceReferencesResponse.prototype.unreachable = $util.emptyArray; - - /** - * Creates a new ListDataSourceReferencesResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse instance - */ - ListDataSourceReferencesResponse.create = function create(properties) { - return new ListDataSourceReferencesResponse(properties); - }; - - /** - * Encodes the specified ListDataSourceReferencesResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse} message ListDataSourceReferencesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourceReferencesResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataSourceReferences != null && message.dataSourceReferences.length) - for (var i = 0; i < message.dataSourceReferences.length; ++i) - $root.google.cloud.backupdr.v1.DataSourceReference.encode(message.dataSourceReferences[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 ListDataSourceReferencesResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListDataSourceReferencesResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {google.cloud.backupdr.v1.IListDataSourceReferencesResponse} message ListDataSourceReferencesResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListDataSourceReferencesResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListDataSourceReferencesResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourceReferencesResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dataSourceReferences && message.dataSourceReferences.length)) - message.dataSourceReferences = []; - message.dataSourceReferences.push($root.google.cloud.backupdr.v1.DataSourceReference.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 ListDataSourceReferencesResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListDataSourceReferencesResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListDataSourceReferencesResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListDataSourceReferencesResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataSourceReferences != null && message.hasOwnProperty("dataSourceReferences")) { - if (!Array.isArray(message.dataSourceReferences)) - return "dataSourceReferences: array expected"; - for (var i = 0; i < message.dataSourceReferences.length; ++i) { - var error = $root.google.cloud.backupdr.v1.DataSourceReference.verify(message.dataSourceReferences[i]); - if (error) - return "dataSourceReferences." + 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 ListDataSourceReferencesResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} ListDataSourceReferencesResponse - */ - ListDataSourceReferencesResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListDataSourceReferencesResponse(); - if (object.dataSourceReferences) { - if (!Array.isArray(object.dataSourceReferences)) - throw TypeError(".google.cloud.backupdr.v1.ListDataSourceReferencesResponse.dataSourceReferences: array expected"); - message.dataSourceReferences = []; - for (var i = 0; i < object.dataSourceReferences.length; ++i) { - if (typeof object.dataSourceReferences[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListDataSourceReferencesResponse.dataSourceReferences: object expected"); - message.dataSourceReferences[i] = $root.google.cloud.backupdr.v1.DataSourceReference.fromObject(object.dataSourceReferences[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - if (object.unreachable) { - if (!Array.isArray(object.unreachable)) - throw TypeError(".google.cloud.backupdr.v1.ListDataSourceReferencesResponse.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 ListDataSourceReferencesResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {google.cloud.backupdr.v1.ListDataSourceReferencesResponse} message ListDataSourceReferencesResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListDataSourceReferencesResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dataSourceReferences = []; - object.unreachable = []; - } - if (options.defaults) - object.nextPageToken = ""; - if (message.dataSourceReferences && message.dataSourceReferences.length) { - object.dataSourceReferences = []; - for (var j = 0; j < message.dataSourceReferences.length; ++j) - object.dataSourceReferences[j] = $root.google.cloud.backupdr.v1.DataSourceReference.toObject(message.dataSourceReferences[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 ListDataSourceReferencesResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @instance - * @returns {Object.} JSON object - */ - ListDataSourceReferencesResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListDataSourceReferencesResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListDataSourceReferencesResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListDataSourceReferencesResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListDataSourceReferencesResponse"; - }; - - return ListDataSourceReferencesResponse; - })(); - - v1.FetchDataSourceReferencesForResourceTypeRequest = (function() { - - /** - * Properties of a FetchDataSourceReferencesForResourceTypeRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchDataSourceReferencesForResourceTypeRequest - * @property {string|null} [parent] FetchDataSourceReferencesForResourceTypeRequest parent - * @property {string|null} [resourceType] FetchDataSourceReferencesForResourceTypeRequest resourceType - * @property {number|null} [pageSize] FetchDataSourceReferencesForResourceTypeRequest pageSize - * @property {string|null} [pageToken] FetchDataSourceReferencesForResourceTypeRequest pageToken - * @property {string|null} [filter] FetchDataSourceReferencesForResourceTypeRequest filter - * @property {string|null} [orderBy] FetchDataSourceReferencesForResourceTypeRequest orderBy - */ - - /** - * Constructs a new FetchDataSourceReferencesForResourceTypeRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchDataSourceReferencesForResourceTypeRequest. - * @implements IFetchDataSourceReferencesForResourceTypeRequest - * @constructor - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest=} [properties] Properties to set - */ - function FetchDataSourceReferencesForResourceTypeRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchDataSourceReferencesForResourceTypeRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.parent = ""; - - /** - * FetchDataSourceReferencesForResourceTypeRequest resourceType. - * @member {string} resourceType - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.resourceType = ""; - - /** - * FetchDataSourceReferencesForResourceTypeRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.pageSize = 0; - - /** - * FetchDataSourceReferencesForResourceTypeRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.pageToken = ""; - - /** - * FetchDataSourceReferencesForResourceTypeRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.filter = ""; - - /** - * FetchDataSourceReferencesForResourceTypeRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.orderBy = ""; - - /** - * Creates a new FetchDataSourceReferencesForResourceTypeRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest instance - */ - FetchDataSourceReferencesForResourceTypeRequest.create = function create(properties) { - return new FetchDataSourceReferencesForResourceTypeRequest(properties); - }; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchDataSourceReferencesForResourceTypeRequest.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.resourceType != null && Object.hasOwnProperty.call(message, "resourceType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.resourceType); - if (message.pageSize != null && Object.hasOwnProperty.call(message, "pageSize")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.pageSize); - if (message.pageToken != null && Object.hasOwnProperty.call(message, "pageToken")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.pageToken); - if (message.filter != null && Object.hasOwnProperty.call(message, "filter")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.filter); - if (message.orderBy != null && Object.hasOwnProperty.call(message, "orderBy")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.orderBy); - return writer; - }; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest} message FetchDataSourceReferencesForResourceTypeRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchDataSourceReferencesForResourceTypeRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchDataSourceReferencesForResourceTypeRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest(); - 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.resourceType = reader.string(); - break; - } - case 3: { - message.pageSize = reader.int32(); - break; - } - case 4: { - message.pageToken = reader.string(); - break; - } - case 5: { - message.filter = reader.string(); - break; - } - case 6: { - message.orderBy = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchDataSourceReferencesForResourceTypeRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchDataSourceReferencesForResourceTypeRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchDataSourceReferencesForResourceTypeRequest.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.resourceType != null && message.hasOwnProperty("resourceType")) - if (!$util.isString(message.resourceType)) - return "resourceType: 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 FetchDataSourceReferencesForResourceTypeRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} FetchDataSourceReferencesForResourceTypeRequest - */ - FetchDataSourceReferencesForResourceTypeRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest(); - if (object.parent != null) - message.parent = String(object.parent); - if (object.resourceType != null) - message.resourceType = String(object.resourceType); - 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 FetchDataSourceReferencesForResourceTypeRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest} message FetchDataSourceReferencesForResourceTypeRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchDataSourceReferencesForResourceTypeRequest.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.parent = ""; - object.resourceType = ""; - object.pageSize = 0; - object.pageToken = ""; - object.filter = ""; - object.orderBy = ""; - } - if (message.parent != null && message.hasOwnProperty("parent")) - object.parent = message.parent; - if (message.resourceType != null && message.hasOwnProperty("resourceType")) - object.resourceType = message.resourceType; - 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 FetchDataSourceReferencesForResourceTypeRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @instance - * @returns {Object.} JSON object - */ - FetchDataSourceReferencesForResourceTypeRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchDataSourceReferencesForResourceTypeRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchDataSourceReferencesForResourceTypeRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest"; - }; - - return FetchDataSourceReferencesForResourceTypeRequest; - })(); - - v1.FetchDataSourceReferencesForResourceTypeResponse = (function() { - - /** - * Properties of a FetchDataSourceReferencesForResourceTypeResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IFetchDataSourceReferencesForResourceTypeResponse - * @property {Array.|null} [dataSourceReferences] FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences - * @property {string|null} [nextPageToken] FetchDataSourceReferencesForResourceTypeResponse nextPageToken - */ - - /** - * Constructs a new FetchDataSourceReferencesForResourceTypeResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a FetchDataSourceReferencesForResourceTypeResponse. - * @implements IFetchDataSourceReferencesForResourceTypeResponse - * @constructor - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse=} [properties] Properties to set - */ - function FetchDataSourceReferencesForResourceTypeResponse(properties) { - this.dataSourceReferences = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FetchDataSourceReferencesForResourceTypeResponse dataSourceReferences. - * @member {Array.} dataSourceReferences - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @instance - */ - FetchDataSourceReferencesForResourceTypeResponse.prototype.dataSourceReferences = $util.emptyArray; - - /** - * FetchDataSourceReferencesForResourceTypeResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @instance - */ - FetchDataSourceReferencesForResourceTypeResponse.prototype.nextPageToken = ""; - - /** - * Creates a new FetchDataSourceReferencesForResourceTypeResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse instance - */ - FetchDataSourceReferencesForResourceTypeResponse.create = function create(properties) { - return new FetchDataSourceReferencesForResourceTypeResponse(properties); - }; - - /** - * Encodes the specified FetchDataSourceReferencesForResourceTypeResponse message. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse} message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchDataSourceReferencesForResourceTypeResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dataSourceReferences != null && message.dataSourceReferences.length) - for (var i = 0; i < message.dataSourceReferences.length; ++i) - $root.google.cloud.backupdr.v1.DataSourceReference.encode(message.dataSourceReferences[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 FetchDataSourceReferencesForResourceTypeResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse} message FetchDataSourceReferencesForResourceTypeResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FetchDataSourceReferencesForResourceTypeResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchDataSourceReferencesForResourceTypeResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.dataSourceReferences && message.dataSourceReferences.length)) - message.dataSourceReferences = []; - message.dataSourceReferences.push($root.google.cloud.backupdr.v1.DataSourceReference.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FetchDataSourceReferencesForResourceTypeResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FetchDataSourceReferencesForResourceTypeResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FetchDataSourceReferencesForResourceTypeResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FetchDataSourceReferencesForResourceTypeResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dataSourceReferences != null && message.hasOwnProperty("dataSourceReferences")) { - if (!Array.isArray(message.dataSourceReferences)) - return "dataSourceReferences: array expected"; - for (var i = 0; i < message.dataSourceReferences.length; ++i) { - var error = $root.google.cloud.backupdr.v1.DataSourceReference.verify(message.dataSourceReferences[i]); - if (error) - return "dataSourceReferences." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a FetchDataSourceReferencesForResourceTypeResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} FetchDataSourceReferencesForResourceTypeResponse - */ - FetchDataSourceReferencesForResourceTypeResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse(); - if (object.dataSourceReferences) { - if (!Array.isArray(object.dataSourceReferences)) - throw TypeError(".google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.dataSourceReferences: array expected"); - message.dataSourceReferences = []; - for (var i = 0; i < object.dataSourceReferences.length; ++i) { - if (typeof object.dataSourceReferences[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse.dataSourceReferences: object expected"); - message.dataSourceReferences[i] = $root.google.cloud.backupdr.v1.DataSourceReference.fromObject(object.dataSourceReferences[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a FetchDataSourceReferencesForResourceTypeResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse} message FetchDataSourceReferencesForResourceTypeResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FetchDataSourceReferencesForResourceTypeResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.dataSourceReferences = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.dataSourceReferences && message.dataSourceReferences.length) { - object.dataSourceReferences = []; - for (var j = 0; j < message.dataSourceReferences.length; ++j) - object.dataSourceReferences[j] = $root.google.cloud.backupdr.v1.DataSourceReference.toObject(message.dataSourceReferences[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this FetchDataSourceReferencesForResourceTypeResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @instance - * @returns {Object.} JSON object - */ - FetchDataSourceReferencesForResourceTypeResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FetchDataSourceReferencesForResourceTypeResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FetchDataSourceReferencesForResourceTypeResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse"; - }; - - return FetchDataSourceReferencesForResourceTypeResponse; - })(); - - v1.BackupDrProtectionSummary = (function() { - - /** - * Constructs a new BackupDrProtectionSummary service. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupDrProtectionSummary - * @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 BackupDrProtectionSummary(rpcImpl, requestDelimited, responseDelimited) { - $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); - } - - (BackupDrProtectionSummary.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackupDrProtectionSummary; - - /** - * Creates new BackupDrProtectionSummary service using the specified rpc implementation. - * @function create - * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary - * @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 {BackupDrProtectionSummary} RPC service. Useful where requests and/or responses are streamed. - */ - BackupDrProtectionSummary.create = function create(rpcImpl, requestDelimited, responseDelimited) { - return new this(rpcImpl, requestDelimited, responseDelimited); - }; - - /** - * Callback as used by {@link google.cloud.backupdr.v1.BackupDrProtectionSummary|listResourceBackupConfigs}. - * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary - * @typedef ListResourceBackupConfigsCallback - * @type {function} - * @param {Error|null} error Error, if any - * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} [response] ListResourceBackupConfigsResponse - */ - - /** - * Calls ListResourceBackupConfigs. - * @function listResourceBackupConfigs - * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary - * @instance - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} request ListResourceBackupConfigsRequest message or plain object - * @param {google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceBackupConfigsResponse - * @returns {undefined} - * @variation 1 - */ - Object.defineProperty(BackupDrProtectionSummary.prototype.listResourceBackupConfigs = function listResourceBackupConfigs(request, callback) { - return this.rpcCall(listResourceBackupConfigs, $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest, $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse, request, callback); - }, "name", { value: "ListResourceBackupConfigs" }); - - /** - * Calls ListResourceBackupConfigs. - * @function listResourceBackupConfigs - * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary - * @instance - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} request ListResourceBackupConfigsRequest message or plain object - * @returns {Promise} Promise - * @variation 2 - */ - - return BackupDrProtectionSummary; - })(); - - v1.ListResourceBackupConfigsRequest = (function() { - - /** - * Properties of a ListResourceBackupConfigsRequest. - * @memberof google.cloud.backupdr.v1 - * @interface IListResourceBackupConfigsRequest - * @property {string|null} [parent] ListResourceBackupConfigsRequest parent - * @property {number|null} [pageSize] ListResourceBackupConfigsRequest pageSize - * @property {string|null} [pageToken] ListResourceBackupConfigsRequest pageToken - * @property {string|null} [filter] ListResourceBackupConfigsRequest filter - * @property {string|null} [orderBy] ListResourceBackupConfigsRequest orderBy - */ - - /** - * Constructs a new ListResourceBackupConfigsRequest. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListResourceBackupConfigsRequest. - * @implements IListResourceBackupConfigsRequest - * @constructor - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest=} [properties] Properties to set - */ - function ListResourceBackupConfigsRequest(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceBackupConfigsRequest parent. - * @member {string} parent - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @instance - */ - ListResourceBackupConfigsRequest.prototype.parent = ""; - - /** - * ListResourceBackupConfigsRequest pageSize. - * @member {number} pageSize - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @instance - */ - ListResourceBackupConfigsRequest.prototype.pageSize = 0; - - /** - * ListResourceBackupConfigsRequest pageToken. - * @member {string} pageToken - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @instance - */ - ListResourceBackupConfigsRequest.prototype.pageToken = ""; - - /** - * ListResourceBackupConfigsRequest filter. - * @member {string} filter - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @instance - */ - ListResourceBackupConfigsRequest.prototype.filter = ""; - - /** - * ListResourceBackupConfigsRequest orderBy. - * @member {string} orderBy - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @instance - */ - ListResourceBackupConfigsRequest.prototype.orderBy = ""; - - /** - * Creates a new ListResourceBackupConfigsRequest instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest instance - */ - ListResourceBackupConfigsRequest.create = function create(properties) { - return new ListResourceBackupConfigsRequest(properties); - }; - - /** - * Encodes the specified ListResourceBackupConfigsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceBackupConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceBackupConfigsRequest.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest(); - 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 ListResourceBackupConfigsRequest message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceBackupConfigsRequest.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceBackupConfigsRequest message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest - */ - ListResourceBackupConfigsRequest.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest) - return object; - var message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest(); - 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 ListResourceBackupConfigsRequest message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @instance - * @returns {Object.} JSON object - */ - ListResourceBackupConfigsRequest.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceBackupConfigsRequest - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceBackupConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListResourceBackupConfigsRequest"; - }; - - return ListResourceBackupConfigsRequest; - })(); - - v1.ListResourceBackupConfigsResponse = (function() { - - /** - * Properties of a ListResourceBackupConfigsResponse. - * @memberof google.cloud.backupdr.v1 - * @interface IListResourceBackupConfigsResponse - * @property {Array.|null} [resourceBackupConfigs] ListResourceBackupConfigsResponse resourceBackupConfigs - * @property {string|null} [nextPageToken] ListResourceBackupConfigsResponse nextPageToken - */ - - /** - * Constructs a new ListResourceBackupConfigsResponse. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ListResourceBackupConfigsResponse. - * @implements IListResourceBackupConfigsResponse - * @constructor - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse=} [properties] Properties to set - */ - function ListResourceBackupConfigsResponse(properties) { - this.resourceBackupConfigs = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ListResourceBackupConfigsResponse resourceBackupConfigs. - * @member {Array.} resourceBackupConfigs - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @instance - */ - ListResourceBackupConfigsResponse.prototype.resourceBackupConfigs = $util.emptyArray; - - /** - * ListResourceBackupConfigsResponse nextPageToken. - * @member {string} nextPageToken - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @instance - */ - ListResourceBackupConfigsResponse.prototype.nextPageToken = ""; - - /** - * Creates a new ListResourceBackupConfigsResponse instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse instance - */ - ListResourceBackupConfigsResponse.create = function create(properties) { - return new ListResourceBackupConfigsResponse(properties); - }; - - /** - * Encodes the specified ListResourceBackupConfigsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceBackupConfigsResponse.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.resourceBackupConfigs != null && message.resourceBackupConfigs.length) - for (var i = 0; i < message.resourceBackupConfigs.length; ++i) - $root.google.cloud.backupdr.v1.ResourceBackupConfig.encode(message.resourceBackupConfigs[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 ListResourceBackupConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ListResourceBackupConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceBackupConfigsResponse.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.resourceBackupConfigs && message.resourceBackupConfigs.length)) - message.resourceBackupConfigs = []; - message.resourceBackupConfigs.push($root.google.cloud.backupdr.v1.ResourceBackupConfig.decode(reader, reader.uint32())); - break; - } - case 2: { - message.nextPageToken = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ListResourceBackupConfigsResponse.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ListResourceBackupConfigsResponse message. - * @function verify - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ListResourceBackupConfigsResponse.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.resourceBackupConfigs != null && message.hasOwnProperty("resourceBackupConfigs")) { - if (!Array.isArray(message.resourceBackupConfigs)) - return "resourceBackupConfigs: array expected"; - for (var i = 0; i < message.resourceBackupConfigs.length; ++i) { - var error = $root.google.cloud.backupdr.v1.ResourceBackupConfig.verify(message.resourceBackupConfigs[i]); - if (error) - return "resourceBackupConfigs." + error; - } - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - if (!$util.isString(message.nextPageToken)) - return "nextPageToken: string expected"; - return null; - }; - - /** - * Creates a ListResourceBackupConfigsResponse message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse - */ - ListResourceBackupConfigsResponse.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse) - return object; - var message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse(); - if (object.resourceBackupConfigs) { - if (!Array.isArray(object.resourceBackupConfigs)) - throw TypeError(".google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.resourceBackupConfigs: array expected"); - message.resourceBackupConfigs = []; - for (var i = 0; i < object.resourceBackupConfigs.length; ++i) { - if (typeof object.resourceBackupConfigs[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.resourceBackupConfigs: object expected"); - message.resourceBackupConfigs[i] = $root.google.cloud.backupdr.v1.ResourceBackupConfig.fromObject(object.resourceBackupConfigs[i]); - } - } - if (object.nextPageToken != null) - message.nextPageToken = String(object.nextPageToken); - return message; - }; - - /** - * Creates a plain object from a ListResourceBackupConfigsResponse message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ListResourceBackupConfigsResponse.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.resourceBackupConfigs = []; - if (options.defaults) - object.nextPageToken = ""; - if (message.resourceBackupConfigs && message.resourceBackupConfigs.length) { - object.resourceBackupConfigs = []; - for (var j = 0; j < message.resourceBackupConfigs.length; ++j) - object.resourceBackupConfigs[j] = $root.google.cloud.backupdr.v1.ResourceBackupConfig.toObject(message.resourceBackupConfigs[j], options); - } - if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) - object.nextPageToken = message.nextPageToken; - return object; - }; - - /** - * Converts this ListResourceBackupConfigsResponse to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @instance - * @returns {Object.} JSON object - */ - ListResourceBackupConfigsResponse.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ListResourceBackupConfigsResponse - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ListResourceBackupConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ListResourceBackupConfigsResponse"; - }; - - return ListResourceBackupConfigsResponse; - })(); - - v1.ResourceBackupConfig = (function() { - - /** - * Properties of a ResourceBackupConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IResourceBackupConfig - * @property {string|null} [name] ResourceBackupConfig name - * @property {string|null} [uid] ResourceBackupConfig uid - * @property {string|null} [targetResource] ResourceBackupConfig targetResource - * @property {string|null} [targetResourceDisplayName] ResourceBackupConfig targetResourceDisplayName - * @property {google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|null} [targetResourceType] ResourceBackupConfig targetResourceType - * @property {Object.|null} [targetResourceLabels] ResourceBackupConfig targetResourceLabels - * @property {Array.|null} [backupConfigsDetails] ResourceBackupConfig backupConfigsDetails - * @property {boolean|null} [backupConfigured] ResourceBackupConfig backupConfigured - * @property {boolean|null} [vaulted] ResourceBackupConfig vaulted - */ - - /** - * Constructs a new ResourceBackupConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a ResourceBackupConfig. - * @implements IResourceBackupConfig - * @constructor - * @param {google.cloud.backupdr.v1.IResourceBackupConfig=} [properties] Properties to set - */ - function ResourceBackupConfig(properties) { - this.targetResourceLabels = {}; - this.backupConfigsDetails = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceBackupConfig name. - * @member {string} name - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.name = ""; - - /** - * ResourceBackupConfig uid. - * @member {string} uid - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.uid = ""; - - /** - * ResourceBackupConfig targetResource. - * @member {string} targetResource - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.targetResource = ""; - - /** - * ResourceBackupConfig targetResourceDisplayName. - * @member {string} targetResourceDisplayName - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.targetResourceDisplayName = ""; - - /** - * ResourceBackupConfig targetResourceType. - * @member {google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType} targetResourceType - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.targetResourceType = 0; - - /** - * ResourceBackupConfig targetResourceLabels. - * @member {Object.} targetResourceLabels - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.targetResourceLabels = $util.emptyObject; - - /** - * ResourceBackupConfig backupConfigsDetails. - * @member {Array.} backupConfigsDetails - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.backupConfigsDetails = $util.emptyArray; - - /** - * ResourceBackupConfig backupConfigured. - * @member {boolean} backupConfigured - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.backupConfigured = false; - - /** - * ResourceBackupConfig vaulted. - * @member {boolean} vaulted - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - */ - ResourceBackupConfig.prototype.vaulted = false; - - /** - * Creates a new ResourceBackupConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IResourceBackupConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig instance - */ - ResourceBackupConfig.create = function create(properties) { - return new ResourceBackupConfig(properties); - }; - - /** - * Encodes the specified ResourceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IResourceBackupConfig} message ResourceBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceBackupConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); - if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetResource); - if (message.targetResourceDisplayName != null && Object.hasOwnProperty.call(message, "targetResourceDisplayName")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetResourceDisplayName); - if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.targetResourceType); - if (message.targetResourceLabels != null && Object.hasOwnProperty.call(message, "targetResourceLabels")) - for (var keys = Object.keys(message.targetResourceLabels), 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.targetResourceLabels[keys[i]]).ldelim(); - if (message.backupConfigsDetails != null && message.backupConfigsDetails.length) - for (var i = 0; i < message.backupConfigsDetails.length; ++i) - $root.google.cloud.backupdr.v1.BackupConfigDetails.encode(message.backupConfigsDetails[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.backupConfigured != null && Object.hasOwnProperty.call(message, "backupConfigured")) - writer.uint32(/* id 8, wireType 0 =*/64).bool(message.backupConfigured); - if (message.vaulted != null && Object.hasOwnProperty.call(message, "vaulted")) - writer.uint32(/* id 9, wireType 0 =*/72).bool(message.vaulted); - return writer; - }; - - /** - * Encodes the specified ResourceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.IResourceBackupConfig} message ResourceBackupConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceBackupConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceBackupConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ResourceBackupConfig(), key, value; - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.name = reader.string(); - break; - } - case 2: { - message.uid = reader.string(); - break; - } - case 3: { - message.targetResource = reader.string(); - break; - } - case 4: { - message.targetResourceDisplayName = reader.string(); - break; - } - case 5: { - message.targetResourceType = reader.int32(); - break; - } - case 6: { - if (message.targetResourceLabels === $util.emptyObject) - message.targetResourceLabels = {}; - var end2 = reader.uint32() + reader.pos; - key = ""; - value = ""; - while (reader.pos < end2) { - var tag2 = reader.uint32(); - switch (tag2 >>> 3) { - case 1: - key = reader.string(); - break; - case 2: - value = reader.string(); - break; - default: - reader.skipType(tag2 & 7); - break; - } - } - message.targetResourceLabels[key] = value; - break; - } - case 7: { - if (!(message.backupConfigsDetails && message.backupConfigsDetails.length)) - message.backupConfigsDetails = []; - message.backupConfigsDetails.push($root.google.cloud.backupdr.v1.BackupConfigDetails.decode(reader, reader.uint32())); - break; - } - case 8: { - message.backupConfigured = reader.bool(); - break; - } - case 9: { - message.vaulted = reader.bool(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ResourceBackupConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceBackupConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ResourceBackupConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ResourceBackupConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.uid != null && message.hasOwnProperty("uid")) - if (!$util.isString(message.uid)) - return "uid: string expected"; - if (message.targetResource != null && message.hasOwnProperty("targetResource")) - if (!$util.isString(message.targetResource)) - return "targetResource: string expected"; - if (message.targetResourceDisplayName != null && message.hasOwnProperty("targetResourceDisplayName")) - if (!$util.isString(message.targetResourceDisplayName)) - return "targetResourceDisplayName: string expected"; - if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) - switch (message.targetResourceType) { - default: - return "targetResourceType: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - if (message.targetResourceLabels != null && message.hasOwnProperty("targetResourceLabels")) { - if (!$util.isObject(message.targetResourceLabels)) - return "targetResourceLabels: object expected"; - var key = Object.keys(message.targetResourceLabels); - for (var i = 0; i < key.length; ++i) - if (!$util.isString(message.targetResourceLabels[key[i]])) - return "targetResourceLabels: string{k:string} expected"; - } - if (message.backupConfigsDetails != null && message.hasOwnProperty("backupConfigsDetails")) { - if (!Array.isArray(message.backupConfigsDetails)) - return "backupConfigsDetails: array expected"; - for (var i = 0; i < message.backupConfigsDetails.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupConfigDetails.verify(message.backupConfigsDetails[i]); - if (error) - return "backupConfigsDetails." + error; - } - } - if (message.backupConfigured != null && message.hasOwnProperty("backupConfigured")) - if (typeof message.backupConfigured !== "boolean") - return "backupConfigured: boolean expected"; - if (message.vaulted != null && message.hasOwnProperty("vaulted")) - if (typeof message.vaulted !== "boolean") - return "vaulted: boolean expected"; - return null; - }; - - /** - * Creates a ResourceBackupConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig - */ - ResourceBackupConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.ResourceBackupConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.ResourceBackupConfig(); - if (object.name != null) - message.name = String(object.name); - if (object.uid != null) - message.uid = String(object.uid); - if (object.targetResource != null) - message.targetResource = String(object.targetResource); - if (object.targetResourceDisplayName != null) - message.targetResourceDisplayName = String(object.targetResourceDisplayName); - switch (object.targetResourceType) { - default: - if (typeof object.targetResourceType === "number") { - message.targetResourceType = object.targetResourceType; - break; - } - break; - case "RESOURCE_TYPE_UNSPECIFIED": - case 0: - message.targetResourceType = 0; - break; - case "CLOUD_SQL_INSTANCE": - case 1: - message.targetResourceType = 1; - break; - case "COMPUTE_ENGINE_VM": - case 2: - message.targetResourceType = 2; - break; - case "COMPUTE_ENGINE_DISK": - case 3: - message.targetResourceType = 3; - break; - case "COMPUTE_ENGINE_REGIONAL_DISK": - case 4: - message.targetResourceType = 4; - break; - } - if (object.targetResourceLabels) { - if (typeof object.targetResourceLabels !== "object") - throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.targetResourceLabels: object expected"); - message.targetResourceLabels = {}; - for (var keys = Object.keys(object.targetResourceLabels), i = 0; i < keys.length; ++i) - message.targetResourceLabels[keys[i]] = String(object.targetResourceLabels[keys[i]]); - } - if (object.backupConfigsDetails) { - if (!Array.isArray(object.backupConfigsDetails)) - throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.backupConfigsDetails: array expected"); - message.backupConfigsDetails = []; - for (var i = 0; i < object.backupConfigsDetails.length; ++i) { - if (typeof object.backupConfigsDetails[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.backupConfigsDetails: object expected"); - message.backupConfigsDetails[i] = $root.google.cloud.backupdr.v1.BackupConfigDetails.fromObject(object.backupConfigsDetails[i]); - } - } - if (object.backupConfigured != null) - message.backupConfigured = Boolean(object.backupConfigured); - if (object.vaulted != null) - message.vaulted = Boolean(object.vaulted); - return message; - }; - - /** - * Creates a plain object from a ResourceBackupConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {google.cloud.backupdr.v1.ResourceBackupConfig} message ResourceBackupConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ResourceBackupConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupConfigsDetails = []; - if (options.objects || options.defaults) - object.targetResourceLabels = {}; - if (options.defaults) { - object.name = ""; - object.uid = ""; - object.targetResource = ""; - object.targetResourceDisplayName = ""; - object.targetResourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; - object.backupConfigured = false; - object.vaulted = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.uid != null && message.hasOwnProperty("uid")) - object.uid = message.uid; - if (message.targetResource != null && message.hasOwnProperty("targetResource")) - object.targetResource = message.targetResource; - if (message.targetResourceDisplayName != null && message.hasOwnProperty("targetResourceDisplayName")) - object.targetResourceDisplayName = message.targetResourceDisplayName; - if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) - object.targetResourceType = options.enums === String ? $root.google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType[message.targetResourceType] === undefined ? message.targetResourceType : $root.google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType[message.targetResourceType] : message.targetResourceType; - var keys2; - if (message.targetResourceLabels && (keys2 = Object.keys(message.targetResourceLabels)).length) { - object.targetResourceLabels = {}; - for (var j = 0; j < keys2.length; ++j) - object.targetResourceLabels[keys2[j]] = message.targetResourceLabels[keys2[j]]; - } - if (message.backupConfigsDetails && message.backupConfigsDetails.length) { - object.backupConfigsDetails = []; - for (var j = 0; j < message.backupConfigsDetails.length; ++j) - object.backupConfigsDetails[j] = $root.google.cloud.backupdr.v1.BackupConfigDetails.toObject(message.backupConfigsDetails[j], options); - } - if (message.backupConfigured != null && message.hasOwnProperty("backupConfigured")) - object.backupConfigured = message.backupConfigured; - if (message.vaulted != null && message.hasOwnProperty("vaulted")) - object.vaulted = message.vaulted; - return object; - }; - - /** - * Converts this ResourceBackupConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @instance - * @returns {Object.} JSON object - */ - ResourceBackupConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for ResourceBackupConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.ResourceBackupConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - ResourceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.ResourceBackupConfig"; - }; - - /** - * ResourceType enum. - * @name google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType - * @enum {number} - * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value - * @property {number} CLOUD_SQL_INSTANCE=1 CLOUD_SQL_INSTANCE value - * @property {number} COMPUTE_ENGINE_VM=2 COMPUTE_ENGINE_VM value - * @property {number} COMPUTE_ENGINE_DISK=3 COMPUTE_ENGINE_DISK value - * @property {number} COMPUTE_ENGINE_REGIONAL_DISK=4 COMPUTE_ENGINE_REGIONAL_DISK value - */ - ResourceBackupConfig.ResourceType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_SQL_INSTANCE"] = 1; - values[valuesById[2] = "COMPUTE_ENGINE_VM"] = 2; - values[valuesById[3] = "COMPUTE_ENGINE_DISK"] = 3; - values[valuesById[4] = "COMPUTE_ENGINE_REGIONAL_DISK"] = 4; - return values; - })(); - - return ResourceBackupConfig; - })(); - - v1.BackupConfigDetails = (function() { - - /** - * Properties of a BackupConfigDetails. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupConfigDetails - * @property {string|null} [backupConfigSource] BackupConfigDetails backupConfigSource - * @property {string|null} [backupConfigSourceDisplayName] BackupConfigDetails backupConfigSourceDisplayName - * @property {google.cloud.backupdr.v1.BackupConfigDetails.Type|null} [type] BackupConfigDetails type - * @property {google.cloud.backupdr.v1.BackupConfigDetails.State|null} [state] BackupConfigDetails state - * @property {google.cloud.backupdr.v1.IPitrSettings|null} [pitrSettings] BackupConfigDetails pitrSettings - * @property {google.protobuf.ITimestamp|null} [latestSuccessfulBackupTime] BackupConfigDetails latestSuccessfulBackupTime - * @property {string|null} [applicableResource] BackupConfigDetails applicableResource - * @property {string|null} [backupVault] BackupConfigDetails backupVault - * @property {Array.|null} [backupLocations] BackupConfigDetails backupLocations - * @property {google.cloud.backupdr.v1.IBackupDrPlanConfig|null} [backupDrPlanConfig] BackupConfigDetails backupDrPlanConfig - * @property {google.cloud.backupdr.v1.IBackupDrTemplateConfig|null} [backupDrTemplateConfig] BackupConfigDetails backupDrTemplateConfig - */ - - /** - * Constructs a new BackupConfigDetails. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupConfigDetails. - * @implements IBackupConfigDetails - * @constructor - * @param {google.cloud.backupdr.v1.IBackupConfigDetails=} [properties] Properties to set - */ - function BackupConfigDetails(properties) { - this.backupLocations = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupConfigDetails backupConfigSource. - * @member {string} backupConfigSource - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.backupConfigSource = ""; - - /** - * BackupConfigDetails backupConfigSourceDisplayName. - * @member {string} backupConfigSourceDisplayName - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.backupConfigSourceDisplayName = ""; - - /** - * BackupConfigDetails type. - * @member {google.cloud.backupdr.v1.BackupConfigDetails.Type} type - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.type = 0; - - /** - * BackupConfigDetails state. - * @member {google.cloud.backupdr.v1.BackupConfigDetails.State} state - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.state = 0; - - /** - * BackupConfigDetails pitrSettings. - * @member {google.cloud.backupdr.v1.IPitrSettings|null|undefined} pitrSettings - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.pitrSettings = null; - - /** - * BackupConfigDetails latestSuccessfulBackupTime. - * @member {google.protobuf.ITimestamp|null|undefined} latestSuccessfulBackupTime - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.latestSuccessfulBackupTime = null; - - /** - * BackupConfigDetails applicableResource. - * @member {string} applicableResource - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.applicableResource = ""; - - /** - * BackupConfigDetails backupVault. - * @member {string} backupVault - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.backupVault = ""; - - /** - * BackupConfigDetails backupLocations. - * @member {Array.} backupLocations - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.backupLocations = $util.emptyArray; - - /** - * BackupConfigDetails backupDrPlanConfig. - * @member {google.cloud.backupdr.v1.IBackupDrPlanConfig|null|undefined} backupDrPlanConfig - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.backupDrPlanConfig = null; - - /** - * BackupConfigDetails backupDrTemplateConfig. - * @member {google.cloud.backupdr.v1.IBackupDrTemplateConfig|null|undefined} backupDrTemplateConfig - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - BackupConfigDetails.prototype.backupDrTemplateConfig = null; - - // OneOf field names bound to virtual getters and setters - var $oneOfFields; - - /** - * BackupConfigDetails planSpecificConfig. - * @member {"backupDrPlanConfig"|"backupDrTemplateConfig"|undefined} planSpecificConfig - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - */ - Object.defineProperty(BackupConfigDetails.prototype, "planSpecificConfig", { - get: $util.oneOfGetter($oneOfFields = ["backupDrPlanConfig", "backupDrTemplateConfig"]), - set: $util.oneOfSetter($oneOfFields) - }); - - /** - * Creates a new BackupConfigDetails instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {google.cloud.backupdr.v1.IBackupConfigDetails=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails instance - */ - BackupConfigDetails.create = function create(properties) { - return new BackupConfigDetails(properties); - }; - - /** - * Encodes the specified BackupConfigDetails message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {google.cloud.backupdr.v1.IBackupConfigDetails} message BackupConfigDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupConfigDetails.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupConfigSource != null && Object.hasOwnProperty.call(message, "backupConfigSource")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupConfigSource); - if (message.backupConfigSourceDisplayName != null && Object.hasOwnProperty.call(message, "backupConfigSourceDisplayName")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupConfigSourceDisplayName); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); - if (message.state != null && Object.hasOwnProperty.call(message, "state")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); - if (message.pitrSettings != null && Object.hasOwnProperty.call(message, "pitrSettings")) - $root.google.cloud.backupdr.v1.PitrSettings.encode(message.pitrSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.latestSuccessfulBackupTime != null && Object.hasOwnProperty.call(message, "latestSuccessfulBackupTime")) - $root.google.protobuf.Timestamp.encode(message.latestSuccessfulBackupTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.applicableResource != null && Object.hasOwnProperty.call(message, "applicableResource")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.applicableResource); - if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.backupVault); - if (message.backupDrPlanConfig != null && Object.hasOwnProperty.call(message, "backupDrPlanConfig")) - $root.google.cloud.backupdr.v1.BackupDrPlanConfig.encode(message.backupDrPlanConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); - if (message.backupDrTemplateConfig != null && Object.hasOwnProperty.call(message, "backupDrTemplateConfig")) - $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.encode(message.backupDrTemplateConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); - if (message.backupLocations != null && message.backupLocations.length) - for (var i = 0; i < message.backupLocations.length; ++i) - $root.google.cloud.backupdr.v1.BackupLocation.encode(message.backupLocations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupConfigDetails message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {google.cloud.backupdr.v1.IBackupConfigDetails} message BackupConfigDetails message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupConfigDetails.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupConfigDetails message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupConfigDetails.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigDetails(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.backupConfigSource = reader.string(); - break; - } - case 2: { - message.backupConfigSourceDisplayName = reader.string(); - break; - } - case 3: { - message.type = reader.int32(); - break; - } - case 4: { - message.state = reader.int32(); - break; - } - case 5: { - message.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.decode(reader, reader.uint32()); - break; - } - case 6: { - message.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - case 7: { - message.applicableResource = reader.string(); - break; - } - case 8: { - message.backupVault = reader.string(); - break; - } - case 12: { - if (!(message.backupLocations && message.backupLocations.length)) - message.backupLocations = []; - message.backupLocations.push($root.google.cloud.backupdr.v1.BackupLocation.decode(reader, reader.uint32())); - break; - } - case 10: { - message.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.decode(reader, reader.uint32()); - break; - } - case 11: { - message.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupConfigDetails message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupConfigDetails.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupConfigDetails message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupConfigDetails.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - var properties = {}; - if (message.backupConfigSource != null && message.hasOwnProperty("backupConfigSource")) - if (!$util.isString(message.backupConfigSource)) - return "backupConfigSource: string expected"; - if (message.backupConfigSourceDisplayName != null && message.hasOwnProperty("backupConfigSourceDisplayName")) - if (!$util.isString(message.backupConfigSourceDisplayName)) - return "backupConfigSourceDisplayName: string expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - 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.pitrSettings != null && message.hasOwnProperty("pitrSettings")) { - var error = $root.google.cloud.backupdr.v1.PitrSettings.verify(message.pitrSettings); - if (error) - return "pitrSettings." + error; - } - if (message.latestSuccessfulBackupTime != null && message.hasOwnProperty("latestSuccessfulBackupTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.latestSuccessfulBackupTime); - if (error) - return "latestSuccessfulBackupTime." + error; - } - if (message.applicableResource != null && message.hasOwnProperty("applicableResource")) - if (!$util.isString(message.applicableResource)) - return "applicableResource: string expected"; - if (message.backupVault != null && message.hasOwnProperty("backupVault")) - if (!$util.isString(message.backupVault)) - return "backupVault: string expected"; - if (message.backupLocations != null && message.hasOwnProperty("backupLocations")) { - if (!Array.isArray(message.backupLocations)) - return "backupLocations: array expected"; - for (var i = 0; i < message.backupLocations.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupLocation.verify(message.backupLocations[i]); - if (error) - return "backupLocations." + error; - } - } - if (message.backupDrPlanConfig != null && message.hasOwnProperty("backupDrPlanConfig")) { - properties.planSpecificConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.verify(message.backupDrPlanConfig); - if (error) - return "backupDrPlanConfig." + error; - } - } - if (message.backupDrTemplateConfig != null && message.hasOwnProperty("backupDrTemplateConfig")) { - if (properties.planSpecificConfig === 1) - return "planSpecificConfig: multiple values"; - properties.planSpecificConfig = 1; - { - var error = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.verify(message.backupDrTemplateConfig); - if (error) - return "backupDrTemplateConfig." + error; - } - } - return null; - }; - - /** - * Creates a BackupConfigDetails message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails - */ - BackupConfigDetails.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigDetails) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupConfigDetails(); - if (object.backupConfigSource != null) - message.backupConfigSource = String(object.backupConfigSource); - if (object.backupConfigSourceDisplayName != null) - message.backupConfigSourceDisplayName = String(object.backupConfigSourceDisplayName); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "CLOUD_SQL_INSTANCE_BACKUP_CONFIG": - case 1: - message.type = 1; - break; - case "COMPUTE_ENGINE_RESOURCE_POLICY": - case 2: - message.type = 2; - break; - case "BACKUPDR_BACKUP_PLAN": - case 3: - message.type = 3; - break; - case "BACKUPDR_TEMPLATE": - case 4: - message.type = 4; - break; - } - 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 "ACTIVE": - case 1: - message.state = 1; - break; - case "INACTIVE": - case 2: - message.state = 2; - break; - case "ERROR": - case 3: - message.state = 3; - break; - } - if (object.pitrSettings != null) { - if (typeof object.pitrSettings !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.pitrSettings: object expected"); - message.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.fromObject(object.pitrSettings); - } - if (object.latestSuccessfulBackupTime != null) { - if (typeof object.latestSuccessfulBackupTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.latestSuccessfulBackupTime: object expected"); - message.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.fromObject(object.latestSuccessfulBackupTime); - } - if (object.applicableResource != null) - message.applicableResource = String(object.applicableResource); - if (object.backupVault != null) - message.backupVault = String(object.backupVault); - if (object.backupLocations) { - if (!Array.isArray(object.backupLocations)) - throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupLocations: array expected"); - message.backupLocations = []; - for (var i = 0; i < object.backupLocations.length; ++i) { - if (typeof object.backupLocations[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupLocations: object expected"); - message.backupLocations[i] = $root.google.cloud.backupdr.v1.BackupLocation.fromObject(object.backupLocations[i]); - } - } - if (object.backupDrPlanConfig != null) { - if (typeof object.backupDrPlanConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupDrPlanConfig: object expected"); - message.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.fromObject(object.backupDrPlanConfig); - } - if (object.backupDrTemplateConfig != null) { - if (typeof object.backupDrTemplateConfig !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupDrTemplateConfig: object expected"); - message.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.fromObject(object.backupDrTemplateConfig); - } - return message; - }; - - /** - * Creates a plain object from a BackupConfigDetails message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {google.cloud.backupdr.v1.BackupConfigDetails} message BackupConfigDetails - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupConfigDetails.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupLocations = []; - if (options.defaults) { - object.backupConfigSource = ""; - object.backupConfigSourceDisplayName = ""; - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; - object.pitrSettings = null; - object.latestSuccessfulBackupTime = null; - object.applicableResource = ""; - object.backupVault = ""; - } - if (message.backupConfigSource != null && message.hasOwnProperty("backupConfigSource")) - object.backupConfigSource = message.backupConfigSource; - if (message.backupConfigSourceDisplayName != null && message.hasOwnProperty("backupConfigSourceDisplayName")) - object.backupConfigSourceDisplayName = message.backupConfigSourceDisplayName; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigDetails.Type[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.BackupConfigDetails.Type[message.type] : message.type; - if (message.state != null && message.hasOwnProperty("state")) - object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigDetails.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupConfigDetails.State[message.state] : message.state; - if (message.pitrSettings != null && message.hasOwnProperty("pitrSettings")) - object.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.toObject(message.pitrSettings, options); - if (message.latestSuccessfulBackupTime != null && message.hasOwnProperty("latestSuccessfulBackupTime")) - object.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.toObject(message.latestSuccessfulBackupTime, options); - if (message.applicableResource != null && message.hasOwnProperty("applicableResource")) - object.applicableResource = message.applicableResource; - if (message.backupVault != null && message.hasOwnProperty("backupVault")) - object.backupVault = message.backupVault; - if (message.backupDrPlanConfig != null && message.hasOwnProperty("backupDrPlanConfig")) { - object.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.toObject(message.backupDrPlanConfig, options); - if (options.oneofs) - object.planSpecificConfig = "backupDrPlanConfig"; - } - if (message.backupDrTemplateConfig != null && message.hasOwnProperty("backupDrTemplateConfig")) { - object.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.toObject(message.backupDrTemplateConfig, options); - if (options.oneofs) - object.planSpecificConfig = "backupDrTemplateConfig"; - } - if (message.backupLocations && message.backupLocations.length) { - object.backupLocations = []; - for (var j = 0; j < message.backupLocations.length; ++j) - object.backupLocations[j] = $root.google.cloud.backupdr.v1.BackupLocation.toObject(message.backupLocations[j], options); - } - return object; - }; - - /** - * Converts this BackupConfigDetails to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @instance - * @returns {Object.} JSON object - */ - BackupConfigDetails.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupConfigDetails - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupConfigDetails - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupConfigDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigDetails"; - }; - - /** - * Type enum. - * @name google.cloud.backupdr.v1.BackupConfigDetails.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} CLOUD_SQL_INSTANCE_BACKUP_CONFIG=1 CLOUD_SQL_INSTANCE_BACKUP_CONFIG value - * @property {number} COMPUTE_ENGINE_RESOURCE_POLICY=2 COMPUTE_ENGINE_RESOURCE_POLICY value - * @property {number} BACKUPDR_BACKUP_PLAN=3 BACKUPDR_BACKUP_PLAN value - * @property {number} BACKUPDR_TEMPLATE=4 BACKUPDR_TEMPLATE value - */ - BackupConfigDetails.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "CLOUD_SQL_INSTANCE_BACKUP_CONFIG"] = 1; - values[valuesById[2] = "COMPUTE_ENGINE_RESOURCE_POLICY"] = 2; - values[valuesById[3] = "BACKUPDR_BACKUP_PLAN"] = 3; - values[valuesById[4] = "BACKUPDR_TEMPLATE"] = 4; - return values; - })(); - - /** - * State enum. - * @name google.cloud.backupdr.v1.BackupConfigDetails.State - * @enum {number} - * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value - * @property {number} ACTIVE=1 ACTIVE value - * @property {number} INACTIVE=2 INACTIVE value - * @property {number} ERROR=3 ERROR value - */ - BackupConfigDetails.State = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ACTIVE"] = 1; - values[valuesById[2] = "INACTIVE"] = 2; - values[valuesById[3] = "ERROR"] = 3; - return values; - })(); - - return BackupConfigDetails; - })(); - - v1.PitrSettings = (function() { - - /** - * Properties of a PitrSettings. - * @memberof google.cloud.backupdr.v1 - * @interface IPitrSettings - * @property {number|null} [retentionDays] PitrSettings retentionDays - */ - - /** - * Constructs a new PitrSettings. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a PitrSettings. - * @implements IPitrSettings - * @constructor - * @param {google.cloud.backupdr.v1.IPitrSettings=} [properties] Properties to set - */ - function PitrSettings(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * PitrSettings retentionDays. - * @member {number} retentionDays - * @memberof google.cloud.backupdr.v1.PitrSettings - * @instance - */ - PitrSettings.prototype.retentionDays = 0; - - /** - * Creates a new PitrSettings instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {google.cloud.backupdr.v1.IPitrSettings=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings instance - */ - PitrSettings.create = function create(properties) { - return new PitrSettings(properties); - }; - - /** - * Encodes the specified PitrSettings message. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {google.cloud.backupdr.v1.IPitrSettings} message PitrSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PitrSettings.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionDays); - return writer; - }; - - /** - * Encodes the specified PitrSettings message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {google.cloud.backupdr.v1.IPitrSettings} message PitrSettings message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PitrSettings.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PitrSettings message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PitrSettings.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.PitrSettings(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.retentionDays = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PitrSettings message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PitrSettings.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PitrSettings message. - * @function verify - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PitrSettings.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) - if (!$util.isInteger(message.retentionDays)) - return "retentionDays: integer expected"; - return null; - }; - - /** - * Creates a PitrSettings message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings - */ - PitrSettings.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.PitrSettings) - return object; - var message = new $root.google.cloud.backupdr.v1.PitrSettings(); - if (object.retentionDays != null) - message.retentionDays = object.retentionDays | 0; - return message; - }; - - /** - * Creates a plain object from a PitrSettings message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {google.cloud.backupdr.v1.PitrSettings} message PitrSettings - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PitrSettings.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.retentionDays = 0; - if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) - object.retentionDays = message.retentionDays; - return object; - }; - - /** - * Converts this PitrSettings to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.PitrSettings - * @instance - * @returns {Object.} JSON object - */ - PitrSettings.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for PitrSettings - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.PitrSettings - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - PitrSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.PitrSettings"; - }; - - return PitrSettings; - })(); - - v1.BackupDrTemplateConfig = (function() { - - /** - * Properties of a BackupDrTemplateConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupDrTemplateConfig - * @property {string|null} [firstPartyManagementUri] BackupDrTemplateConfig firstPartyManagementUri - * @property {string|null} [thirdPartyManagementUri] BackupDrTemplateConfig thirdPartyManagementUri - */ - - /** - * Constructs a new BackupDrTemplateConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupDrTemplateConfig. - * @implements IBackupDrTemplateConfig - * @constructor - * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig=} [properties] Properties to set - */ - function BackupDrTemplateConfig(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupDrTemplateConfig firstPartyManagementUri. - * @member {string} firstPartyManagementUri - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @instance - */ - BackupDrTemplateConfig.prototype.firstPartyManagementUri = ""; - - /** - * BackupDrTemplateConfig thirdPartyManagementUri. - * @member {string} thirdPartyManagementUri - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @instance - */ - BackupDrTemplateConfig.prototype.thirdPartyManagementUri = ""; - - /** - * Creates a new BackupDrTemplateConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig instance - */ - BackupDrTemplateConfig.create = function create(properties) { - return new BackupDrTemplateConfig(properties); - }; - - /** - * Encodes the specified BackupDrTemplateConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig} message BackupDrTemplateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDrTemplateConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.firstPartyManagementUri != null && Object.hasOwnProperty.call(message, "firstPartyManagementUri")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyManagementUri); - if (message.thirdPartyManagementUri != null && Object.hasOwnProperty.call(message, "thirdPartyManagementUri")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyManagementUri); - return writer; - }; - - /** - * Encodes the specified BackupDrTemplateConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig} message BackupDrTemplateConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDrTemplateConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupDrTemplateConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDrTemplateConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrTemplateConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.firstPartyManagementUri = reader.string(); - break; - } - case 2: { - message.thirdPartyManagementUri = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupDrTemplateConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDrTemplateConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupDrTemplateConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupDrTemplateConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) - if (!$util.isString(message.firstPartyManagementUri)) - return "firstPartyManagementUri: string expected"; - if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) - if (!$util.isString(message.thirdPartyManagementUri)) - return "thirdPartyManagementUri: string expected"; - return null; - }; - - /** - * Creates a BackupDrTemplateConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig - */ - BackupDrTemplateConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupDrTemplateConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupDrTemplateConfig(); - if (object.firstPartyManagementUri != null) - message.firstPartyManagementUri = String(object.firstPartyManagementUri); - if (object.thirdPartyManagementUri != null) - message.thirdPartyManagementUri = String(object.thirdPartyManagementUri); - return message; - }; - - /** - * Creates a plain object from a BackupDrTemplateConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {google.cloud.backupdr.v1.BackupDrTemplateConfig} message BackupDrTemplateConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupDrTemplateConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.firstPartyManagementUri = ""; - object.thirdPartyManagementUri = ""; - } - if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) - object.firstPartyManagementUri = message.firstPartyManagementUri; - if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) - object.thirdPartyManagementUri = message.thirdPartyManagementUri; - return object; - }; - - /** - * Converts this BackupDrTemplateConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @instance - * @returns {Object.} JSON object - */ - BackupDrTemplateConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupDrTemplateConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupDrTemplateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrTemplateConfig"; - }; - - return BackupDrTemplateConfig; - })(); - - v1.BackupDrPlanConfig = (function() { - - /** - * Properties of a BackupDrPlanConfig. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupDrPlanConfig - * @property {Array.|null} [backupDrPlanRules] BackupDrPlanConfig backupDrPlanRules - */ - - /** - * Constructs a new BackupDrPlanConfig. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupDrPlanConfig. - * @implements IBackupDrPlanConfig - * @constructor - * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig=} [properties] Properties to set - */ - function BackupDrPlanConfig(properties) { - this.backupDrPlanRules = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupDrPlanConfig backupDrPlanRules. - * @member {Array.} backupDrPlanRules - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @instance - */ - BackupDrPlanConfig.prototype.backupDrPlanRules = $util.emptyArray; - - /** - * Creates a new BackupDrPlanConfig instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig instance - */ - BackupDrPlanConfig.create = function create(properties) { - return new BackupDrPlanConfig(properties); - }; - - /** - * Encodes the specified BackupDrPlanConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig} message BackupDrPlanConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDrPlanConfig.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.backupDrPlanRules != null && message.backupDrPlanRules.length) - for (var i = 0; i < message.backupDrPlanRules.length; ++i) - $root.google.cloud.backupdr.v1.BackupDrPlanRule.encode(message.backupDrPlanRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupDrPlanConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig} message BackupDrPlanConfig message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDrPlanConfig.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupDrPlanConfig message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDrPlanConfig.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrPlanConfig(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - if (!(message.backupDrPlanRules && message.backupDrPlanRules.length)) - message.backupDrPlanRules = []; - message.backupDrPlanRules.push($root.google.cloud.backupdr.v1.BackupDrPlanRule.decode(reader, reader.uint32())); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupDrPlanConfig message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDrPlanConfig.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupDrPlanConfig message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupDrPlanConfig.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.backupDrPlanRules != null && message.hasOwnProperty("backupDrPlanRules")) { - if (!Array.isArray(message.backupDrPlanRules)) - return "backupDrPlanRules: array expected"; - for (var i = 0; i < message.backupDrPlanRules.length; ++i) { - var error = $root.google.cloud.backupdr.v1.BackupDrPlanRule.verify(message.backupDrPlanRules[i]); - if (error) - return "backupDrPlanRules." + error; - } - } - return null; - }; - - /** - * Creates a BackupDrPlanConfig message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig - */ - BackupDrPlanConfig.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupDrPlanConfig) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupDrPlanConfig(); - if (object.backupDrPlanRules) { - if (!Array.isArray(object.backupDrPlanRules)) - throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanConfig.backupDrPlanRules: array expected"); - message.backupDrPlanRules = []; - for (var i = 0; i < object.backupDrPlanRules.length; ++i) { - if (typeof object.backupDrPlanRules[i] !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanConfig.backupDrPlanRules: object expected"); - message.backupDrPlanRules[i] = $root.google.cloud.backupdr.v1.BackupDrPlanRule.fromObject(object.backupDrPlanRules[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a BackupDrPlanConfig message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {google.cloud.backupdr.v1.BackupDrPlanConfig} message BackupDrPlanConfig - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupDrPlanConfig.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.backupDrPlanRules = []; - if (message.backupDrPlanRules && message.backupDrPlanRules.length) { - object.backupDrPlanRules = []; - for (var j = 0; j < message.backupDrPlanRules.length; ++j) - object.backupDrPlanRules[j] = $root.google.cloud.backupdr.v1.BackupDrPlanRule.toObject(message.backupDrPlanRules[j], options); - } - return object; - }; - - /** - * Converts this BackupDrPlanConfig to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @instance - * @returns {Object.} JSON object - */ - BackupDrPlanConfig.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupDrPlanConfig - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupDrPlanConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrPlanConfig"; - }; - - return BackupDrPlanConfig; - })(); - - v1.BackupDrPlanRule = (function() { - - /** - * Properties of a BackupDrPlanRule. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupDrPlanRule - * @property {string|null} [ruleId] BackupDrPlanRule ruleId - * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupTime] BackupDrPlanRule lastSuccessfulBackupTime - */ - - /** - * Constructs a new BackupDrPlanRule. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupDrPlanRule. - * @implements IBackupDrPlanRule - * @constructor - * @param {google.cloud.backupdr.v1.IBackupDrPlanRule=} [properties] Properties to set - */ - function BackupDrPlanRule(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupDrPlanRule ruleId. - * @member {string} ruleId - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @instance - */ - BackupDrPlanRule.prototype.ruleId = ""; - - /** - * BackupDrPlanRule lastSuccessfulBackupTime. - * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupTime - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @instance - */ - BackupDrPlanRule.prototype.lastSuccessfulBackupTime = null; - - /** - * Creates a new BackupDrPlanRule instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {google.cloud.backupdr.v1.IBackupDrPlanRule=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule instance - */ - BackupDrPlanRule.create = function create(properties) { - return new BackupDrPlanRule(properties); - }; - - /** - * Encodes the specified BackupDrPlanRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {google.cloud.backupdr.v1.IBackupDrPlanRule} message BackupDrPlanRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDrPlanRule.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); - if (message.lastSuccessfulBackupTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupTime")) - $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified BackupDrPlanRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {google.cloud.backupdr.v1.IBackupDrPlanRule} message BackupDrPlanRule message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupDrPlanRule.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupDrPlanRule message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDrPlanRule.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrPlanRule(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.ruleId = reader.string(); - break; - } - case 2: { - message.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupDrPlanRule message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupDrPlanRule.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupDrPlanRule message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupDrPlanRule.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - if (!$util.isString(message.ruleId)) - return "ruleId: string expected"; - if (message.lastSuccessfulBackupTime != null && message.hasOwnProperty("lastSuccessfulBackupTime")) { - var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupTime); - if (error) - return "lastSuccessfulBackupTime." + error; - } - return null; - }; - - /** - * Creates a BackupDrPlanRule message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule - */ - BackupDrPlanRule.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupDrPlanRule) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupDrPlanRule(); - if (object.ruleId != null) - message.ruleId = String(object.ruleId); - if (object.lastSuccessfulBackupTime != null) { - if (typeof object.lastSuccessfulBackupTime !== "object") - throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanRule.lastSuccessfulBackupTime: object expected"); - message.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupTime); - } - return message; - }; - - /** - * Creates a plain object from a BackupDrPlanRule message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {google.cloud.backupdr.v1.BackupDrPlanRule} message BackupDrPlanRule - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupDrPlanRule.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.ruleId = ""; - object.lastSuccessfulBackupTime = null; - } - if (message.ruleId != null && message.hasOwnProperty("ruleId")) - object.ruleId = message.ruleId; - if (message.lastSuccessfulBackupTime != null && message.hasOwnProperty("lastSuccessfulBackupTime")) - object.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupTime, options); - return object; - }; - - /** - * Converts this BackupDrPlanRule to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @instance - * @returns {Object.} JSON object - */ - BackupDrPlanRule.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupDrPlanRule - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupDrPlanRule - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupDrPlanRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrPlanRule"; - }; - - return BackupDrPlanRule; - })(); - - v1.BackupLocation = (function() { - - /** - * Properties of a BackupLocation. - * @memberof google.cloud.backupdr.v1 - * @interface IBackupLocation - * @property {google.cloud.backupdr.v1.BackupLocation.Type|null} [type] BackupLocation type - * @property {string|null} [locationId] BackupLocation locationId - */ - - /** - * Constructs a new BackupLocation. - * @memberof google.cloud.backupdr.v1 - * @classdesc Represents a BackupLocation. - * @implements IBackupLocation - * @constructor - * @param {google.cloud.backupdr.v1.IBackupLocation=} [properties] Properties to set - */ - function BackupLocation(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * BackupLocation type. - * @member {google.cloud.backupdr.v1.BackupLocation.Type} type - * @memberof google.cloud.backupdr.v1.BackupLocation - * @instance - */ - BackupLocation.prototype.type = 0; - - /** - * BackupLocation locationId. - * @member {string} locationId - * @memberof google.cloud.backupdr.v1.BackupLocation - * @instance - */ - BackupLocation.prototype.locationId = ""; - - /** - * Creates a new BackupLocation instance using the specified properties. - * @function create - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {google.cloud.backupdr.v1.IBackupLocation=} [properties] Properties to set - * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation instance - */ - BackupLocation.create = function create(properties) { - return new BackupLocation(properties); - }; - - /** - * Encodes the specified BackupLocation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. - * @function encode - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {google.cloud.backupdr.v1.IBackupLocation} message BackupLocation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupLocation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); - if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.locationId); - return writer; - }; - - /** - * Encodes the specified BackupLocation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {google.cloud.backupdr.v1.IBackupLocation} message BackupLocation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - BackupLocation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a BackupLocation message from the specified reader or buffer. - * @function decode - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupLocation.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLocation(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.type = reader.int32(); - break; - } - case 2: { - message.locationId = reader.string(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a BackupLocation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - BackupLocation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a BackupLocation message. - * @function verify - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - BackupLocation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 0: - case 1: - case 2: - case 3: - break; - } - if (message.locationId != null && message.hasOwnProperty("locationId")) - if (!$util.isString(message.locationId)) - return "locationId: string expected"; - return null; - }; - - /** - * Creates a BackupLocation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {Object.} object Plain object - * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation - */ - BackupLocation.fromObject = function fromObject(object) { - if (object instanceof $root.google.cloud.backupdr.v1.BackupLocation) - return object; - var message = new $root.google.cloud.backupdr.v1.BackupLocation(); - switch (object.type) { - default: - if (typeof object.type === "number") { - message.type = object.type; - break; - } - break; - case "TYPE_UNSPECIFIED": - case 0: - message.type = 0; - break; - case "ZONAL": - case 1: - message.type = 1; - break; - case "REGIONAL": - case 2: - message.type = 2; - break; - case "MULTI_REGIONAL": - case 3: - message.type = 3; - break; - } - if (object.locationId != null) - message.locationId = String(object.locationId); - return message; - }; - - /** - * Creates a plain object from a BackupLocation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {google.cloud.backupdr.v1.BackupLocation} message BackupLocation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - BackupLocation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; - object.locationId = ""; - } - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.cloud.backupdr.v1.BackupLocation.Type[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.BackupLocation.Type[message.type] : message.type; - if (message.locationId != null && message.hasOwnProperty("locationId")) - object.locationId = message.locationId; - return object; - }; - - /** - * Converts this BackupLocation to JSON. - * @function toJSON - * @memberof google.cloud.backupdr.v1.BackupLocation - * @instance - * @returns {Object.} JSON object - */ - BackupLocation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for BackupLocation - * @function getTypeUrl - * @memberof google.cloud.backupdr.v1.BackupLocation - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - BackupLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLocation"; - }; - - /** - * Type enum. - * @name google.cloud.backupdr.v1.BackupLocation.Type - * @enum {number} - * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value - * @property {number} ZONAL=1 ZONAL value - * @property {number} REGIONAL=2 REGIONAL value - * @property {number} MULTI_REGIONAL=3 MULTI_REGIONAL value - */ - BackupLocation.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; - values[valuesById[1] = "ZONAL"] = 1; - values[valuesById[2] = "REGIONAL"] = 2; - values[valuesById[3] = "MULTI_REGIONAL"] = 3; - return values; - })(); - - return BackupLocation; - })(); - - return v1; - })(); - - return backupdr; - })(); - - 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.FieldInfo = (function() { - - /** - * Properties of a FieldInfo. - * @memberof google.api - * @interface IFieldInfo - * @property {google.api.FieldInfo.Format|null} [format] FieldInfo format - */ - - /** - * Constructs a new FieldInfo. - * @memberof google.api - * @classdesc Represents a FieldInfo. - * @implements IFieldInfo - * @constructor - * @param {google.api.IFieldInfo=} [properties] Properties to set - */ - function FieldInfo(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldInfo format. - * @member {google.api.FieldInfo.Format} format - * @memberof google.api.FieldInfo - * @instance - */ - FieldInfo.prototype.format = 0; - - /** - * Creates a new FieldInfo instance using the specified properties. - * @function create - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo=} [properties] Properties to set - * @returns {google.api.FieldInfo} FieldInfo instance - */ - FieldInfo.create = function create(properties) { - return new FieldInfo(properties); - }; - - /** - * Encodes the specified FieldInfo message. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encode - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.format != null && Object.hasOwnProperty.call(message, "format")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.format); - return writer; - }; - - /** - * Encodes the specified FieldInfo message, length delimited. Does not implicitly {@link google.api.FieldInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {google.api.IFieldInfo} message FieldInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer. - * @function decode - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decode = function decode(reader, length, error) { - if (!(reader instanceof $Reader)) - reader = $Reader.create(reader); - var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.api.FieldInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - if (tag === error) - break; - switch (tag >>> 3) { - case 1: { - message.format = reader.int32(); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.api.FieldInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.api.FieldInfo} FieldInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldInfo message. - * @function verify - * @memberof google.api.FieldInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.format != null && message.hasOwnProperty("format")) - switch (message.format) { - default: - return "format: enum value expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - break; - } - return null; - }; - - /** - * Creates a FieldInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.api.FieldInfo - * @static - * @param {Object.} object Plain object - * @returns {google.api.FieldInfo} FieldInfo - */ - FieldInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.api.FieldInfo) - return object; - var message = new $root.google.api.FieldInfo(); - switch (object.format) { - default: - if (typeof object.format === "number") { - message.format = object.format; - break; - } - break; - case "FORMAT_UNSPECIFIED": - case 0: - message.format = 0; - break; - case "UUID4": - case 1: - message.format = 1; - break; - case "IPV4": - case 2: - message.format = 2; - break; - case "IPV6": - case 3: - message.format = 3; - break; - case "IPV4_OR_IPV6": - case 4: - message.format = 4; - break; - } - return message; - }; - - /** - * Creates a plain object from a FieldInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.api.FieldInfo - * @static - * @param {google.api.FieldInfo} message FieldInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.format = options.enums === String ? "FORMAT_UNSPECIFIED" : 0; - if (message.format != null && message.hasOwnProperty("format")) - object.format = options.enums === String ? $root.google.api.FieldInfo.Format[message.format] === undefined ? message.format : $root.google.api.FieldInfo.Format[message.format] : message.format; - return object; - }; - - /** - * Converts this FieldInfo to JSON. - * @function toJSON - * @memberof google.api.FieldInfo - * @instance - * @returns {Object.} JSON object - */ - FieldInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldInfo - * @function getTypeUrl - * @memberof google.api.FieldInfo - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.api.FieldInfo"; - }; - - /** - * Format enum. - * @name google.api.FieldInfo.Format - * @enum {number} - * @property {number} FORMAT_UNSPECIFIED=0 FORMAT_UNSPECIFIED value - * @property {number} UUID4=1 UUID4 value - * @property {number} IPV4=2 IPV4 value - * @property {number} IPV6=3 IPV6 value - * @property {number} IPV4_OR_IPV6=4 IPV4_OR_IPV6 value - */ - FieldInfo.Format = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "FORMAT_UNSPECIFIED"] = 0; - values[valuesById[1] = "UUID4"] = 1; - values[valuesById[2] = "IPV4"] = 2; - values[valuesById[3] = "IPV6"] = 3; - values[valuesById[4] = "IPV4_OR_IPV6"] = 4; - return values; - })(); - - return FieldInfo; - })(); - - api.ResourceDescriptor = (function() { - - /** - * Properties of a ResourceDescriptor. - * @memberof google.api - * @interface IResourceDescriptor - * @property {string|null} [type] ResourceDescriptor type - * @property {Array.|null} [pattern] ResourceDescriptor pattern - * @property {string|null} [nameField] ResourceDescriptor nameField - * @property {google.api.ResourceDescriptor.History|null} [history] ResourceDescriptor history - * @property {string|null} [plural] ResourceDescriptor plural - * @property {string|null} [singular] ResourceDescriptor singular - * @property {Array.|null} [style] ResourceDescriptor style - */ - - /** - * Constructs a new ResourceDescriptor. - * @memberof google.api - * @classdesc Represents a ResourceDescriptor. - * @implements IResourceDescriptor - * @constructor - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - */ - function ResourceDescriptor(properties) { - this.pattern = []; - this.style = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * ResourceDescriptor type. - * @member {string} type - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.type = ""; - - /** - * ResourceDescriptor pattern. - * @member {Array.} pattern - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.pattern = $util.emptyArray; - - /** - * ResourceDescriptor nameField. - * @member {string} nameField - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.nameField = ""; - - /** - * ResourceDescriptor history. - * @member {google.api.ResourceDescriptor.History} history - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.history = 0; - - /** - * ResourceDescriptor plural. - * @member {string} plural - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.plural = ""; - - /** - * ResourceDescriptor singular. - * @member {string} singular - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.singular = ""; - - /** - * ResourceDescriptor style. - * @member {Array.} style - * @memberof google.api.ResourceDescriptor - * @instance - */ - ResourceDescriptor.prototype.style = $util.emptyArray; - - /** - * Creates a new ResourceDescriptor instance using the specified properties. - * @function create - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor=} [properties] Properties to set - * @returns {google.api.ResourceDescriptor} ResourceDescriptor instance - */ - ResourceDescriptor.create = function create(properties) { - return new ResourceDescriptor(properties); - }; - - /** - * Encodes the specified ResourceDescriptor message. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encode - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.type); - if (message.pattern != null && message.pattern.length) - for (var i = 0; i < message.pattern.length; ++i) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.pattern[i]); - if (message.nameField != null && Object.hasOwnProperty.call(message, "nameField")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.nameField); - if (message.history != null && Object.hasOwnProperty.call(message, "history")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.history); - if (message.plural != null && Object.hasOwnProperty.call(message, "plural")) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.plural); - if (message.singular != null && Object.hasOwnProperty.call(message, "singular")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.singular); - if (message.style != null && message.style.length) { - writer.uint32(/* id 10, wireType 2 =*/82).fork(); - for (var i = 0; i < message.style.length; ++i) - writer.int32(message.style[i]); - writer.ldelim(); - } - return writer; - }; - - /** - * Encodes the specified ResourceDescriptor message, length delimited. Does not implicitly {@link google.api.ResourceDescriptor.verify|verify} messages. - * @function encodeDelimited - * @memberof google.api.ResourceDescriptor - * @static - * @param {google.api.IResourceDescriptor} message ResourceDescriptor message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ResourceDescriptor.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ResourceDescriptor message from the specified reader or buffer. - * @function decode - * @memberof google.api.ResourceDescriptor - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.api.ResourceDescriptor} ResourceDescriptor - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ResourceDescriptor.decode = function decode(reader, length, 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.IFieldInfo|null} [".google.api.fieldInfo"] FieldOptions .google.api.fieldInfo - * @property {google.api.IResourceReference|null} [".google.api.resourceReference"] FieldOptions .google.api.resourceReference - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.targets = []; - this.editionDefaults = []; - this.uninterpretedOption = []; - this[".google.api.fieldBehavior"] = []; - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions unverifiedLazy. - * @member {boolean} unverifiedLazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.unverifiedLazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions debugRedact. - * @member {boolean} debugRedact - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.debugRedact = false; - - /** - * FieldOptions retention. - * @member {google.protobuf.FieldOptions.OptionRetention} retention - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.retention = 0; - - /** - * FieldOptions targets. - * @member {Array.} targets - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.targets = $util.emptyArray; - - /** - * FieldOptions editionDefaults. - * @member {Array.} editionDefaults - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.editionDefaults = $util.emptyArray; - - /** - * FieldOptions features. - * @member {google.protobuf.IFeatureSet|null|undefined} features - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.features = null; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldBehavior. - * @member {Array.} .google.api.fieldBehavior - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldBehavior"] = $util.emptyArray; - - /** - * FieldOptions .google.api.fieldInfo. - * @member {google.api.IFieldInfo|null|undefined} .google.api.fieldInfo - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.fieldInfo"] = null; - - /** - * FieldOptions .google.api.resourceReference. - * @member {google.api.IResourceReference|null|undefined} .google.api.resourceReference - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".google.api.resourceReference"] = null; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.unverifiedLazy != null && Object.hasOwnProperty.call(message, "unverifiedLazy")) - writer.uint32(/* id 15, wireType 0 =*/120).bool(message.unverifiedLazy); - if (message.debugRedact != null && Object.hasOwnProperty.call(message, "debugRedact")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.debugRedact); - if (message.retention != null && Object.hasOwnProperty.call(message, "retention")) - writer.uint32(/* id 17, wireType 0 =*/136).int32(message.retention); - if (message.targets != null && message.targets.length) - for (var i = 0; i < message.targets.length; ++i) - writer.uint32(/* id 19, wireType 0 =*/152).int32(message.targets[i]); - if (message.editionDefaults != null && message.editionDefaults.length) - for (var i = 0; i < message.editionDefaults.length; ++i) - $root.google.protobuf.FieldOptions.EditionDefault.encode(message.editionDefaults[i], writer.uint32(/* id 20, wireType 2 =*/162).fork()).ldelim(); - if (message.features != null && Object.hasOwnProperty.call(message, "features")) - $root.google.protobuf.FeatureSet.encode(message.features, writer.uint32(/* id 21, wireType 2 =*/170).fork()).ldelim(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".google.api.fieldBehavior"] != null && message[".google.api.fieldBehavior"].length) - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - writer.uint32(/* id 1052, wireType 0 =*/8416).int32(message[".google.api.fieldBehavior"][i]); - if (message[".google.api.resourceReference"] != null && Object.hasOwnProperty.call(message, ".google.api.resourceReference")) - $root.google.api.ResourceReference.encode(message[".google.api.resourceReference"], writer.uint32(/* id 1055, wireType 2 =*/8442).fork()).ldelim(); - if (message[".google.api.fieldInfo"] != null && Object.hasOwnProperty.call(message, ".google.api.fieldInfo")) - $root.google.api.FieldInfo.encode(message[".google.api.fieldInfo"], writer.uint32(/* id 291403980, wireType 2 =*/2331231842).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decode = function decode(reader, length, 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 291403980: { - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.decode(reader, reader.uint32()); - break; - } - case 1055: { - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.decode(reader, reader.uint32()); - break; - } - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - if (typeof message.unverifiedLazy !== "boolean") - return "unverifiedLazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - if (typeof message.debugRedact !== "boolean") - return "debugRedact: boolean expected"; - if (message.retention != null && message.hasOwnProperty("retention")) - switch (message.retention) { - default: - return "retention: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.targets != null && message.hasOwnProperty("targets")) { - if (!Array.isArray(message.targets)) - return "targets: array expected"; - for (var i = 0; i < message.targets.length; ++i) - switch (message.targets[i]) { - default: - return "targets: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - break; - } - } - if (message.editionDefaults != null && message.hasOwnProperty("editionDefaults")) { - if (!Array.isArray(message.editionDefaults)) - return "editionDefaults: array expected"; - for (var i = 0; i < message.editionDefaults.length; ++i) { - var error = $root.google.protobuf.FieldOptions.EditionDefault.verify(message.editionDefaults[i]); - if (error) - return "editionDefaults." + error; - } - } - if (message.features != null && message.hasOwnProperty("features")) { - var error = $root.google.protobuf.FeatureSet.verify(message.features); - if (error) - return "features." + error; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".google.api.fieldBehavior"] != null && message.hasOwnProperty(".google.api.fieldBehavior")) { - if (!Array.isArray(message[".google.api.fieldBehavior"])) - return ".google.api.fieldBehavior: array expected"; - for (var i = 0; i < message[".google.api.fieldBehavior"].length; ++i) - switch (message[".google.api.fieldBehavior"][i]) { - default: - return ".google.api.fieldBehavior: enum value[] expected"; - case 0: - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - break; - } - } - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) { - var error = $root.google.api.FieldInfo.verify(message[".google.api.fieldInfo"]); - if (error) - return ".google.api.fieldInfo." + error; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) { - var error = $root.google.api.ResourceReference.verify(message[".google.api.resourceReference"]); - if (error) - return ".google.api.resourceReference." + error; - } - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - default: - if (typeof object.ctype === "number") { - message.ctype = object.ctype; - break; - } - break; - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - default: - if (typeof object.jstype === "number") { - message.jstype = object.jstype; - break; - } - break; - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.unverifiedLazy != null) - message.unverifiedLazy = Boolean(object.unverifiedLazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.debugRedact != null) - message.debugRedact = Boolean(object.debugRedact); - switch (object.retention) { - default: - if (typeof object.retention === "number") { - message.retention = object.retention; - break; - } - break; - case "RETENTION_UNKNOWN": - case 0: - message.retention = 0; - break; - case "RETENTION_RUNTIME": - case 1: - message.retention = 1; - break; - case "RETENTION_SOURCE": - case 2: - message.retention = 2; - break; - } - if (object.targets) { - if (!Array.isArray(object.targets)) - throw TypeError(".google.protobuf.FieldOptions.targets: array expected"); - message.targets = []; - for (var i = 0; i < object.targets.length; ++i) - switch (object.targets[i]) { - default: - if (typeof object.targets[i] === "number") { - message.targets[i] = object.targets[i]; - break; - } - case "TARGET_TYPE_UNKNOWN": - case 0: - message.targets[i] = 0; - break; - case "TARGET_TYPE_FILE": - case 1: - message.targets[i] = 1; - break; - case "TARGET_TYPE_EXTENSION_RANGE": - case 2: - message.targets[i] = 2; - break; - case "TARGET_TYPE_MESSAGE": - case 3: - message.targets[i] = 3; - break; - case "TARGET_TYPE_FIELD": - case 4: - message.targets[i] = 4; - break; - case "TARGET_TYPE_ONEOF": - case 5: - message.targets[i] = 5; - break; - case "TARGET_TYPE_ENUM": - case 6: - message.targets[i] = 6; - break; - case "TARGET_TYPE_ENUM_ENTRY": - case 7: - message.targets[i] = 7; - break; - case "TARGET_TYPE_SERVICE": - case 8: - message.targets[i] = 8; - break; - case "TARGET_TYPE_METHOD": - case 9: - message.targets[i] = 9; - break; - } - } - if (object.editionDefaults) { - if (!Array.isArray(object.editionDefaults)) - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: array expected"); - message.editionDefaults = []; - for (var i = 0; i < object.editionDefaults.length; ++i) { - if (typeof object.editionDefaults[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.editionDefaults: object expected"); - message.editionDefaults[i] = $root.google.protobuf.FieldOptions.EditionDefault.fromObject(object.editionDefaults[i]); - } - } - if (object.features != null) { - if (typeof object.features !== "object") - throw TypeError(".google.protobuf.FieldOptions.features: object expected"); - message.features = $root.google.protobuf.FeatureSet.fromObject(object.features); - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".google.api.fieldBehavior"]) { - if (!Array.isArray(object[".google.api.fieldBehavior"])) - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldBehavior: array expected"); - message[".google.api.fieldBehavior"] = []; - for (var i = 0; i < object[".google.api.fieldBehavior"].length; ++i) - switch (object[".google.api.fieldBehavior"][i]) { - default: - if (typeof object[".google.api.fieldBehavior"][i] === "number") { - message[".google.api.fieldBehavior"][i] = object[".google.api.fieldBehavior"][i]; - break; - } - case "FIELD_BEHAVIOR_UNSPECIFIED": - case 0: - message[".google.api.fieldBehavior"][i] = 0; - break; - case "OPTIONAL": - case 1: - message[".google.api.fieldBehavior"][i] = 1; - break; - case "REQUIRED": - case 2: - message[".google.api.fieldBehavior"][i] = 2; - break; - case "OUTPUT_ONLY": - case 3: - message[".google.api.fieldBehavior"][i] = 3; - break; - case "INPUT_ONLY": - case 4: - message[".google.api.fieldBehavior"][i] = 4; - break; - case "IMMUTABLE": - case 5: - message[".google.api.fieldBehavior"][i] = 5; - break; - case "UNORDERED_LIST": - case 6: - message[".google.api.fieldBehavior"][i] = 6; - break; - case "NON_EMPTY_DEFAULT": - case 7: - message[".google.api.fieldBehavior"][i] = 7; - break; - case "IDENTIFIER": - case 8: - message[".google.api.fieldBehavior"][i] = 8; - break; - } - } - if (object[".google.api.fieldInfo"] != null) { - if (typeof object[".google.api.fieldInfo"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.fieldInfo: object expected"); - message[".google.api.fieldInfo"] = $root.google.api.FieldInfo.fromObject(object[".google.api.fieldInfo"]); - } - if (object[".google.api.resourceReference"] != null) { - if (typeof object[".google.api.resourceReference"] !== "object") - throw TypeError(".google.protobuf.FieldOptions..google.api.resourceReference: object expected"); - message[".google.api.resourceReference"] = $root.google.api.ResourceReference.fromObject(object[".google.api.resourceReference"]); - } - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.targets = []; - object.editionDefaults = []; - object.uninterpretedOption = []; - object[".google.api.fieldBehavior"] = []; - } - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object.unverifiedLazy = false; - object.debugRedact = false; - object.retention = options.enums === String ? "RETENTION_UNKNOWN" : 0; - object.features = null; - object[".google.api.resourceReference"] = null; - object[".google.api.fieldInfo"] = null; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] === undefined ? message.ctype : $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] === undefined ? message.jstype : $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.unverifiedLazy != null && message.hasOwnProperty("unverifiedLazy")) - object.unverifiedLazy = message.unverifiedLazy; - if (message.debugRedact != null && message.hasOwnProperty("debugRedact")) - object.debugRedact = message.debugRedact; - if (message.retention != null && message.hasOwnProperty("retention")) - object.retention = options.enums === String ? $root.google.protobuf.FieldOptions.OptionRetention[message.retention] === undefined ? message.retention : $root.google.protobuf.FieldOptions.OptionRetention[message.retention] : message.retention; - if (message.targets && message.targets.length) { - object.targets = []; - for (var j = 0; j < message.targets.length; ++j) - object.targets[j] = options.enums === String ? $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] === undefined ? message.targets[j] : $root.google.protobuf.FieldOptions.OptionTargetType[message.targets[j]] : message.targets[j]; - } - if (message.editionDefaults && message.editionDefaults.length) { - object.editionDefaults = []; - for (var j = 0; j < message.editionDefaults.length; ++j) - object.editionDefaults[j] = $root.google.protobuf.FieldOptions.EditionDefault.toObject(message.editionDefaults[j], options); - } - if (message.features != null && message.hasOwnProperty("features")) - object.features = $root.google.protobuf.FeatureSet.toObject(message.features, options); - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".google.api.fieldBehavior"] && message[".google.api.fieldBehavior"].length) { - object[".google.api.fieldBehavior"] = []; - for (var j = 0; j < message[".google.api.fieldBehavior"].length; ++j) - object[".google.api.fieldBehavior"][j] = options.enums === String ? $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] === undefined ? message[".google.api.fieldBehavior"][j] : $root.google.api.FieldBehavior[message[".google.api.fieldBehavior"][j]] : message[".google.api.fieldBehavior"][j]; - } - if (message[".google.api.resourceReference"] != null && message.hasOwnProperty(".google.api.resourceReference")) - object[".google.api.resourceReference"] = $root.google.api.ResourceReference.toObject(message[".google.api.resourceReference"], options); - if (message[".google.api.fieldInfo"] != null && message.hasOwnProperty(".google.api.fieldInfo")) - object[".google.api.fieldInfo"] = $root.google.api.FieldInfo.toObject(message[".google.api.fieldInfo"], options); - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Gets the default type url for FieldOptions - * @function getTypeUrl - * @memberof google.protobuf.FieldOptions - * @static - * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") - * @returns {string} The default type url - */ - FieldOptions.getTypeUrl = function getTypeUrl(typeUrlPrefix) { - if (typeUrlPrefix === undefined) { - typeUrlPrefix = "type.googleapis.com"; - } - return typeUrlPrefix + "/google.protobuf.FieldOptions"; - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - /** - * OptionRetention enum. - * @name google.protobuf.FieldOptions.OptionRetention - * @enum {number} - * @property {number} RETENTION_UNKNOWN=0 RETENTION_UNKNOWN value - * @property {number} RETENTION_RUNTIME=1 RETENTION_RUNTIME value - * @property {number} RETENTION_SOURCE=2 RETENTION_SOURCE value - */ - FieldOptions.OptionRetention = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "RETENTION_UNKNOWN"] = 0; - values[valuesById[1] = "RETENTION_RUNTIME"] = 1; - values[valuesById[2] = "RETENTION_SOURCE"] = 2; - return values; - })(); - - /** - * OptionTargetType enum. - * @name google.protobuf.FieldOptions.OptionTargetType - * @enum {number} - * @property {number} TARGET_TYPE_UNKNOWN=0 TARGET_TYPE_UNKNOWN value - * @property {number} TARGET_TYPE_FILE=1 TARGET_TYPE_FILE value - * @property {number} TARGET_TYPE_EXTENSION_RANGE=2 TARGET_TYPE_EXTENSION_RANGE value - * @property {number} TARGET_TYPE_MESSAGE=3 TARGET_TYPE_MESSAGE value - * @property {number} TARGET_TYPE_FIELD=4 TARGET_TYPE_FIELD value - * @property {number} TARGET_TYPE_ONEOF=5 TARGET_TYPE_ONEOF value - * @property {number} TARGET_TYPE_ENUM=6 TARGET_TYPE_ENUM value - * @property {number} TARGET_TYPE_ENUM_ENTRY=7 TARGET_TYPE_ENUM_ENTRY value - * @property {number} TARGET_TYPE_SERVICE=8 TARGET_TYPE_SERVICE value - * @property {number} TARGET_TYPE_METHOD=9 TARGET_TYPE_METHOD value - */ - FieldOptions.OptionTargetType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "TARGET_TYPE_UNKNOWN"] = 0; - values[valuesById[1] = "TARGET_TYPE_FILE"] = 1; - values[valuesById[2] = "TARGET_TYPE_EXTENSION_RANGE"] = 2; - values[valuesById[3] = "TARGET_TYPE_MESSAGE"] = 3; - values[valuesById[4] = "TARGET_TYPE_FIELD"] = 4; - values[valuesById[5] = "TARGET_TYPE_ONEOF"] = 5; - values[valuesById[6] = "TARGET_TYPE_ENUM"] = 6; - values[valuesById[7] = "TARGET_TYPE_ENUM_ENTRY"] = 7; - values[valuesById[8] = "TARGET_TYPE_SERVICE"] = 8; - values[valuesById[9] = "TARGET_TYPE_METHOD"] = 9; - return values; - })(); - - FieldOptions.EditionDefault = (function() { - - /** - * Properties of an EditionDefault. - * @memberof google.protobuf.FieldOptions - * @interface IEditionDefault - * @property {google.protobuf.Edition|null} [edition] EditionDefault edition - * @property {string|null} [value] EditionDefault value - */ - - /** - * Constructs a new EditionDefault. - * @memberof google.protobuf.FieldOptions - * @classdesc Represents an EditionDefault. - * @implements IEditionDefault - * @constructor - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - */ - function EditionDefault(properties) { - if (properties) - for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) - if (properties[keys[i]] != null) - this[keys[i]] = properties[keys[i]]; - } - - /** - * EditionDefault edition. - * @member {google.protobuf.Edition} edition - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.edition = 0; - - /** - * EditionDefault value. - * @member {string} value - * @memberof google.protobuf.FieldOptions.EditionDefault - * @instance - */ - EditionDefault.prototype.value = ""; - - /** - * Creates a new EditionDefault instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault instance - */ - EditionDefault.create = function create(properties) { - return new EditionDefault(properties); - }; - - /** - * Encodes the specified EditionDefault message. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.value); - if (message.edition != null && Object.hasOwnProperty.call(message, "edition")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.edition); - return writer; - }; - - /** - * Encodes the specified EditionDefault message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.EditionDefault.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {google.protobuf.FieldOptions.IEditionDefault} message EditionDefault message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EditionDefault.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EditionDefault message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions.EditionDefault - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions.EditionDefault} EditionDefault - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EditionDefault.decode = function decode(reader, length, 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.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.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.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.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.type = (function() { - - /** - * Namespace type. - * @memberof google - * @namespace - */ - var type = {}; - - /** - * DayOfWeek enum. - * @name google.type.DayOfWeek - * @enum {number} - * @property {number} DAY_OF_WEEK_UNSPECIFIED=0 DAY_OF_WEEK_UNSPECIFIED value - * @property {number} MONDAY=1 MONDAY value - * @property {number} TUESDAY=2 TUESDAY value - * @property {number} WEDNESDAY=3 WEDNESDAY value - * @property {number} THURSDAY=4 THURSDAY value - * @property {number} FRIDAY=5 FRIDAY value - * @property {number} SATURDAY=6 SATURDAY value - * @property {number} SUNDAY=7 SUNDAY value - */ - type.DayOfWeek = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "DAY_OF_WEEK_UNSPECIFIED"] = 0; - values[valuesById[1] = "MONDAY"] = 1; - values[valuesById[2] = "TUESDAY"] = 2; - values[valuesById[3] = "WEDNESDAY"] = 3; - values[valuesById[4] = "THURSDAY"] = 4; - values[valuesById[5] = "FRIDAY"] = 5; - values[valuesById[6] = "SATURDAY"] = 6; - values[valuesById[7] = "SUNDAY"] = 7; - return values; - })(); - - /** - * Month enum. - * @name google.type.Month - * @enum {number} - * @property {number} MONTH_UNSPECIFIED=0 MONTH_UNSPECIFIED value - * @property {number} JANUARY=1 JANUARY value - * @property {number} FEBRUARY=2 FEBRUARY value - * @property {number} MARCH=3 MARCH value - * @property {number} APRIL=4 APRIL value - * @property {number} MAY=5 MAY value - * @property {number} JUNE=6 JUNE value - * @property {number} JULY=7 JULY value - * @property {number} AUGUST=8 AUGUST value - * @property {number} SEPTEMBER=9 SEPTEMBER value - * @property {number} OCTOBER=10 OCTOBER value - * @property {number} NOVEMBER=11 NOVEMBER value - * @property {number} DECEMBER=12 DECEMBER value - */ - type.Month = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "MONTH_UNSPECIFIED"] = 0; - values[valuesById[1] = "JANUARY"] = 1; - values[valuesById[2] = "FEBRUARY"] = 2; - values[valuesById[3] = "MARCH"] = 3; - values[valuesById[4] = "APRIL"] = 4; - values[valuesById[5] = "MAY"] = 5; - values[valuesById[6] = "JUNE"] = 6; - values[valuesById[7] = "JULY"] = 7; - values[valuesById[8] = "AUGUST"] = 8; - values[valuesById[9] = "SEPTEMBER"] = 9; - values[valuesById[10] = "OCTOBER"] = 10; - values[valuesById[11] = "NOVEMBER"] = 11; - values[valuesById[12] = "DECEMBER"] = 12; - return values; - })(); - - return type; - })(); - - 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.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; - })(); - - return google; - })(); - - return $root; -}); diff --git a/owl-bot-staging/google-cloud-backupdr/protos/protos.json b/owl-bot-staging/google-cloud-backupdr/protos/protos.json deleted file mode 100644 index 44ce9ef7529..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/protos/protos.json +++ /dev/null @@ -1,9151 +0,0 @@ -{ - "nested": { - "google": { - "nested": { - "cloud": { - "nested": { - "backupdr": { - "nested": { - "v1": { - "options": { - "csharp_namespace": "Google.Cloud.BackupDR.V1", - "go_package": "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb", - "java_multiple_files": true, - "java_outer_classname": "ProtectionSummaryProto", - "java_package": "com.google.cloud.backupdr.v1", - "php_namespace": "Google\\Cloud\\BackupDR\\V1", - "ruby_package": "Google::Cloud::BackupDR::V1", - "(google.api.resource_definition).type": "compute.googleapis.com/StoragePool", - "(google.api.resource_definition).pattern": "projects/{project}/zones/{zone}/storagePools/{storage_pool}" - }, - "nested": { - "BackupDR": { - "options": { - "(google.api.default_host)": "backupdr.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListManagementServers": { - "requestType": "ListManagementServersRequest", - "responseType": "ListManagementServersResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/managementServers", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/managementServers" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetManagementServer": { - "requestType": "GetManagementServerRequest", - "responseType": "ManagementServer", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/managementServers/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/managementServers/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "CreateManagementServer": { - "requestType": "CreateManagementServerRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/managementServers", - "(google.api.http).body": "management_server", - "(google.api.method_signature)": "parent,management_server,management_server_id", - "(google.longrunning.operation_info).response_type": "ManagementServer", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/managementServers", - "body": "management_server" - } - }, - { - "(google.api.method_signature)": "parent,management_server,management_server_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "ManagementServer", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteManagementServer": { - "requestType": "DeleteManagementServerRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/managementServers/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/managementServers/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateBackupVault": { - "requestType": "CreateBackupVaultRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupVaults", - "(google.api.http).body": "backup_vault", - "(google.api.method_signature)": "parent,backup_vault,backup_vault_id", - "(google.longrunning.operation_info).response_type": "BackupVault", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/backupVaults", - "body": "backup_vault" - } - }, - { - "(google.api.method_signature)": "parent,backup_vault,backup_vault_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupVault", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListBackupVaults": { - "requestType": "ListBackupVaultsRequest", - "responseType": "ListBackupVaultsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/backupVaults" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "FetchUsableBackupVaults": { - "requestType": "FetchUsableBackupVaultsRequest", - "responseType": "FetchUsableBackupVaultsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/backupVaults:fetchUsable" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetBackupVault": { - "requestType": "GetBackupVaultRequest", - "responseType": "BackupVault", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backupVaults/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBackupVault": { - "requestType": "UpdateBackupVaultRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", - "(google.api.http).body": "backup_vault", - "(google.api.method_signature)": "backup_vault,update_mask", - "(google.longrunning.operation_info).response_type": "BackupVault", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup_vault.name=projects/*/locations/*/backupVaults/*}", - "body": "backup_vault" - } - }, - { - "(google.api.method_signature)": "backup_vault,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupVault", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteBackupVault": { - "requestType": "DeleteBackupVaultRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/backupVaults/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListDataSources": { - "requestType": "ListDataSourcesRequest", - "responseType": "ListDataSourcesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/backupVaults/*}/dataSources" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "GetDataSource": { - "requestType": "GetDataSourceRequest", - "responseType": "DataSource", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateDataSource": { - "requestType": "UpdateDataSourceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", - "(google.api.http).body": "data_source", - "(google.api.method_signature)": "data_source,update_mask", - "(google.longrunning.operation_info).response_type": "DataSource", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{data_source.name=projects/*/locations/*/backupVaults/*/dataSources/*}", - "body": "data_source" - } - }, - { - "(google.api.method_signature)": "data_source,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "DataSource", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "ListBackups": { - "requestType": "ListBackupsRequest", - "responseType": "ListBackupsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "FetchBackupsForResourceType": { - "requestType": "FetchBackupsForResourceTypeRequest", - "responseType": "FetchBackupsForResourceTypeResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType", - "(google.api.method_signature)": "parent,resource_type" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/backupVaults/*/dataSources/*}/backups:fetchForResourceType" - } - }, - { - "(google.api.method_signature)": "parent,resource_type" - } - ] - }, - "GetBackup": { - "requestType": "GetBackupRequest", - "responseType": "Backup", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "UpdateBackup": { - "requestType": "UpdateBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", - "(google.api.http).body": "backup", - "(google.api.method_signature)": "backup,update_mask", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup.name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", - "body": "backup" - } - }, - { - "(google.api.method_signature)": "backup,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "DeleteBackup": { - "requestType": "DeleteBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "Backup", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "Backup", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "RestoreBackup": { - "requestType": "RestoreBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "RestoreBackupResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/backupVaults/*/dataSources/*/backups/*}:restore", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "RestoreBackupResponse", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "CreateBackupPlan": { - "requestType": "CreateBackupPlanRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlans", - "(google.api.http).body": "backup_plan", - "(google.api.method_signature)": "parent,backup_plan,backup_plan_id", - "(google.longrunning.operation_info).response_type": "BackupPlan", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/backupPlans", - "body": "backup_plan" - } - }, - { - "(google.api.method_signature)": "parent,backup_plan,backup_plan_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupPlan", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateBackupPlan": { - "requestType": "UpdateBackupPlanRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}", - "(google.api.http).body": "backup_plan", - "(google.api.method_signature)": "backup_plan,update_mask", - "(google.longrunning.operation_info).response_type": "BackupPlan", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup_plan.name=projects/*/locations/*/backupPlans/*}", - "body": "backup_plan" - } - }, - { - "(google.api.method_signature)": "backup_plan,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupPlan", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetBackupPlan": { - "requestType": "GetBackupPlanRequest", - "responseType": "BackupPlan", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backupPlans/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackupPlans": { - "requestType": "ListBackupPlansRequest", - "responseType": "ListBackupPlansResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlans", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/backupPlans" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "DeleteBackupPlan": { - "requestType": "DeleteBackupPlanRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlans/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/backupPlans/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetBackupPlanRevision": { - "requestType": "GetBackupPlanRevisionRequest", - "responseType": "BackupPlanRevision", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlans/*/revisions/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backupPlans/*/revisions/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackupPlanRevisions": { - "requestType": "ListBackupPlanRevisionsRequest", - "responseType": "ListBackupPlanRevisionsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*/backupPlans/*}/revisions", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*/backupPlans/*}/revisions" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "CreateBackupPlanAssociation": { - "requestType": "CreateBackupPlanAssociationRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", - "(google.api.http).body": "backup_plan_association", - "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id", - "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", - "body": "backup_plan_association" - } - }, - { - "(google.api.method_signature)": "parent,backup_plan_association,backup_plan_association_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupPlanAssociation", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "UpdateBackupPlanAssociation": { - "requestType": "UpdateBackupPlanAssociationRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).patch": "/v1/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}", - "(google.api.http).body": "backup_plan_association", - "(google.api.method_signature)": "backup_plan_association,update_mask", - "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "patch": "/v1/{backup_plan_association.name=projects/*/locations/*/backupPlanAssociations/*}", - "body": "backup_plan_association" - } - }, - { - "(google.api.method_signature)": "backup_plan_association,update_mask" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupPlanAssociation", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetBackupPlanAssociation": { - "requestType": "GetBackupPlanAssociationRequest", - "responseType": "BackupPlanAssociation", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListBackupPlanAssociations": { - "requestType": "ListBackupPlanAssociationsRequest", - "responseType": "ListBackupPlanAssociationsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "FetchBackupPlanAssociationsForResourceType": { - "requestType": "FetchBackupPlanAssociationsForResourceTypeRequest", - "responseType": "FetchBackupPlanAssociationsForResourceTypeResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType", - "(google.api.method_signature)": "parent,resource_type" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/backupPlanAssociations:fetchForResourceType" - } - }, - { - "(google.api.method_signature)": "parent,resource_type" - } - ] - }, - "DeleteBackupPlanAssociation": { - "requestType": "DeleteBackupPlanAssociationRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}", - "(google.api.method_signature)": "name", - "(google.longrunning.operation_info).response_type": "google.protobuf.Empty", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "delete": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}" - } - }, - { - "(google.api.method_signature)": "name" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "google.protobuf.Empty", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "TriggerBackup": { - "requestType": "TriggerBackupRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", - "(google.api.http).body": "*", - "(google.api.method_signature)": "name,rule_id", - "(google.longrunning.operation_info).response_type": "BackupPlanAssociation", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/backupPlanAssociations/*}:triggerBackup", - "body": "*" - } - }, - { - "(google.api.method_signature)": "name,rule_id" - }, - { - "(google.longrunning.operation_info)": { - "response_type": "BackupPlanAssociation", - "metadata_type": "OperationMetadata" - } - } - ] - }, - "GetDataSourceReference": { - "requestType": "GetDataSourceReferenceRequest", - "responseType": "DataSourceReference", - "options": { - "(google.api.http).get": "/v1/{name=projects/*/locations/*/dataSourceReferences/*}", - "(google.api.method_signature)": "name" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{name=projects/*/locations/*/dataSourceReferences/*}" - } - }, - { - "(google.api.method_signature)": "name" - } - ] - }, - "ListDataSourceReferences": { - "requestType": "ListDataSourceReferencesRequest", - "responseType": "ListDataSourceReferencesResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - }, - "FetchDataSourceReferencesForResourceType": { - "requestType": "FetchDataSourceReferencesForResourceTypeRequest", - "responseType": "FetchDataSourceReferencesForResourceTypeResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences:fetchForResourceType", - "(google.api.method_signature)": "parent,resource_type" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/dataSourceReferences:fetchForResourceType" - } - }, - { - "(google.api.method_signature)": "parent,resource_type" - } - ] - }, - "InitializeService": { - "requestType": "InitializeServiceRequest", - "responseType": "google.longrunning.Operation", - "options": { - "(google.api.http).post": "/v1/{name=projects/*/locations/*/serviceConfig}:initialize", - "(google.api.http).body": "*", - "(google.longrunning.operation_info).response_type": "InitializeServiceResponse", - "(google.longrunning.operation_info).metadata_type": "OperationMetadata" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "post": "/v1/{name=projects/*/locations/*/serviceConfig}:initialize", - "body": "*" - } - }, - { - "(google.longrunning.operation_info)": { - "response_type": "InitializeServiceResponse", - "metadata_type": "OperationMetadata" - } - } - ] - } - } - }, - "NetworkConfig": { - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "peeringMode": { - "type": "PeeringMode", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "PeeringMode": { - "values": { - "PEERING_MODE_UNSPECIFIED": 0, - "PRIVATE_SERVICE_ACCESS": 1 - } - } - } - }, - "ManagementURI": { - "fields": { - "webUi": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "api": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WorkforceIdentityBasedManagementURI": { - "fields": { - "firstPartyManagementUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "thirdPartyManagementUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "WorkforceIdentityBasedOAuth2ClientID": { - "fields": { - "firstPartyOauth2ClientId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "thirdPartyOauth2ClientId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "ManagementServer": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/ManagementServer", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/managementServers/{managementserver}", - "(google.api.resource).plural": "managementServers", - "(google.api.resource).singular": "managementServer" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "InstanceType", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "managementUri": { - "type": "ManagementURI", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "workforceIdentityBasedManagementUri": { - "type": "WorkforceIdentityBasedManagementURI", - "id": 16, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "InstanceState", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "networks": { - "rule": "repeated", - "type": "NetworkConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "oauth2ClientId": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "workforceIdentityBasedOauth2ClientId": { - "type": "WorkforceIdentityBasedOAuth2ClientID", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "baProxyUri": { - "rule": "repeated", - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "google.protobuf.BoolValue", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "InstanceType": { - "values": { - "INSTANCE_TYPE_UNSPECIFIED": 0, - "BACKUP_RESTORE": 1 - } - }, - "InstanceState": { - "values": { - "INSTANCE_STATE_UNSPECIFIED": 0, - "CREATING": 1, - "READY": 2, - "UPDATING": 3, - "DELETING": 4, - "REPAIRING": 5, - "MAINTENANCE": 6, - "ERROR": 7 - } - } - } - }, - "ListManagementServersRequest": { - "oneofs": { - "_filter": { - "oneof": [ - "filter" - ] - }, - "_orderBy": { - "oneof": [ - "orderBy" - ] - } - }, - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" - } - }, - "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", - "proto3_optional": true - } - }, - "orderBy": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "ListManagementServersResponse": { - "fields": { - "managementServers": { - "rule": "repeated", - "type": "ManagementServer", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetManagementServerRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" - } - } - } - }, - "CreateManagementServerRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/ManagementServer" - } - }, - "managementServerId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "managementServer": { - "type": "ManagementServer", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteManagementServerRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/ManagementServer" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InitializeServiceRequest": { - "oneofs": { - "initializationConfig": { - "oneof": [ - "cloudSqlInstanceInitializationConfig" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resourceType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "cloudSqlInstanceInitializationConfig": { - "type": "CloudSqlInstanceInitializationConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "InitializeServiceResponse": { - "fields": { - "backupVaultName": { - "type": "string", - "id": 1 - }, - "backupPlanName": { - "type": "string", - "id": 2 - } - } - }, - "OperationMetadata": { - "fields": { - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "endTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "target": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "verb": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "statusMessage": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "requestedCancellation": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "apiVersion": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "additionalInfo": { - "keyType": "string", - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupPlan": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/BackupPlan", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}", - "(google.api.resource).plural": "backupPlans", - "(google.api.resource).singular": "backupPlan" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "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" - } - }, - "backupRules": { - "rule": "repeated", - "type": "BackupRule", - "id": 6, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceType": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "etag": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "backupVault": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" - } - }, - "backupVaultServiceAccount": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "logRetentionDays": { - "type": "int64", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "supportedResourceTypes": { - "rule": "repeated", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revisionId": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "revisionName": { - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3, - "INACTIVE": 4, - "UPDATING": 5 - } - } - } - }, - "BackupRule": { - "oneofs": { - "backupScheduleOneof": { - "oneof": [ - "standardSchedule" - ] - } - }, - "fields": { - "ruleId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IMMUTABLE" - } - }, - "backupRetentionDays": { - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "standardSchedule": { - "type": "StandardSchedule", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "StandardSchedule": { - "fields": { - "recurrenceType": { - "type": "RecurrenceType", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "hourlyFrequency": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "daysOfWeek": { - "rule": "repeated", - "type": "google.type.DayOfWeek", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "daysOfMonth": { - "rule": "repeated", - "type": "int32", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "weekDayOfMonth": { - "type": "WeekDayOfMonth", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "months": { - "rule": "repeated", - "type": "google.type.Month", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "backupWindow": { - "type": "BackupWindow", - "id": 7, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "timeZone": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "RecurrenceType": { - "values": { - "RECURRENCE_TYPE_UNSPECIFIED": 0, - "HOURLY": 1, - "DAILY": 2, - "WEEKLY": 3, - "MONTHLY": 4, - "YEARLY": 5 - } - } - } - }, - "BackupWindow": { - "fields": { - "startHourOfDay": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "endHourOfDay": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "WeekDayOfMonth": { - "fields": { - "weekOfMonth": { - "type": "WeekOfMonth", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "dayOfWeek": { - "type": "google.type.DayOfWeek", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "WeekOfMonth": { - "values": { - "WEEK_OF_MONTH_UNSPECIFIED": 0, - "FIRST": 1, - "SECOND": 2, - "THIRD": 3, - "FOURTH": 4, - "LAST": 5 - } - } - } - }, - "CreateBackupPlanRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" - } - }, - "backupPlanId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupPlan": { - "type": "BackupPlan", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupPlansRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlan" - } - }, - "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" - } - } - } - }, - "ListBackupPlansResponse": { - "fields": { - "backupPlans": { - "rule": "repeated", - "type": "BackupPlan", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetBackupPlanRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" - } - } - } - }, - "DeleteBackupPlanRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupPlanRequest": { - "fields": { - "backupPlan": { - "type": "BackupPlan", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "BackupPlanRevision": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/BackupPlanRevision", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}", - "(google.api.resource).plural": "backupPlanRevisions", - "(google.api.resource).singular": "backupPlanRevision" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "revisionId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupPlanSnapshot": { - "type": "BackupPlan", - "id": 4 - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3, - "INACTIVE": 4 - } - } - } - }, - "GetBackupPlanRevisionRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanRevision" - } - } - } - }, - "ListBackupPlanRevisionsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanRevision" - } - }, - "pageSize": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupPlanRevisionsResponse": { - "fields": { - "backupPlanRevisions": { - "rule": "repeated", - "type": "BackupPlanRevision", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "BackupPlanAssociation": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/BackupPlanAssociation", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}", - "(google.api.resource).plural": "backupPlanAssociations", - "(google.api.resource).singular": "backupPlanAssociation" - }, - "oneofs": { - "resourceProperties": { - "oneof": [ - "cloudSqlInstanceBackupPlanAssociationProperties" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "resource": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupPlan": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "rulesConfigInfo": { - "rule": "repeated", - "type": "RuleConfigInfo", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataSource": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudSqlInstanceBackupPlanAssociationProperties": { - "type": "CloudSqlInstanceBackupPlanAssociationProperties", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupPlanRevisionId": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupPlanRevisionName": { - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3, - "INACTIVE": 4, - "UPDATING": 5 - } - } - } - }, - "RuleConfigInfo": { - "fields": { - "ruleId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastBackupState": { - "type": "LastBackupState", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastBackupError": { - "type": "google.rpc.Status", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastSuccessfulBackupConsistencyTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "LastBackupState": { - "values": { - "LAST_BACKUP_STATE_UNSPECIFIED": 0, - "FIRST_BACKUP_PENDING": 1, - "PERMISSION_DENIED": 2, - "SUCCEEDED": 3, - "FAILED": 4 - } - } - } - }, - "CreateBackupPlanAssociationRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" - } - }, - "backupPlanAssociationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupPlanAssociation": { - "type": "BackupPlanAssociation", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupPlanAssociationsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" - } - }, - "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" - } - } - } - }, - "ListBackupPlanAssociationsResponse": { - "fields": { - "backupPlanAssociations": { - "rule": "repeated", - "type": "BackupPlanAssociation", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "FetchBackupPlanAssociationsForResourceTypeRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupPlanAssociation" - } - }, - "resourceType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchBackupPlanAssociationsForResourceTypeResponse": { - "fields": { - "backupPlanAssociations": { - "rule": "repeated", - "type": "BackupPlanAssociation", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "nextPageToken": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetBackupPlanAssociationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" - } - } - } - }, - "DeleteBackupPlanAssociationRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupPlanAssociationRequest": { - "fields": { - "backupPlanAssociation": { - "type": "BackupPlanAssociation", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "TriggerBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" - } - }, - "ruleId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "CloudSqlInstanceDataSourceProperties": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "sqladmin.googleapis.com/Instance" - } - }, - "databaseInstalledVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceTier": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CloudSqlInstanceBackupProperties": { - "fields": { - "databaseInstalledVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "finalBackup": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "sourceInstance": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "sqladmin.googleapis.com/Instance" - } - }, - "instanceCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceTier": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceDeleteTime": { - "type": "google.protobuf.Timestamp", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CloudSqlInstanceDataSourceReferenceProperties": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "sqladmin.googleapis.com/Instance" - } - }, - "databaseInstalledVersion": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "instanceTier": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "CloudSqlInstanceInitializationConfig": { - "fields": { - "edition": { - "type": "Edition", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - }, - "nested": { - "Edition": { - "values": { - "EDITION_UNSPECIFIED": 0, - "ENTERPRISE": 1, - "ENTERPRISE_PLUS": 2 - } - } - } - }, - "CloudSqlInstanceBackupPlanAssociationProperties": { - "fields": { - "instanceCreateTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupVault": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/BackupVault", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}", - "(google.api.resource).plural": "backupVaults", - "(google.api.resource).singular": "backupVault" - }, - "oneofs": { - "_description": { - "oneof": [ - "description" - ] - }, - "_createTime": { - "oneof": [ - "createTime" - ] - }, - "_updateTime": { - "oneof": [ - "updateTime" - ] - }, - "_backupMinimumEnforcedRetentionDuration": { - "oneof": [ - "backupMinimumEnforcedRetentionDuration" - ] - }, - "_backupRetentionInheritance": { - "oneof": [ - "backupRetentionInheritance" - ] - }, - "_deletable": { - "oneof": [ - "deletable" - ] - }, - "_etag": { - "oneof": [ - "etag" - ] - }, - "_effectiveTime": { - "oneof": [ - "effectiveTime" - ] - }, - "_encryptionConfig": { - "oneof": [ - "encryptionConfig" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "backupMinimumEnforcedRetentionDuration": { - "type": "google.protobuf.Duration", - "id": 20, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "backupRetentionInheritance": { - "type": "BackupRetentionInheritance", - "id": 27, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "deletable": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "etag": { - "type": "string", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "state": { - "type": "State", - "id": 10, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "effectiveTime": { - "type": "google.protobuf.Timestamp", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "backupCount": { - "type": "int64", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "serviceAccount": { - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "totalStoredBytes": { - "type": "int64", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "uid": { - "type": "string", - "id": 21, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "annotations": { - "keyType": "string", - "type": "string", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "accessRestriction": { - "type": "AccessRestriction", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "encryptionConfig": { - "type": "EncryptionConfig", - "id": 29, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "BackupRetentionInheritance": { - "values": { - "BACKUP_RETENTION_INHERITANCE_UNSPECIFIED": 0, - "INHERIT_VAULT_RETENTION": 1, - "MATCH_BACKUP_EXPIRE_TIME": 2 - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3, - "ERROR": 4, - "UPDATING": 5 - } - }, - "AccessRestriction": { - "values": { - "ACCESS_RESTRICTION_UNSPECIFIED": 0, - "WITHIN_PROJECT": 1, - "WITHIN_ORGANIZATION": 2, - "UNRESTRICTED": 3, - "WITHIN_ORG_BUT_UNRESTRICTED_FOR_BA": 4 - } - }, - "EncryptionConfig": { - "oneofs": { - "_kmsKeyName": { - "oneof": [ - "kmsKeyName" - ] - } - }, - "fields": { - "kmsKeyName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKey", - "proto3_optional": true - } - } - } - } - } - }, - "DataSource": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/DataSource", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}", - "(google.api.resource).plural": "dataSources", - "(google.api.resource).singular": "dataSource" - }, - "oneofs": { - "_createTime": { - "oneof": [ - "createTime" - ] - }, - "_updateTime": { - "oneof": [ - "updateTime" - ] - }, - "_backupCount": { - "oneof": [ - "backupCount" - ] - }, - "_etag": { - "oneof": [ - "etag" - ] - }, - "_totalStoredBytes": { - "oneof": [ - "totalStoredBytes" - ] - }, - "sourceResource": { - "oneof": [ - "dataSourceGcpResource", - "dataSourceBackupApplianceApplication" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "state": { - "type": "State", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "backupCount": { - "type": "int64", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "etag": { - "type": "string", - "id": 14, - "options": { - "proto3_optional": true - } - }, - "totalStoredBytes": { - "type": "int64", - "id": 23, - "options": { - "proto3_optional": true - } - }, - "configState": { - "type": "BackupConfigState", - "id": 24, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupConfigInfo": { - "type": "BackupConfigInfo", - "id": 25, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataSourceGcpResource": { - "type": "DataSourceGcpResource", - "id": 26 - }, - "dataSourceBackupApplianceApplication": { - "type": "DataSourceBackupApplianceApplication", - "id": 27 - }, - "backupBlockedByVaultAccessRestriction": { - "type": "bool", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3, - "ERROR": 4 - } - } - } - }, - "BackupConfigInfo": { - "oneofs": { - "backupConfig": { - "oneof": [ - "gcpBackupConfig", - "backupApplianceBackupConfig" - ] - } - }, - "fields": { - "lastBackupState": { - "type": "LastBackupState", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastSuccessfulBackupConsistencyTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastBackupError": { - "type": "google.rpc.Status", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "gcpBackupConfig": { - "type": "GcpBackupConfig", - "id": 4 - }, - "backupApplianceBackupConfig": { - "type": "BackupApplianceBackupConfig", - "id": 5 - } - }, - "nested": { - "LastBackupState": { - "values": { - "LAST_BACKUP_STATE_UNSPECIFIED": 0, - "FIRST_BACKUP_PENDING": 1, - "SUCCEEDED": 2, - "FAILED": 3, - "PERMISSION_DENIED": 4 - } - } - } - }, - "GcpBackupConfig": { - "fields": { - "backupPlan": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" - } - }, - "backupPlanDescription": { - "type": "string", - "id": 2 - }, - "backupPlanAssociation": { - "type": "string", - "id": 3, - "options": { - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlanAssociation" - } - }, - "backupPlanRules": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "backupPlanRevisionName": { - "type": "string", - "id": 5 - }, - "backupPlanRevisionId": { - "type": "string", - "id": 6 - } - } - }, - "BackupApplianceBackupConfig": { - "fields": { - "backupApplianceName": { - "type": "string", - "id": 1 - }, - "backupApplianceId": { - "type": "int64", - "id": 2 - }, - "slaId": { - "type": "int64", - "id": 3 - }, - "applicationName": { - "type": "string", - "id": 4 - }, - "hostName": { - "type": "string", - "id": 5 - }, - "sltName": { - "type": "string", - "id": 6 - }, - "slpName": { - "type": "string", - "id": 7 - } - } - }, - "DataSourceGcpResource": { - "oneofs": { - "gcpResourceProperties": { - "oneof": [ - "computeInstanceDatasourceProperties", - "cloudSqlInstanceDatasourceProperties", - "diskDatasourceProperties" - ] - } - }, - "fields": { - "gcpResourcename": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "location": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "computeInstanceDatasourceProperties": { - "type": "ComputeInstanceDataSourceProperties", - "id": 4 - }, - "cloudSqlInstanceDatasourceProperties": { - "type": "CloudSqlInstanceDataSourceProperties", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "diskDatasourceProperties": { - "type": "DiskDataSourceProperties", - "id": 7 - } - } - }, - "DataSourceBackupApplianceApplication": { - "fields": { - "applicationName": { - "type": "string", - "id": 1 - }, - "backupAppliance": { - "type": "string", - "id": 2 - }, - "applianceId": { - "type": "int64", - "id": 3 - }, - "type": { - "type": "string", - "id": 4 - }, - "applicationId": { - "type": "int64", - "id": 8 - }, - "hostname": { - "type": "string", - "id": 6 - }, - "hostId": { - "type": "int64", - "id": 7 - } - } - }, - "ServiceLockInfo": { - "fields": { - "operation": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupApplianceLockInfo": { - "oneofs": { - "lockSource": { - "oneof": [ - "jobName", - "backupImage", - "slaId" - ] - } - }, - "fields": { - "backupApplianceId": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupApplianceName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "lockReason": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "jobName": { - "type": "string", - "id": 6 - }, - "backupImage": { - "type": "string", - "id": 7 - }, - "slaId": { - "type": "int64", - "id": 8 - } - } - }, - "BackupLock": { - "oneofs": { - "ClientLockInfo": { - "oneof": [ - "backupApplianceLockInfo", - "serviceLockInfo" - ] - } - }, - "fields": { - "lockUntilTime": { - "type": "google.protobuf.Timestamp", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupApplianceLockInfo": { - "type": "BackupApplianceLockInfo", - "id": 3 - }, - "serviceLockInfo": { - "type": "ServiceLockInfo", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "Backup": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/Backup", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}", - "(google.api.resource).plural": "backups", - "(google.api.resource).singular": "backup" - }, - "oneofs": { - "_description": { - "oneof": [ - "description" - ] - }, - "_createTime": { - "oneof": [ - "createTime" - ] - }, - "_updateTime": { - "oneof": [ - "updateTime" - ] - }, - "_enforcedRetentionEndTime": { - "oneof": [ - "enforcedRetentionEndTime" - ] - }, - "_backupRetentionInheritance": { - "oneof": [ - "backupRetentionInheritance" - ] - }, - "_expireTime": { - "oneof": [ - "expireTime" - ] - }, - "_consistencyTime": { - "oneof": [ - "consistencyTime" - ] - }, - "_etag": { - "oneof": [ - "etag" - ] - }, - "backupProperties": { - "oneof": [ - "computeInstanceBackupProperties", - "cloudSqlInstanceBackupProperties", - "backupApplianceBackupProperties", - "diskBackupProperties" - ] - }, - "planInfo": { - "oneof": [ - "gcpBackupPlanInfo" - ] - }, - "_satisfiesPzs": { - "oneof": [ - "satisfiesPzs" - ] - }, - "_satisfiesPzi": { - "oneof": [ - "satisfiesPzi" - ] - }, - "sourceResource": { - "oneof": [ - "gcpResource" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "updateTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "enforcedRetentionEndTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "backupRetentionInheritance": { - "type": "BackupVault.BackupRetentionInheritance", - "id": 30, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "expireTime": { - "type": "google.protobuf.Timestamp", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "consistencyTime": { - "type": "google.protobuf.Timestamp", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "etag": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "state": { - "type": "State", - "id": 15, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "serviceLocks": { - "rule": "repeated", - "type": "BackupLock", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupApplianceLocks": { - "rule": "repeated", - "type": "BackupLock", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "computeInstanceBackupProperties": { - "type": "ComputeInstanceBackupProperties", - "id": 19, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudSqlInstanceBackupProperties": { - "type": "CloudSqlInstanceBackupProperties", - "id": 26, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupApplianceBackupProperties": { - "type": "BackupApplianceBackupProperties", - "id": 21, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "diskBackupProperties": { - "type": "DiskBackupProperties", - "id": 28, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupType": { - "type": "BackupType", - "id": 20, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "gcpBackupPlanInfo": { - "type": "GCPBackupPlanInfo", - "id": 22, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "resourceSizeBytes": { - "type": "int64", - "id": 23, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "satisfiesPzs": { - "type": "bool", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "satisfiesPzi": { - "type": "bool", - "id": 25, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "gcpResource": { - "type": "BackupGcpResource", - "id": 31, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "kmsKeyVersions": { - "rule": "repeated", - "type": "string", - "id": 33, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "cloudkms.googleapis.com/CryptoKeyVersion" - } - } - }, - "nested": { - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "CREATING": 1, - "ACTIVE": 2, - "DELETING": 3, - "ERROR": 4, - "UPLOADING": 5 - } - }, - "BackupType": { - "values": { - "BACKUP_TYPE_UNSPECIFIED": 0, - "SCHEDULED": 1, - "ON_DEMAND": 2, - "ON_DEMAND_OPERATIONAL": 3 - } - }, - "GCPBackupPlanInfo": { - "fields": { - "backupPlan": { - "type": "string", - "id": 1, - "options": { - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupPlan" - } - }, - "backupPlanRuleId": { - "type": "string", - "id": 2 - }, - "backupPlanRevisionName": { - "type": "string", - "id": 3 - }, - "backupPlanRevisionId": { - "type": "string", - "id": 4 - } - } - } - } - }, - "CreateBackupVaultRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" - } - }, - "backupVaultId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupVault": { - "type": "BackupVault", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupVaultsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" - } - }, - "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" - } - }, - "view": { - "type": "BackupVaultView", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupVaultsResponse": { - "fields": { - "backupVaults": { - "rule": "repeated", - "type": "BackupVault", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "FetchUsableBackupVaultsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/BackupVault" - } - }, - "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" - } - } - } - }, - "FetchUsableBackupVaultsResponse": { - "fields": { - "backupVaults": { - "rule": "repeated", - "type": "BackupVault", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "FetchBackupsForResourceTypeRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/Backup" - } - }, - "resourceType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "view": { - "type": "BackupView", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchBackupsForResourceTypeResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "GetBackupVaultRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" - } - }, - "view": { - "type": "BackupVaultView", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupVaultRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backupVault": { - "type": "BackupVault", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "validateOnly": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "force": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "forceUpdateAccessRestriction": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteBackupVaultRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/BackupVault" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "force": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "etag": { - "type": "string", - "id": 4 - }, - "validateOnly": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ignoreBackupPlanReferences": { - "type": "bool", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListDataSourcesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSource" - } - }, - "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" - } - } - } - }, - "ListDataSourcesResponse": { - "fields": { - "dataSources": { - "rule": "repeated", - "type": "DataSource", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetDataSourceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSource" - } - } - } - }, - "UpdateDataSourceRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "dataSource": { - "type": "DataSource", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "allowMissing": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/Backup" - } - }, - "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" - } - }, - "view": { - "type": "BackupView", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "ListBackupsResponse": { - "fields": { - "backups": { - "rule": "repeated", - "type": "Backup", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "GetBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" - } - }, - "view": { - "type": "BackupView", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "UpdateBackupRequest": { - "fields": { - "updateMask": { - "type": "google.protobuf.FieldMask", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "backup": { - "type": "Backup", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "requestId": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DeleteBackupRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "RestoreBackupRequest": { - "oneofs": { - "targetEnvironment": { - "oneof": [ - "computeInstanceTargetEnvironment", - "diskTargetEnvironment", - "regionDiskTargetEnvironment" - ] - }, - "instanceProperties": { - "oneof": [ - "computeInstanceRestoreProperties", - "diskRestoreProperties" - ] - }, - "_clearOverridesFieldMask": { - "oneof": [ - "clearOverridesFieldMask" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/Backup" - } - }, - "requestId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "computeInstanceTargetEnvironment": { - "type": "ComputeInstanceTargetEnvironment", - "id": 3 - }, - "diskTargetEnvironment": { - "type": "DiskTargetEnvironment", - "id": 5 - }, - "regionDiskTargetEnvironment": { - "type": "RegionDiskTargetEnvironment", - "id": 6 - }, - "computeInstanceRestoreProperties": { - "type": "ComputeInstanceRestoreProperties", - "id": 4 - }, - "diskRestoreProperties": { - "type": "DiskRestoreProperties", - "id": 7 - }, - "clearOverridesFieldMask": { - "type": "google.protobuf.FieldMask", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "RestoreBackupResponse": { - "fields": { - "targetResource": { - "type": "TargetResource", - "id": 1 - } - } - }, - "TargetResource": { - "oneofs": { - "targetResourceInfo": { - "oneof": [ - "gcpResource" - ] - } - }, - "fields": { - "gcpResource": { - "type": "GcpResource", - "id": 1 - } - } - }, - "GcpResource": { - "fields": { - "gcpResourcename": { - "type": "string", - "id": 1 - }, - "location": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - } - } - }, - "BackupGcpResource": { - "fields": { - "gcpResourcename": { - "type": "string", - "id": 1 - }, - "location": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - } - } - }, - "BackupConfigState": { - "values": { - "BACKUP_CONFIG_STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "PASSIVE": 2 - } - }, - "BackupView": { - "values": { - "BACKUP_VIEW_UNSPECIFIED": 0, - "BACKUP_VIEW_BASIC": 1, - "BACKUP_VIEW_FULL": 2 - } - }, - "BackupVaultView": { - "values": { - "BACKUP_VAULT_VIEW_UNSPECIFIED": 0, - "BACKUP_VAULT_VIEW_BASIC": 1, - "BACKUP_VAULT_VIEW_FULL": 2 - } - }, - "BackupApplianceBackupProperties": { - "oneofs": { - "_generationId": { - "oneof": [ - "generationId" - ] - }, - "_finalizeTime": { - "oneof": [ - "finalizeTime" - ] - }, - "_recoveryRangeStartTime": { - "oneof": [ - "recoveryRangeStartTime" - ] - }, - "_recoveryRangeEndTime": { - "oneof": [ - "recoveryRangeEndTime" - ] - } - }, - "fields": { - "generationId": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "finalizeTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "recoveryRangeStartTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "recoveryRangeEndTime": { - "type": "google.protobuf.Timestamp", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "DiskTargetEnvironment": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "zone": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "RegionDiskTargetEnvironment": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "region": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "replicaZones": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "DiskRestoreProperties": { - "oneofs": { - "_name": { - "oneof": [ - "name" - ] - }, - "_description": { - "oneof": [ - "description" - ] - }, - "_sizeGb": { - "oneof": [ - "sizeGb" - ] - }, - "_diskEncryptionKey": { - "oneof": [ - "diskEncryptionKey" - ] - }, - "_physicalBlockSizeBytes": { - "oneof": [ - "physicalBlockSizeBytes" - ] - }, - "_provisionedIops": { - "oneof": [ - "provisionedIops" - ] - }, - "_provisionedThroughput": { - "oneof": [ - "provisionedThroughput" - ] - }, - "_enableConfidentialCompute": { - "oneof": [ - "enableConfidentialCompute" - ] - }, - "_storagePool": { - "oneof": [ - "storagePool" - ] - }, - "_accessMode": { - "oneof": [ - "accessMode" - ] - }, - "_architecture": { - "oneof": [ - "architecture" - ] - }, - "_type": { - "oneof": [ - "type" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "description": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "sizeGb": { - "type": "int64", - "id": 3, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "licenses": { - "rule": "repeated", - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "guestOsFeature": { - "rule": "repeated", - "type": "GuestOsFeature", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "diskEncryptionKey": { - "type": "CustomerEncryptionKey", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "physicalBlockSizeBytes": { - "type": "int64", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "provisionedIops": { - "type": "int64", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "provisionedThroughput": { - "type": "int64", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "enableConfidentialCompute": { - "type": "bool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "storagePool": { - "type": "string", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "(google.api.resource_reference).type": "compute.googleapis.com/StoragePool", - "proto3_optional": true - } - }, - "accessMode": { - "type": "AccessMode", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "architecture": { - "type": "Architecture", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "resourcePolicy": { - "rule": "repeated", - "type": "string", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "type": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "resourceManagerTags": { - "keyType": "string", - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "AccessMode": { - "values": { - "READ_WRITE_SINGLE": 0, - "READ_WRITE_MANY": 1, - "READ_ONLY_MANY": 2 - } - }, - "Architecture": { - "values": { - "ARCHITECTURE_UNSPECIFIED": 0, - "X86_64": 1, - "ARM64": 2 - } - } - } - }, - "DiskBackupProperties": { - "oneofs": { - "_description": { - "oneof": [ - "description" - ] - }, - "_architecture": { - "oneof": [ - "architecture" - ] - }, - "_type": { - "oneof": [ - "type" - ] - }, - "_sizeGb": { - "oneof": [ - "sizeGb" - ] - }, - "_region": { - "oneof": [ - "region" - ] - }, - "_zone": { - "oneof": [ - "zone" - ] - }, - "_sourceDisk": { - "oneof": [ - "sourceDisk" - ] - } - }, - "fields": { - "description": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "licenses": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "guestOsFeature": { - "rule": "repeated", - "type": "GuestOsFeature", - "id": 3 - }, - "architecture": { - "type": "Architecture", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "type": { - "type": "string", - "id": 5, - "options": { - "proto3_optional": true - } - }, - "sizeGb": { - "type": "int64", - "id": 6, - "options": { - "proto3_optional": true - } - }, - "region": { - "type": "string", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "zone": { - "type": "string", - "id": 8, - "options": { - "proto3_optional": true - } - }, - "replicaZones": { - "rule": "repeated", - "type": "string", - "id": 9 - }, - "sourceDisk": { - "type": "string", - "id": 10, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "Architecture": { - "values": { - "ARCHITECTURE_UNSPECIFIED": 0, - "X86_64": 1, - "ARM64": 2 - } - } - } - }, - "DiskDataSourceProperties": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "type": { - "type": "string", - "id": 3 - }, - "sizeGb": { - "type": "int64", - "id": 4 - } - } - }, - "ComputeInstanceBackupProperties": { - "oneofs": { - "_description": { - "oneof": [ - "description" - ] - }, - "_tags": { - "oneof": [ - "tags" - ] - }, - "_machineType": { - "oneof": [ - "machineType" - ] - }, - "_canIpForward": { - "oneof": [ - "canIpForward" - ] - }, - "_metadata": { - "oneof": [ - "metadata" - ] - }, - "_scheduling": { - "oneof": [ - "scheduling" - ] - }, - "_minCpuPlatform": { - "oneof": [ - "minCpuPlatform" - ] - }, - "_keyRevocationActionType": { - "oneof": [ - "keyRevocationActionType" - ] - }, - "_sourceInstance": { - "oneof": [ - "sourceInstance" - ] - } - }, - "fields": { - "description": { - "type": "string", - "id": 1, - "options": { - "proto3_optional": true - } - }, - "tags": { - "type": "Tags", - "id": 2, - "options": { - "proto3_optional": true - } - }, - "machineType": { - "type": "string", - "id": 3, - "options": { - "proto3_optional": true - } - }, - "canIpForward": { - "type": "bool", - "id": 4, - "options": { - "proto3_optional": true - } - }, - "networkInterface": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 5 - }, - "disk": { - "rule": "repeated", - "type": "AttachedDisk", - "id": 6 - }, - "metadata": { - "type": "Metadata", - "id": 7, - "options": { - "proto3_optional": true - } - }, - "serviceAccount": { - "rule": "repeated", - "type": "ServiceAccount", - "id": 8 - }, - "scheduling": { - "type": "Scheduling", - "id": 9, - "options": { - "proto3_optional": true - } - }, - "guestAccelerator": { - "rule": "repeated", - "type": "AcceleratorConfig", - "id": 10 - }, - "minCpuPlatform": { - "type": "string", - "id": 11, - "options": { - "proto3_optional": true - } - }, - "keyRevocationActionType": { - "type": "KeyRevocationActionType", - "id": 12, - "options": { - "proto3_optional": true - } - }, - "sourceInstance": { - "type": "string", - "id": 13, - "options": { - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 14 - } - } - }, - "ComputeInstanceRestoreProperties": { - "oneofs": { - "_name": { - "oneof": [ - "name" - ] - }, - "_advancedMachineFeatures": { - "oneof": [ - "advancedMachineFeatures" - ] - }, - "_canIpForward": { - "oneof": [ - "canIpForward" - ] - }, - "_confidentialInstanceConfig": { - "oneof": [ - "confidentialInstanceConfig" - ] - }, - "_deletionProtection": { - "oneof": [ - "deletionProtection" - ] - }, - "_description": { - "oneof": [ - "description" - ] - }, - "_displayDevice": { - "oneof": [ - "displayDevice" - ] - }, - "_hostname": { - "oneof": [ - "hostname" - ] - }, - "_instanceEncryptionKey": { - "oneof": [ - "instanceEncryptionKey" - ] - }, - "_keyRevocationActionType": { - "oneof": [ - "keyRevocationActionType" - ] - }, - "_machineType": { - "oneof": [ - "machineType" - ] - }, - "_metadata": { - "oneof": [ - "metadata" - ] - }, - "_minCpuPlatform": { - "oneof": [ - "minCpuPlatform" - ] - }, - "_networkPerformanceConfig": { - "oneof": [ - "networkPerformanceConfig" - ] - }, - "_params": { - "oneof": [ - "params" - ] - }, - "_privateIpv6GoogleAccess": { - "oneof": [ - "privateIpv6GoogleAccess" - ] - }, - "_allocationAffinity": { - "oneof": [ - "allocationAffinity" - ] - }, - "_scheduling": { - "oneof": [ - "scheduling" - ] - }, - "_tags": { - "oneof": [ - "tags" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "proto3_optional": true - } - }, - "advancedMachineFeatures": { - "type": "AdvancedMachineFeatures", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "canIpForward": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "confidentialInstanceConfig": { - "type": "ConfidentialInstanceConfig", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "deletionProtection": { - "type": "bool", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "description": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "disks": { - "rule": "repeated", - "type": "AttachedDisk", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "displayDevice": { - "type": "DisplayDevice", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "guestAccelerators": { - "rule": "repeated", - "type": "AcceleratorConfig", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "hostname": { - "type": "string", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "instanceEncryptionKey": { - "type": "CustomerEncryptionKey", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "keyRevocationActionType": { - "type": "KeyRevocationActionType", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "labels": { - "keyType": "string", - "type": "string", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "machineType": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "metadata": { - "type": "Metadata", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "minCpuPlatform": { - "type": "string", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "networkInterfaces": { - "rule": "repeated", - "type": "NetworkInterface", - "id": 17, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "networkPerformanceConfig": { - "type": "NetworkPerformanceConfig", - "id": 18, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "params": { - "type": "InstanceParams", - "id": 19, - "options": { - "(google.api.field_behavior)": "INPUT_ONLY", - "proto3_optional": true - } - }, - "privateIpv6GoogleAccess": { - "type": "InstancePrivateIpv6GoogleAccess", - "id": 20, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "allocationAffinity": { - "type": "AllocationAffinity", - "id": 21, - "options": { - "json_name": "reservationAffinity", - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "resourcePolicies": { - "rule": "repeated", - "type": "string", - "id": 22, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "scheduling": { - "type": "Scheduling", - "id": 23, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "serviceAccounts": { - "rule": "repeated", - "type": "ServiceAccount", - "id": 24, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "tags": { - "type": "Tags", - "id": 26, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "InstancePrivateIpv6GoogleAccess": { - "values": { - "INSTANCE_PRIVATE_IPV6_GOOGLE_ACCESS_UNSPECIFIED": 0, - "INHERIT_FROM_SUBNETWORK": 1, - "ENABLE_OUTBOUND_VM_ACCESS_TO_GOOGLE": 2, - "ENABLE_BIDIRECTIONAL_ACCESS_TO_GOOGLE": 3 - } - } - } - }, - "ComputeInstanceTargetEnvironment": { - "fields": { - "project": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "zone": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - } - } - }, - "ComputeInstanceDataSourceProperties": { - "fields": { - "name": { - "type": "string", - "id": 1 - }, - "description": { - "type": "string", - "id": 2 - }, - "machineType": { - "type": "string", - "id": 3 - }, - "totalDiskCount": { - "type": "int64", - "id": 4 - }, - "totalDiskSizeGb": { - "type": "int64", - "id": 5 - } - } - }, - "AdvancedMachineFeatures": { - "oneofs": { - "_enableNestedVirtualization": { - "oneof": [ - "enableNestedVirtualization" - ] - }, - "_threadsPerCore": { - "oneof": [ - "threadsPerCore" - ] - }, - "_visibleCoreCount": { - "oneof": [ - "visibleCoreCount" - ] - }, - "_enableUefiNetworking": { - "oneof": [ - "enableUefiNetworking" - ] - } - }, - "fields": { - "enableNestedVirtualization": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "threadsPerCore": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "visibleCoreCount": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "enableUefiNetworking": { - "type": "bool", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "ConfidentialInstanceConfig": { - "oneofs": { - "_enableConfidentialCompute": { - "oneof": [ - "enableConfidentialCompute" - ] - } - }, - "fields": { - "enableConfidentialCompute": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "DisplayDevice": { - "oneofs": { - "_enableDisplay": { - "oneof": [ - "enableDisplay" - ] - } - }, - "fields": { - "enableDisplay": { - "type": "bool", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "AcceleratorConfig": { - "oneofs": { - "_acceleratorType": { - "oneof": [ - "acceleratorType" - ] - }, - "_acceleratorCount": { - "oneof": [ - "acceleratorCount" - ] - } - }, - "fields": { - "acceleratorType": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "acceleratorCount": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "CustomerEncryptionKey": { - "oneofs": { - "key": { - "oneof": [ - "rawKey", - "rsaEncryptedKey", - "kmsKeyName" - ] - }, - "_kmsKeyServiceAccount": { - "oneof": [ - "kmsKeyServiceAccount" - ] - } - }, - "fields": { - "rawKey": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "rsaEncryptedKey": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kmsKeyName": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "kmsKeyServiceAccount": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Entry": { - "oneofs": { - "_key": { - "oneof": [ - "key" - ] - }, - "_value": { - "oneof": [ - "value" - ] - } - }, - "fields": { - "key": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "value": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "Metadata": { - "fields": { - "items": { - "rule": "repeated", - "type": "Entry", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "NetworkInterface": { - "oneofs": { - "_network": { - "oneof": [ - "network" - ] - }, - "_subnetwork": { - "oneof": [ - "subnetwork" - ] - }, - "_ipAddress": { - "oneof": [ - "ipAddress" - ] - }, - "_ipv6Address": { - "oneof": [ - "ipv6Address" - ] - }, - "_internalIpv6PrefixLength": { - "oneof": [ - "internalIpv6PrefixLength" - ] - }, - "_name": { - "oneof": [ - "name" - ] - }, - "_stackType": { - "oneof": [ - "stackType" - ] - }, - "_ipv6AccessType": { - "oneof": [ - "ipv6AccessType" - ] - }, - "_queueCount": { - "oneof": [ - "queueCount" - ] - }, - "_nicType": { - "oneof": [ - "nicType" - ] - }, - "_networkAttachment": { - "oneof": [ - "networkAttachment" - ] - } - }, - "fields": { - "network": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "subnetwork": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ipAddress": { - "type": "string", - "id": 3, - "options": { - "json_name": "networkIP", - "(google.api.field_info).format": "IPV4", - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "ipv6Address": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_info).format": "IPV6", - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "internalIpv6PrefixLength": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "name": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "accessConfigs": { - "rule": "repeated", - "type": "AccessConfig", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "ipv6AccessConfigs": { - "rule": "repeated", - "type": "AccessConfig", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "aliasIpRanges": { - "rule": "repeated", - "type": "AliasIpRange", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "stackType": { - "type": "StackType", - "id": 10, - "options": { - "proto3_optional": true - } - }, - "ipv6AccessType": { - "type": "Ipv6AccessType", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "queueCount": { - "type": "int32", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "nicType": { - "type": "NicType", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "networkAttachment": { - "type": "string", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "StackType": { - "values": { - "STACK_TYPE_UNSPECIFIED": 0, - "IPV4_ONLY": 1, - "IPV4_IPV6": 2 - } - }, - "Ipv6AccessType": { - "values": { - "UNSPECIFIED_IPV6_ACCESS_TYPE": 0, - "INTERNAL": 1, - "EXTERNAL": 2 - } - }, - "NicType": { - "values": { - "NIC_TYPE_UNSPECIFIED": 0, - "VIRTIO_NET": 1, - "GVNIC": 2 - } - } - } - }, - "NetworkPerformanceConfig": { - "oneofs": { - "_totalEgressBandwidthTier": { - "oneof": [ - "totalEgressBandwidthTier" - ] - } - }, - "fields": { - "totalEgressBandwidthTier": { - "type": "Tier", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "Tier": { - "values": { - "TIER_UNSPECIFIED": 0, - "DEFAULT": 1, - "TIER_1": 2 - } - } - } - }, - "AccessConfig": { - "oneofs": { - "_type": { - "oneof": [ - "type" - ] - }, - "_name": { - "oneof": [ - "name" - ] - }, - "_externalIp": { - "oneof": [ - "externalIp" - ] - }, - "_externalIpv6": { - "oneof": [ - "externalIpv6" - ] - }, - "_externalIpv6PrefixLength": { - "oneof": [ - "externalIpv6PrefixLength" - ] - }, - "_setPublicPtr": { - "oneof": [ - "setPublicPtr" - ] - }, - "_publicPtrDomainName": { - "oneof": [ - "publicPtrDomainName" - ] - }, - "_networkTier": { - "oneof": [ - "networkTier" - ] - } - }, - "fields": { - "type": { - "type": "AccessType", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "name": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "externalIp": { - "type": "string", - "id": 3, - "options": { - "json_name": "natIP", - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "externalIpv6": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "externalIpv6PrefixLength": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "setPublicPtr": { - "type": "bool", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "publicPtrDomainName": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "networkTier": { - "type": "NetworkTier", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "AccessType": { - "values": { - "ACCESS_TYPE_UNSPECIFIED": 0, - "ONE_TO_ONE_NAT": 1, - "DIRECT_IPV6": 2 - } - }, - "NetworkTier": { - "values": { - "NETWORK_TIER_UNSPECIFIED": 0, - "PREMIUM": 1, - "STANDARD": 2 - } - } - } - }, - "AliasIpRange": { - "oneofs": { - "_ipCidrRange": { - "oneof": [ - "ipCidrRange" - ] - }, - "_subnetworkRangeName": { - "oneof": [ - "subnetworkRangeName" - ] - } - }, - "fields": { - "ipCidrRange": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "subnetworkRangeName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "InstanceParams": { - "fields": { - "resourceManagerTags": { - "keyType": "string", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AllocationAffinity": { - "oneofs": { - "_consumeAllocationType": { - "oneof": [ - "consumeAllocationType" - ] - }, - "_key": { - "oneof": [ - "key" - ] - } - }, - "fields": { - "consumeAllocationType": { - "type": "Type", - "id": 1, - "options": { - "json_name": "consumeReservationType", - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "key": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "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 - } - } - } - }, - "Scheduling": { - "oneofs": { - "_onHostMaintenance": { - "oneof": [ - "onHostMaintenance" - ] - }, - "_automaticRestart": { - "oneof": [ - "automaticRestart" - ] - }, - "_preemptible": { - "oneof": [ - "preemptible" - ] - }, - "_minNodeCpus": { - "oneof": [ - "minNodeCpus" - ] - }, - "_provisioningModel": { - "oneof": [ - "provisioningModel" - ] - }, - "_instanceTerminationAction": { - "oneof": [ - "instanceTerminationAction" - ] - }, - "_localSsdRecoveryTimeout": { - "oneof": [ - "localSsdRecoveryTimeout" - ] - } - }, - "fields": { - "onHostMaintenance": { - "type": "OnHostMaintenance", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "automaticRestart": { - "type": "bool", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "preemptible": { - "type": "bool", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "nodeAffinities": { - "rule": "repeated", - "type": "NodeAffinity", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "minNodeCpus": { - "type": "int32", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "provisioningModel": { - "type": "ProvisioningModel", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "instanceTerminationAction": { - "type": "InstanceTerminationAction", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "localSsdRecoveryTimeout": { - "type": "SchedulingDuration", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "OnHostMaintenance": { - "values": { - "ON_HOST_MAINTENANCE_UNSPECIFIED": 0, - "TERMINATE": 1, - "MIGRATE": 1000 - } - }, - "NodeAffinity": { - "oneofs": { - "_key": { - "oneof": [ - "key" - ] - }, - "_operator": { - "oneof": [ - "operator" - ] - } - }, - "fields": { - "key": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "operator": { - "type": "Operator", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "values": { - "rule": "repeated", - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - }, - "nested": { - "Operator": { - "values": { - "OPERATOR_UNSPECIFIED": 0, - "IN": 1, - "NOT_IN": 2 - } - } - } - }, - "ProvisioningModel": { - "values": { - "PROVISIONING_MODEL_UNSPECIFIED": 0, - "STANDARD": 1, - "SPOT": 2 - } - }, - "InstanceTerminationAction": { - "values": { - "INSTANCE_TERMINATION_ACTION_UNSPECIFIED": 0, - "DELETE": 1, - "STOP": 2 - } - } - } - }, - "SchedulingDuration": { - "oneofs": { - "_seconds": { - "oneof": [ - "seconds" - ] - }, - "_nanos": { - "oneof": [ - "nanos" - ] - } - }, - "fields": { - "seconds": { - "type": "int64", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "nanos": { - "type": "int32", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - } - }, - "ServiceAccount": { - "oneofs": { - "_email": { - "oneof": [ - "email" - ] - } - }, - "fields": { - "email": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "scopes": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "Tags": { - "fields": { - "items": { - "rule": "repeated", - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "AttachedDisk": { - "oneofs": { - "_initializeParams": { - "oneof": [ - "initializeParams" - ] - }, - "_deviceName": { - "oneof": [ - "deviceName" - ] - }, - "_kind": { - "oneof": [ - "kind" - ] - }, - "_diskTypeDeprecated": { - "oneof": [ - "diskTypeDeprecated" - ] - }, - "_mode": { - "oneof": [ - "mode" - ] - }, - "_source": { - "oneof": [ - "source" - ] - }, - "_index": { - "oneof": [ - "index" - ] - }, - "_boot": { - "oneof": [ - "boot" - ] - }, - "_autoDelete": { - "oneof": [ - "autoDelete" - ] - }, - "_diskInterface": { - "oneof": [ - "diskInterface" - ] - }, - "_diskEncryptionKey": { - "oneof": [ - "diskEncryptionKey" - ] - }, - "_diskSizeGb": { - "oneof": [ - "diskSizeGb" - ] - }, - "_savedState": { - "oneof": [ - "savedState" - ] - }, - "_diskType": { - "oneof": [ - "diskType" - ] - }, - "_type": { - "oneof": [ - "type" - ] - } - }, - "fields": { - "initializeParams": { - "type": "InitializeParams", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "deviceName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "kind": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "diskTypeDeprecated": { - "type": "DiskType", - "id": 6, - "options": { - "deprecated": true, - "proto3_optional": true - } - }, - "mode": { - "type": "DiskMode", - "id": 7, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "source": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "index": { - "type": "int64", - "id": 9, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "boot": { - "type": "bool", - "id": 10, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "autoDelete": { - "type": "bool", - "id": 11, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "license": { - "rule": "repeated", - "type": "string", - "id": 12, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "diskInterface": { - "type": "DiskInterface", - "id": 13, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "guestOsFeature": { - "rule": "repeated", - "type": "GuestOsFeature", - "id": 14, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "diskEncryptionKey": { - "type": "CustomerEncryptionKey", - "id": 15, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "diskSizeGb": { - "type": "int64", - "id": 16, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "savedState": { - "type": "DiskSavedState", - "id": 17, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "diskType": { - "type": "string", - "id": 18, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - }, - "type": { - "type": "DiskType", - "id": 19, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - } - }, - "nested": { - "InitializeParams": { - "oneofs": { - "_diskName": { - "oneof": [ - "diskName" - ] - } - }, - "fields": { - "diskName": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OPTIONAL", - "proto3_optional": true - } - }, - "replicaZones": { - "rule": "repeated", - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "DiskType": { - "values": { - "DISK_TYPE_UNSPECIFIED": 0, - "SCRATCH": 1, - "PERSISTENT": 2 - } - }, - "DiskMode": { - "values": { - "DISK_MODE_UNSPECIFIED": 0, - "READ_WRITE": 1, - "READ_ONLY": 2, - "LOCKED": 3 - } - }, - "DiskInterface": { - "values": { - "DISK_INTERFACE_UNSPECIFIED": 0, - "SCSI": 1, - "NVME": 2, - "NVDIMM": 3, - "ISCSI": 4 - } - }, - "DiskSavedState": { - "values": { - "DISK_SAVED_STATE_UNSPECIFIED": 0, - "PRESERVED": 1 - } - } - } - }, - "GuestOsFeature": { - "oneofs": { - "_type": { - "oneof": [ - "type" - ] - } - }, - "fields": { - "type": { - "type": "FeatureType", - "id": 1, - "options": { - "proto3_optional": true - } - } - }, - "nested": { - "FeatureType": { - "values": { - "FEATURE_TYPE_UNSPECIFIED": 0, - "VIRTIO_SCSI_MULTIQUEUE": 1, - "WINDOWS": 2, - "MULTI_IP_SUBNET": 3, - "UEFI_COMPATIBLE": 4, - "SECURE_BOOT": 5, - "GVNIC": 6, - "SEV_CAPABLE": 7, - "BARE_METAL_LINUX_COMPATIBLE": 8, - "SUSPEND_RESUME_COMPATIBLE": 9, - "SEV_LIVE_MIGRATABLE": 10, - "SEV_SNP_CAPABLE": 11, - "TDX_CAPABLE": 12, - "IDPF": 13, - "SEV_LIVE_MIGRATABLE_V2": 14 - } - } - } - }, - "KeyRevocationActionType": { - "values": { - "KEY_REVOCATION_ACTION_TYPE_UNSPECIFIED": 0, - "NONE": 1, - "STOP": 2 - } - }, - "DataSourceReference": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/DataSourceReference", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}", - "(google.api.resource).plural": "dataSourceReferences", - "(google.api.resource).singular": "dataSourceReference" - }, - "oneofs": { - "_totalStoredBytes": { - "oneof": [ - "totalStoredBytes" - ] - } - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "dataSource": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSource" - } - }, - "createTime": { - "type": "google.protobuf.Timestamp", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataSourceBackupConfigState": { - "type": "BackupConfigState", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataSourceBackupCount": { - "type": "int64", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataSourceBackupConfigInfo": { - "type": "DataSourceBackupConfigInfo", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "dataSourceGcpResourceInfo": { - "type": "DataSourceGcpResourceInfo", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "totalStoredBytes": { - "type": "int64", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY", - "proto3_optional": true - } - } - } - }, - "DataSourceBackupConfigInfo": { - "fields": { - "lastBackupState": { - "type": "BackupConfigInfo.LastBackupState", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastSuccessfulBackupConsistencyTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "DataSourceGcpResourceInfo": { - "oneofs": { - "resourceProperties": { - "oneof": [ - "cloudSqlInstanceProperties" - ] - } - }, - "fields": { - "gcpResourcename": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "location": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "cloudSqlInstanceProperties": { - "type": "CloudSqlInstanceDataSourceReferenceProperties", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "GetDataSourceReferenceRequest": { - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "backupdr.googleapis.com/DataSourceReference" - } - } - } - }, - "ListDataSourceReferencesRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSourceReference" - } - }, - "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" - } - } - } - }, - "ListDataSourceReferencesResponse": { - "fields": { - "dataSourceReferences": { - "rule": "repeated", - "type": "DataSourceReference", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - }, - "unreachable": { - "rule": "repeated", - "type": "string", - "id": 3 - } - } - }, - "FetchDataSourceReferencesForResourceTypeRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).child_type": "backupdr.googleapis.com/DataSourceReference" - } - }, - "resourceType": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "REQUIRED" - } - }, - "pageSize": { - "type": "int32", - "id": 3, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "pageToken": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "filter": { - "type": "string", - "id": 5, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - }, - "orderBy": { - "type": "string", - "id": 6, - "options": { - "(google.api.field_behavior)": "OPTIONAL" - } - } - } - }, - "FetchDataSourceReferencesForResourceTypeResponse": { - "fields": { - "dataSourceReferences": { - "rule": "repeated", - "type": "DataSourceReference", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "BackupDrProtectionSummary": { - "options": { - "(google.api.default_host)": "backupdr.googleapis.com", - "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" - }, - "methods": { - "ListResourceBackupConfigs": { - "requestType": "ListResourceBackupConfigsRequest", - "responseType": "ListResourceBackupConfigsResponse", - "options": { - "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs", - "(google.api.method_signature)": "parent" - }, - "parsedOptions": [ - { - "(google.api.http)": { - "get": "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs" - } - }, - { - "(google.api.method_signature)": "parent" - } - ] - } - } - }, - "ListResourceBackupConfigsRequest": { - "fields": { - "parent": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "REQUIRED", - "(google.api.resource_reference).type": "locations.googleapis.com/Location" - } - }, - "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" - } - } - } - }, - "ListResourceBackupConfigsResponse": { - "fields": { - "resourceBackupConfigs": { - "rule": "repeated", - "type": "ResourceBackupConfig", - "id": 1 - }, - "nextPageToken": { - "type": "string", - "id": 2 - } - } - }, - "ResourceBackupConfig": { - "options": { - "(google.api.resource).type": "backupdr.googleapis.com/ResourceBackupConfig", - "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}", - "(google.api.resource).plural": "resourceBackupConfigs", - "(google.api.resource).singular": "resourceBackupConfig" - }, - "fields": { - "name": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "IDENTIFIER" - } - }, - "uid": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_info).format": "UUID4", - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "targetResource": { - "type": "string", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "targetResourceDisplayName": { - "type": "string", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "targetResourceType": { - "type": "ResourceType", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "targetResourceLabels": { - "keyType": "string", - "type": "string", - "id": 6 - }, - "backupConfigsDetails": { - "rule": "repeated", - "type": "BackupConfigDetails", - "id": 7 - }, - "backupConfigured": { - "type": "bool", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "vaulted": { - "type": "bool", - "id": 9, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "ResourceType": { - "values": { - "RESOURCE_TYPE_UNSPECIFIED": 0, - "CLOUD_SQL_INSTANCE": 1, - "COMPUTE_ENGINE_VM": 2, - "COMPUTE_ENGINE_DISK": 3, - "COMPUTE_ENGINE_REGIONAL_DISK": 4 - } - } - } - }, - "BackupConfigDetails": { - "oneofs": { - "planSpecificConfig": { - "oneof": [ - "backupDrPlanConfig", - "backupDrTemplateConfig" - ] - } - }, - "fields": { - "backupConfigSource": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupConfigSourceDisplayName": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "type": { - "type": "Type", - "id": 3, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "state": { - "type": "State", - "id": 4, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "pitrSettings": { - "type": "PitrSettings", - "id": 5, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "latestSuccessfulBackupTime": { - "type": "google.protobuf.Timestamp", - "id": 6, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "applicableResource": { - "type": "string", - "id": 7, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupVault": { - "type": "string", - "id": 8, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "backupLocations": { - "rule": "repeated", - "type": "BackupLocation", - "id": 12 - }, - "backupDrPlanConfig": { - "type": "BackupDrPlanConfig", - "id": 10 - }, - "backupDrTemplateConfig": { - "type": "BackupDrTemplateConfig", - "id": 11 - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "CLOUD_SQL_INSTANCE_BACKUP_CONFIG": 1, - "COMPUTE_ENGINE_RESOURCE_POLICY": 2, - "BACKUPDR_BACKUP_PLAN": 3, - "BACKUPDR_TEMPLATE": 4 - } - }, - "State": { - "values": { - "STATE_UNSPECIFIED": 0, - "ACTIVE": 1, - "INACTIVE": 2, - "ERROR": 3 - } - } - } - }, - "PitrSettings": { - "fields": { - "retentionDays": { - "type": "int32", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupDrTemplateConfig": { - "fields": { - "firstPartyManagementUri": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "thirdPartyManagementUri": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupDrPlanConfig": { - "fields": { - "backupDrPlanRules": { - "rule": "repeated", - "type": "BackupDrPlanRule", - "id": 1 - } - } - }, - "BackupDrPlanRule": { - "fields": { - "ruleId": { - "type": "string", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "lastSuccessfulBackupTime": { - "type": "google.protobuf.Timestamp", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - } - }, - "BackupLocation": { - "fields": { - "type": { - "type": "Type", - "id": 1, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - }, - "locationId": { - "type": "string", - "id": 2, - "options": { - "(google.api.field_behavior)": "OUTPUT_ONLY" - } - } - }, - "nested": { - "Type": { - "values": { - "TYPE_UNSPECIFIED": 0, - "ZONAL": 1, - "REGIONAL": 2, - "MULTI_REGIONAL": 3 - } - } - } - } - } - } - } - } - } - }, - "api": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/api/annotations;annotations", - "java_multiple_files": true, - "java_outer_classname": "ResourceProto", - "java_package": "com.google.api", - "objc_class_prefix": "GAPI", - "cc_enable_arenas": true - }, - "nested": { - "http": { - "type": "HttpRule", - "id": 72295728, - "extend": "google.protobuf.MethodOptions" - }, - "Http": { - "fields": { - "rules": { - "rule": "repeated", - "type": "HttpRule", - "id": 1 - }, - "fullyDecodeReservedExpansion": { - "type": "bool", - "id": 2 - } - } - }, - "HttpRule": { - "oneofs": { - "pattern": { - "oneof": [ - "get", - "put", - "post", - "delete", - "patch", - "custom" - ] - } - }, - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "get": { - "type": "string", - "id": 2 - }, - "put": { - "type": "string", - "id": 3 - }, - "post": { - "type": "string", - "id": 4 - }, - "delete": { - "type": "string", - "id": 5 - }, - "patch": { - "type": "string", - "id": 6 - }, - "custom": { - "type": "CustomHttpPattern", - "id": 8 - }, - "body": { - "type": "string", - "id": 7 - }, - "responseBody": { - "type": "string", - "id": 12 - }, - "additionalBindings": { - "rule": "repeated", - "type": "HttpRule", - "id": 11 - } - } - }, - "CustomHttpPattern": { - "fields": { - "kind": { - "type": "string", - "id": 1 - }, - "path": { - "type": "string", - "id": 2 - } - } - }, - "methodSignature": { - "rule": "repeated", - "type": "string", - "id": 1051, - "extend": "google.protobuf.MethodOptions" - }, - "defaultHost": { - "type": "string", - "id": 1049, - "extend": "google.protobuf.ServiceOptions" - }, - "oauthScopes": { - "type": "string", - "id": 1050, - "extend": "google.protobuf.ServiceOptions" - }, - "apiVersion": { - "type": "string", - "id": 525000001, - "extend": "google.protobuf.ServiceOptions" - }, - "CommonLanguageSettings": { - "fields": { - "referenceDocsUri": { - "type": "string", - "id": 1, - "options": { - "deprecated": true - } - }, - "destinations": { - "rule": "repeated", - "type": "ClientLibraryDestination", - "id": 2 - } - } - }, - "ClientLibrarySettings": { - "fields": { - "version": { - "type": "string", - "id": 1 - }, - "launchStage": { - "type": "LaunchStage", - "id": 2 - }, - "restNumericEnums": { - "type": "bool", - "id": 3 - }, - "javaSettings": { - "type": "JavaSettings", - "id": 21 - }, - "cppSettings": { - "type": "CppSettings", - "id": 22 - }, - "phpSettings": { - "type": "PhpSettings", - "id": 23 - }, - "pythonSettings": { - "type": "PythonSettings", - "id": 24 - }, - "nodeSettings": { - "type": "NodeSettings", - "id": 25 - }, - "dotnetSettings": { - "type": "DotnetSettings", - "id": 26 - }, - "rubySettings": { - "type": "RubySettings", - "id": 27 - }, - "goSettings": { - "type": "GoSettings", - "id": 28 - } - } - }, - "Publishing": { - "fields": { - "methodSettings": { - "rule": "repeated", - "type": "MethodSettings", - "id": 2 - }, - "newIssueUri": { - "type": "string", - "id": 101 - }, - "documentationUri": { - "type": "string", - "id": 102 - }, - "apiShortName": { - "type": "string", - "id": 103 - }, - "githubLabel": { - "type": "string", - "id": 104 - }, - "codeownerGithubTeams": { - "rule": "repeated", - "type": "string", - "id": 105 - }, - "docTagPrefix": { - "type": "string", - "id": 106 - }, - "organization": { - "type": "ClientLibraryOrganization", - "id": 107 - }, - "librarySettings": { - "rule": "repeated", - "type": "ClientLibrarySettings", - "id": 109 - }, - "protoReferenceDocumentationUri": { - "type": "string", - "id": 110 - }, - "restReferenceDocumentationUri": { - "type": "string", - "id": 111 - } - } - }, - "JavaSettings": { - "fields": { - "libraryPackage": { - "type": "string", - "id": 1 - }, - "serviceClassNames": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "common": { - "type": "CommonLanguageSettings", - "id": 3 - } - } - }, - "CppSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PhpSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "PythonSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "NodeSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "DotnetSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - }, - "renamedServices": { - "keyType": "string", - "type": "string", - "id": 2 - }, - "renamedResources": { - "keyType": "string", - "type": "string", - "id": 3 - }, - "ignoredResources": { - "rule": "repeated", - "type": "string", - "id": 4 - }, - "forcedNamespaceAliases": { - "rule": "repeated", - "type": "string", - "id": 5 - }, - "handwrittenSignatures": { - "rule": "repeated", - "type": "string", - "id": 6 - } - } - }, - "RubySettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "GoSettings": { - "fields": { - "common": { - "type": "CommonLanguageSettings", - "id": 1 - } - } - }, - "MethodSettings": { - "fields": { - "selector": { - "type": "string", - "id": 1 - }, - "longRunning": { - "type": "LongRunning", - "id": 2 - }, - "autoPopulatedFields": { - "rule": "repeated", - "type": "string", - "id": 3 - } - }, - "nested": { - "LongRunning": { - "fields": { - "initialPollDelay": { - "type": "google.protobuf.Duration", - "id": 1 - }, - "pollDelayMultiplier": { - "type": "float", - "id": 2 - }, - "maxPollDelay": { - "type": "google.protobuf.Duration", - "id": 3 - }, - "totalPollTimeout": { - "type": "google.protobuf.Duration", - "id": 4 - } - } - } - } - }, - "ClientLibraryOrganization": { - "values": { - "CLIENT_LIBRARY_ORGANIZATION_UNSPECIFIED": 0, - "CLOUD": 1, - "ADS": 2, - "PHOTOS": 3, - "STREET_VIEW": 4, - "SHOPPING": 5, - "GEO": 6, - "GENERATIVE_AI": 7 - } - }, - "ClientLibraryDestination": { - "values": { - "CLIENT_LIBRARY_DESTINATION_UNSPECIFIED": 0, - "GITHUB": 10, - "PACKAGE_MANAGER": 20 - } - }, - "LaunchStage": { - "values": { - "LAUNCH_STAGE_UNSPECIFIED": 0, - "UNIMPLEMENTED": 6, - "PRELAUNCH": 7, - "EARLY_ACCESS": 1, - "ALPHA": 2, - "BETA": 3, - "GA": 4, - "DEPRECATED": 5 - } - }, - "fieldBehavior": { - "rule": "repeated", - "type": "google.api.FieldBehavior", - "id": 1052, - "extend": "google.protobuf.FieldOptions", - "options": { - "packed": false - } - }, - "FieldBehavior": { - "values": { - "FIELD_BEHAVIOR_UNSPECIFIED": 0, - "OPTIONAL": 1, - "REQUIRED": 2, - "OUTPUT_ONLY": 3, - "INPUT_ONLY": 4, - "IMMUTABLE": 5, - "UNORDERED_LIST": 6, - "NON_EMPTY_DEFAULT": 7, - "IDENTIFIER": 8 - } - }, - "fieldInfo": { - "type": "google.api.FieldInfo", - "id": 291403980, - "extend": "google.protobuf.FieldOptions" - }, - "FieldInfo": { - "fields": { - "format": { - "type": "Format", - "id": 1 - } - }, - "nested": { - "Format": { - "values": { - "FORMAT_UNSPECIFIED": 0, - "UUID4": 1, - "IPV4": 2, - "IPV6": 3, - "IPV4_OR_IPV6": 4 - } - } - } - }, - "resourceReference": { - "type": "google.api.ResourceReference", - "id": 1055, - "extend": "google.protobuf.FieldOptions" - }, - "resourceDefinition": { - "rule": "repeated", - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.FileOptions" - }, - "resource": { - "type": "google.api.ResourceDescriptor", - "id": 1053, - "extend": "google.protobuf.MessageOptions" - }, - "ResourceDescriptor": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "pattern": { - "rule": "repeated", - "type": "string", - "id": 2 - }, - "nameField": { - "type": "string", - "id": 3 - }, - "history": { - "type": "History", - "id": 4 - }, - "plural": { - "type": "string", - "id": 5 - }, - "singular": { - "type": "string", - "id": 6 - }, - "style": { - "rule": "repeated", - "type": "Style", - "id": 10 - } - }, - "nested": { - "History": { - "values": { - "HISTORY_UNSPECIFIED": 0, - "ORIGINALLY_SINGLE_PATTERN": 1, - "FUTURE_MULTI_PATTERN": 2 - } - }, - "Style": { - "values": { - "STYLE_UNSPECIFIED": 0, - "DECLARATIVE_FRIENDLY": 1 - } - } - } - }, - "ResourceReference": { - "fields": { - "type": { - "type": "string", - "id": 1 - }, - "childType": { - "type": "string", - "id": 2 - } - } - } - } - }, - "protobuf": { - "options": { - "go_package": "google.golang.org/protobuf/types/descriptorpb", - "java_package": "com.google.protobuf", - "java_outer_classname": "DescriptorProtos", - "csharp_namespace": "Google.Protobuf.Reflection", - "objc_class_prefix": "GPB", - "cc_enable_arenas": true, - "optimize_for": "SPEED" - }, - "nested": { - "FileDescriptorSet": { - "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 - } - } - }, - "FieldMask": { - "fields": { - "paths": { - "rule": "repeated", - "type": "string", - "id": 1 - } - } - }, - "Timestamp": { - "fields": { - "seconds": { - "type": "int64", - "id": 1 - }, - "nanos": { - "type": "int32", - "id": 2 - } - } - }, - "Any": { - "fields": { - "type_url": { - "type": "string", - "id": 1 - }, - "value": { - "type": "bytes", - "id": 2 - } - } - }, - "Empty": { - "fields": {} - }, - "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 - } - } - } - } - }, - "type": { - "options": { - "go_package": "google.golang.org/genproto/googleapis/type/month;month", - "java_multiple_files": true, - "java_outer_classname": "MonthProto", - "java_package": "com.google.type", - "objc_class_prefix": "GTP" - }, - "nested": { - "DayOfWeek": { - "values": { - "DAY_OF_WEEK_UNSPECIFIED": 0, - "MONDAY": 1, - "TUESDAY": 2, - "WEDNESDAY": 3, - "THURSDAY": 4, - "FRIDAY": 5, - "SATURDAY": 6, - "SUNDAY": 7 - } - }, - "Month": { - "values": { - "MONTH_UNSPECIFIED": 0, - "JANUARY": 1, - "FEBRUARY": 2, - "MARCH": 3, - "APRIL": 4, - "MAY": 5, - "JUNE": 6, - "JULY": 7, - "AUGUST": 8, - "SEPTEMBER": 9, - "OCTOBER": 10, - "NOVEMBER": 11, - "DECEMBER": 12 - } - } - } - }, - "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 - } - } - } - } - }, - "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 - } - } - } - } - } - } - } - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js deleted file mode 100644 index 744efb47244..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.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(parent, backupPlanId, backupPlan) { - // [START backupdr_v1_generated_BackupDR_CreateBackupPlan_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 `BackupPlan` project and location in the format - * `projects/{project}/locations/{location}`. In Cloud BackupDR locations - * map to GCP regions, for example **us-central1**. - */ - // const parent = 'abc123' - /** - * Required. The name of the `BackupPlan` to create. The name must be unique - * for the specified project and location.The name must start with a lowercase - * letter followed by up to 62 lowercase letters, numbers, or hyphens. - * Pattern, /[a-z][a-z0-9-]{,62}/. - */ - // const backupPlanId = 'abc123' - /** - * Required. The `BackupPlan` resource object to create. - */ - // const backupPlan = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callCreateBackupPlan() { - // Construct request - const request = { - parent, - backupPlanId, - backupPlan, - }; - - // Run request - const [operation] = await backupdrClient.createBackupPlan(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackupPlan(); - // [END backupdr_v1_generated_BackupDR_CreateBackupPlan_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js deleted file mode 100644 index 71be228e09e..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js +++ /dev/null @@ -1,89 +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, backupPlanAssociationId, backupPlanAssociation) { - // [START backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 backup plan association project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations - * map to GCP regions, for example **us-central1**. - */ - // const parent = 'abc123' - /** - * Required. The name of the backup plan association to create. The name must - * be unique for the specified project and location. - */ - // const backupPlanAssociationId = 'abc123' - /** - * Required. The resource being created - */ - // const backupPlanAssociation = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callCreateBackupPlanAssociation() { - // Construct request - const request = { - parent, - backupPlanAssociationId, - backupPlanAssociation, - }; - - // Run request - const [operation] = await backupdrClient.createBackupPlanAssociation(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackupPlanAssociation(); - // [END backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js deleted file mode 100644 index aa8fe7e1485..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.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, backupVaultId, backupVault) { - // [START backupdr_v1_generated_BackupDR_CreateBackupVault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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. Value for parent. - */ - // const parent = 'abc123' - /** - * Required. ID of the requesting object - * If auto-generating ID server-side, remove this field and - * backup_vault_id from the method_signature of Create RPC - */ - // const backupVaultId = 'abc123' - /** - * Required. The resource being created - */ - // const backupVault = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. Only validate the request, but do not perform mutations. - * The default is 'false'. - */ - // const validateOnly = true - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callCreateBackupVault() { - // Construct request - const request = { - parent, - backupVaultId, - backupVault, - }; - - // Run request - const [operation] = await backupdrClient.createBackupVault(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateBackupVault(); - // [END backupdr_v1_generated_BackupDR_CreateBackupVault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js deleted file mode 100644 index 19d882e52e5..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.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(parent, managementServerId, managementServer) { - // [START backupdr_v1_generated_BackupDR_CreateManagementServer_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. - */ - // const parent = 'abc123' - /** - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - */ - // const managementServerId = 'abc123' - /** - * Required. A management server - * resource google.cloud.backupdr.v1.ManagementServer - */ - // const managementServer = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callCreateManagementServer() { - // Construct request - const request = { - parent, - managementServerId, - managementServer, - }; - - // Run request - const [operation] = await backupdrClient.createManagementServer(request); - const [response] = await operation.promise(); - console.log(response); - } - - callCreateManagementServer(); - // [END backupdr_v1_generated_BackupDR_CreateManagementServer_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js deleted file mode 100644 index dc9bee40a34..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js +++ /dev/null @@ -1,76 +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 backupdr_v1_generated_BackupDR_DeleteBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource. - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callDeleteBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await backupdrClient.deleteBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackup(); - // [END backupdr_v1_generated_BackupDR_DeleteBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js deleted file mode 100644 index 70a490a5b4b..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 `BackupPlan` to delete. - * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callDeleteBackupPlan() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await backupdrClient.deleteBackupPlan(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackupPlan(); - // [END backupdr_v1_generated_BackupDR_DeleteBackupPlan_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js deleted file mode 100644 index 70e1ca0efc2..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js +++ /dev/null @@ -1,77 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the backup plan association resource, in the format - * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callDeleteBackupPlanAssociation() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await backupdrClient.deleteBackupPlanAssociation(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackupPlanAssociation(); - // [END backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js deleted file mode 100644 index 6a3e236ab2c..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.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(name) { - // [START backupdr_v1_generated_BackupDR_DeleteBackupVault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource. - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. If set to true, any data source from this backup vault will also - * be deleted. - */ - // const force = true - /** - * The current etag of the backup vault. - * If an etag is provided and does not match the current etag of the - * connection, deletion will be blocked. - */ - // const etag = 'abc123' - /** - * Optional. Only validate the request, but do not perform mutations. - * The default is 'false'. - */ - // const validateOnly = true - /** - * Optional. If true and the BackupVault is not found, the request will - * succeed but no action will be taken. - */ - // const allowMissing = true - /** - * Optional. If set to true, backupvault deletion will proceed even if there - * are backup plans referencing the backupvault. The default is 'false'. - */ - // const ignoreBackupPlanReferences = true - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callDeleteBackupVault() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await backupdrClient.deleteBackupVault(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteBackupVault(); - // [END backupdr_v1_generated_BackupDR_DeleteBackupVault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js deleted file mode 100644 index c7a17945e6b..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js +++ /dev/null @@ -1,76 +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 backupdr_v1_generated_BackupDR_DeleteManagementServer_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the resource - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callDeleteManagementServer() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await backupdrClient.deleteManagementServer(request); - const [response] = await operation.promise(); - console.log(response); - } - - callDeleteManagementServer(); - // [END backupdr_v1_generated_BackupDR_DeleteManagementServer_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js deleted file mode 100644 index eb9ebd76fe4..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js +++ /dev/null @@ -1,105 +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, resourceType) { - // [START backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - */ - // const parent = 'abc123' - /** - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - */ - // const resourceType = 'abc123' - /** - * Optional. The maximum number of BackupPlanAssociations to return. The - * service may return fewer than this value. If unspecified, at most 50 - * BackupPlanAssociations will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous call of - * `FetchBackupPlanAssociationsForResourceType`. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `FetchBackupPlanAssociationsForResourceType` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * resource - * * backup_plan - * * state - * * data_source - * * cloud_sql_instance_backup_plan_association_properties.instance_create_time - */ - // const filter = 'abc123' - /** - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * Supported fields: - * * name - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callFetchBackupPlanAssociationsForResourceType() { - // Construct request - const request = { - parent, - resourceType, - }; - - // Run request - const iterable = backupdrClient.fetchBackupPlanAssociationsForResourceTypeAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callFetchBackupPlanAssociationsForResourceType(); - // [END backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js deleted file mode 100644 index 83d92447b52..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js +++ /dev/null @@ -1,104 +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, resourceType) { - // [START backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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. Datasources are the parent resource for the backups. - * Format: - * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} - */ - // const parent = 'abc123' - /** - * Required. The type of the GCP resource. - * Ex: sqladmin.googleapis.com/Instance - */ - // const resourceType = 'abc123' - /** - * Optional. The maximum number of Backups to return. The service may - * return fewer than this value. If unspecified, at most 50 - * Backups will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous call of - * `FetchBackupsForResourceType`. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `FetchBackupsForResourceType` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - */ - // const filter = 'abc123' - /** - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - */ - // const orderBy = 'abc123' - /** - * Optional. This parameter is used to specify the view of the backup. - * If not specified, the default view is BASIC. - */ - // const view = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callFetchBackupsForResourceType() { - // Construct request - const request = { - parent, - resourceType, - }; - - // Run request - const iterable = backupdrClient.fetchBackupsForResourceTypeAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callFetchBackupsForResourceType(); - // [END backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js deleted file mode 100644 index ba8227643a3..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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, resourceType) { - // [START backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - */ - // const parent = 'abc123' - /** - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - */ - // const resourceType = 'abc123' - /** - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous call of - * `FetchDataSourceReferencesForResourceType`. - * Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `FetchDataSourceReferencesForResourceType` must match - * the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_backup_config_state - * * data_source_backup_count - * * data_source_backup_config_info.last_backup_state - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_gcp_resource_info.type - * * data_source_gcp_resource_info.location - * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time - */ - // const filter = 'abc123' - /** - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * Supported fields: - * * name - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callFetchDataSourceReferencesForResourceType() { - // Construct request - const request = { - parent, - resourceType, - }; - - // Run request - const iterable = backupdrClient.fetchDataSourceReferencesForResourceTypeAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callFetchDataSourceReferencesForResourceType(); - // [END backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js deleted file mode 100644 index 5bfda0bb76d..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.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(parent) { - // [START backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callFetchUsableBackupVaults() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.fetchUsableBackupVaultsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callFetchUsableBackupVaults(); - // [END backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js deleted file mode 100644 index 1db664e9c80..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START backupdr_v1_generated_BackupDR_GetBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the data source resource name, in the format - * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' - */ - // const name = 'abc123' - /** - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * resource. - */ - // const view = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getBackup(request); - console.log(response); - } - - callGetBackup(); - // [END backupdr_v1_generated_BackupDR_GetBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js deleted file mode 100644 index cd367d4a1ce..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.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(name) { - // [START backupdr_v1_generated_BackupDR_GetBackupPlan_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 `BackupPlan` to retrieve. - * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - */ - // const name = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetBackupPlan() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getBackupPlan(request); - console.log(response); - } - - callGetBackupPlan(); - // [END backupdr_v1_generated_BackupDR_GetBackupPlan_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js deleted file mode 100644 index d79ba972be0..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.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(name) { - // [START backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the backup plan association resource, in the format - * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - */ - // const name = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetBackupPlanAssociation() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getBackupPlanAssociation(request); - console.log(response); - } - - callGetBackupPlanAssociation(); - // [END backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js deleted file mode 100644 index 7b00b5c17df..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 `BackupPlanRevision` to retrieve. - * Format: - * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` - */ - // const name = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetBackupPlanRevision() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getBackupPlanRevision(request); - console.log(response); - } - - callGetBackupPlanRevision(); - // [END backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js deleted file mode 100644 index 14fdb5572ad..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(name) { - // [START backupdr_v1_generated_BackupDR_GetBackupVault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the backupvault store resource name, in the format - * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' - */ - // const name = 'abc123' - /** - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * Vault - */ - // const view = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetBackupVault() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getBackupVault(request); - console.log(response); - } - - callGetBackupVault(); - // [END backupdr_v1_generated_BackupDR_GetBackupVault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js deleted file mode 100644 index b6be2c0fe07..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.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(name) { - // [START backupdr_v1_generated_BackupDR_GetDataSource_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the data source resource name, in the format - * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_name}' - */ - // const name = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetDataSource() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getDataSource(request); - console.log(response); - } - - callGetDataSource(); - // [END backupdr_v1_generated_BackupDR_GetDataSource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js deleted file mode 100644 index 8bcb3f16254..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.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 backupdr_v1_generated_BackupDR_GetDataSourceReference_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 DataSourceReference to retrieve. - * Format: - * projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} - */ - // const name = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetDataSourceReference() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getDataSourceReference(request); - console.log(response); - } - - callGetDataSourceReference(); - // [END backupdr_v1_generated_BackupDR_GetDataSourceReference_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js deleted file mode 100644 index 03e80ac1640..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.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(name) { - // [START backupdr_v1_generated_BackupDR_GetManagementServer_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_name}' - */ - // const name = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callGetManagementServer() { - // Construct request - const request = { - name, - }; - - // Run request - const response = await backupdrClient.getManagementServer(request); - console.log(response); - } - - callGetManagementServer(); - // [END backupdr_v1_generated_BackupDR_GetManagementServer_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js deleted file mode 100644 index 55c53e70194..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js +++ /dev/null @@ -1,89 +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, resourceType) { - // [START backupdr_v1_generated_BackupDR_InitializeService_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 serviceConfig used to initialize the - * service. Format: - * `projects/{project_id}/locations/{location}/serviceConfig`. - */ - // const name = 'abc123' - /** - * Required. The resource type to which the default service config will be - * applied. Examples include, "compute.googleapis.com/Instance" and - * "storage.googleapis.com/Bucket". - */ - // const resourceType = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. The configuration for initializing a Cloud SQL instance. - */ - // const cloudSqlInstanceInitializationConfig = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callInitializeService() { - // Construct request - const request = { - name, - resourceType, - }; - - // Run request - const [operation] = await backupdrClient.initializeService(request); - const [response] = await operation.promise(); - console.log(response); - } - - callInitializeService(); - // [END backupdr_v1_generated_BackupDR_InitializeService_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js deleted file mode 100644 index 3b8a476c2b0..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js +++ /dev/null @@ -1,81 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - - - -'use strict'; - -function main(parent) { - // [START backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve backup Plan - * Associations information, in the format - * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations - * map to GCP regions, for example **us-central1**. To retrieve backup plan - * associations for all locations, use "-" for the - * `{location}` value. - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results - */ - // const filter = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListBackupPlanAssociations() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listBackupPlanAssociationsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackupPlanAssociations(); - // [END backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js deleted file mode 100644 index 2fcc7d36b5b..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.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) { - // [START backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve - * `BackupPlanRevisions` information. Format: - * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In - * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token - * to determine if there are more instances left to be queried. - */ - // const pageSize = 1234 - /** - * Optional. The value of - * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListBackupPlanRevisions() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listBackupPlanRevisionsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackupPlanRevisions(); - // [END backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js deleted file mode 100644 index 3be463bf2e7..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.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 backupdr_v1_generated_BackupDR_ListBackupPlans_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve `BackupPlans` - * information. Format: `projects/{project}/locations/{location}`. In Cloud - * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To - * retrieve backup plans for all locations, use "-" for the - * `{location}` value. - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token - * to determine if there are more instances left to be queried. - */ - // const pageSize = 1234 - /** - * Optional. The value of - * next_page_token google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the page token. - */ - // const pageToken = 'abc123' - /** - * Optional. Field match expression used to filter the results. - */ - // const filter = 'abc123' - /** - * Optional. Field by which to sort the results. - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListBackupPlans() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listBackupPlansAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackupPlans(); - // [END backupdr_v1_generated_BackupDR_ListBackupPlans_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js deleted file mode 100644 index e1bb4508c4e..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.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(parent) { - // [START backupdr_v1_generated_BackupDR_ListBackupVaults_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - /** - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * Vault. - */ - // const view = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListBackupVaults() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listBackupVaultsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackupVaults(); - // [END backupdr_v1_generated_BackupDR_ListBackupVaults_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js deleted file mode 100644 index b2736b060b3..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.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(parent) { - // [START backupdr_v1_generated_BackupDR_ListBackups_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve backup - * information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - /** - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * resource. - */ - // const view = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListBackups() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listBackupsAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListBackups(); - // [END backupdr_v1_generated_BackupDR_ListBackups_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js deleted file mode 100644 index c84c7594aa3..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js +++ /dev/null @@ -1,96 +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 backupdr_v1_generated_BackupDR_ListDataSourceReferences_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - */ - // const parent = 'abc123' - /** - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - */ - // const pageSize = 1234 - /** - * Optional. A page token, received from a previous `ListDataSourceReferences` - * call. Provide this to retrieve the subsequent page. - * When paginating, all other parameters provided to - * `ListDataSourceReferences` must match the call that provided the page - * token. - */ - // const pageToken = 'abc123' - /** - * Optional. A filter expression that filters the results listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. - * The following field and operator combinations are supported: - * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` - * * data_source_gcp_resource_info.type with `=`, `!=` - */ - // const filter = 'abc123' - /** - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * Supported fields: - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListDataSourceReferences() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listDataSourceReferencesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDataSourceReferences(); - // [END backupdr_v1_generated_BackupDR_ListDataSourceReferences_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js deleted file mode 100644 index e27878ed103..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.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(parent) { - // [START backupdr_v1_generated_BackupDR_ListDataSources_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve data - * sources information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListDataSources() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listDataSourcesAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListDataSources(); - // [END backupdr_v1_generated_BackupDR_ListDataSources_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js deleted file mode 100644 index 90c999155be..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.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(parent) { - // [START backupdr_v1_generated_BackupDR_ListManagementServers_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - */ - // const parent = 'abc123' - /** - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - */ - // const pageSize = 1234 - /** - * Optional. A token identifying a page of results the server should return. - */ - // const pageToken = 'abc123' - /** - * Optional. Filtering results. - */ - // const filter = 'abc123' - /** - * Optional. Hint for how to order the results. - */ - // const orderBy = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callListManagementServers() { - // Construct request - const request = { - parent, - }; - - // Run request - const iterable = backupdrClient.listManagementServersAsync(request); - for await (const response of iterable) { - console.log(response); - } - } - - callListManagementServers(); - // [END backupdr_v1_generated_BackupDR_ListManagementServers_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js deleted file mode 100644 index 26250028fd3..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js +++ /dev/null @@ -1,109 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically 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 backupdr_v1_generated_BackupDR_RestoreBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 Backup instance, in the format - * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. - */ - // const name = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Compute Engine target environment to be used during restore. - */ - // const computeInstanceTargetEnvironment = {} - /** - * Disk target environment to be used during restore. - */ - // const diskTargetEnvironment = {} - /** - * Region disk target environment to be used during restore. - */ - // const regionDiskTargetEnvironment = {} - /** - * Compute Engine instance properties to be overridden during restore. - */ - // const computeInstanceRestoreProperties = {} - /** - * Disk properties to be overridden during restore. - */ - // const diskRestoreProperties = {} - /** - * Optional. A field mask used to clear server-side default values - * for fields within the `instance_properties` oneof. - * When a field in this mask is cleared, the server will not apply its - * default logic (like inheriting a value from the source) for that field. - * The most common current use case is clearing default encryption keys. - * Examples of field mask paths: - * - Compute Instance Disks: - * `compute_instance_restore_properties.disks.*.disk_encryption_key` - * - Single Disk: `disk_restore_properties.disk_encryption_key` - */ - // const clearOverridesFieldMask = {} - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callRestoreBackup() { - // Construct request - const request = { - name, - }; - - // Run request - const [operation] = await backupdrClient.restoreBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callRestoreBackup(); - // [END backupdr_v1_generated_BackupDR_RestoreBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js deleted file mode 100644 index b8c0ade8a11..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js +++ /dev/null @@ -1,82 +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, ruleId) { - // [START backupdr_v1_generated_BackupDR_TriggerBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It will require modifications to work. - * It may require correct/in-range values for request initialization. - * TODO(developer): Uncomment these variables before running the sample. - */ - /** - * Required. Name of the backup plan association resource, in the format - * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - */ - // const name = 'abc123' - /** - * Required. backup rule_id for which a backup needs to be triggered. - */ - // const ruleId = 'abc123' - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callTriggerBackup() { - // Construct request - const request = { - name, - ruleId, - }; - - // Run request - const [operation] = await backupdrClient.triggerBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callTriggerBackup(); - // [END backupdr_v1_generated_BackupDR_TriggerBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js deleted file mode 100644 index 80cb7a400e7..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.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(updateMask, backup) { - // [START backupdr_v1_generated_BackupDR_UpdateBackup_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const backup = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callUpdateBackup() { - // Construct request - const request = { - updateMask, - backup, - }; - - // Run request - const [operation] = await backupdrClient.updateBackup(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackup(); - // [END backupdr_v1_generated_BackupDR_UpdateBackup_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js deleted file mode 100644 index 45ee6f6baae..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.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(backupPlan, updateMask) { - // [START backupdr_v1_generated_BackupDR_UpdateBackupPlan_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 being updated - */ - // const backupPlan = {} - /** - * Required. The list of fields to update. - * Field mask is used to specify the fields to be overwritten in the - * BackupPlan resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * Currently, these fields are supported in update: description, schedules, - * retention period, adding and removing Backup Rules. - */ - // const updateMask = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callUpdateBackupPlan() { - // Construct request - const request = { - backupPlan, - updateMask, - }; - - // Run request - const [operation] = await backupdrClient.updateBackupPlan(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackupPlan(); - // [END backupdr_v1_generated_BackupDR_UpdateBackupPlan_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js deleted file mode 100644 index cb6d94b74b1..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.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(backupPlanAssociation, updateMask) { - // [START backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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 being updated - */ - // const backupPlanAssociation = {} - /** - * Required. The list of fields to update. - * Field mask is used to specify the fields to be overwritten in the - * BackupPlanAssociation resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * Currently backup_plan_association.backup_plan is the only supported field. - */ - // const updateMask = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callUpdateBackupPlanAssociation() { - // Construct request - const request = { - backupPlanAssociation, - updateMask, - }; - - // Run request - const [operation] = await backupdrClient.updateBackupPlanAssociation(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackupPlanAssociation(); - // [END backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js deleted file mode 100644 index cf8aba9e2b3..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js +++ /dev/null @@ -1,100 +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(updateMask, backupVault) { - // [START backupdr_v1_generated_BackupDR_UpdateBackupVault_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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. Field mask is used to specify the fields to be overwritten in the - * BackupVault resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const backupVault = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. Only validate the request, but do not perform mutations. - * The default is 'false'. - */ - // const validateOnly = true - /** - * Optional. If set to true, will not check plan duration against backup vault - * enforcement duration. - */ - // const force = true - /** - * Optional. If set to true, we will force update access restriction even if - * some non compliant data sources are present. The default is 'false'. - */ - // const forceUpdateAccessRestriction = true - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callUpdateBackupVault() { - // Construct request - const request = { - updateMask, - backupVault, - }; - - // Run request - const [operation] = await backupdrClient.updateBackupVault(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateBackupVault(); - // [END backupdr_v1_generated_BackupDR_UpdateBackupVault_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js deleted file mode 100644 index 23861e49849..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js +++ /dev/null @@ -1,89 +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(updateMask, dataSource) { - // [START backupdr_v1_generated_BackupDR_UpdateDataSource_async] - /** - * This snippet has been automatically generated and should be regarded as a code template only. - * It 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. Field mask is used to specify the fields to be overwritten in the - * DataSource resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - */ - // const updateMask = {} - /** - * Required. The resource being updated - */ - // const dataSource = {} - /** - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - */ - // const requestId = 'abc123' - /** - * Optional. Enable upsert. - */ - // const allowMissing = true - - // Imports the Backupdr library - const {BackupDRClient} = require('@google-cloud/backupdr').v1; - - // Instantiates a client - const backupdrClient = new BackupDRClient(); - - async function callUpdateDataSource() { - // Construct request - const request = { - updateMask, - dataSource, - }; - - // Run request - const [operation] = await backupdrClient.updateDataSource(request); - const [response] = await operation.promise(); - console.log(response); - } - - callUpdateDataSource(); - // [END backupdr_v1_generated_BackupDR_UpdateDataSource_async] -} - -process.on('unhandledRejection', err => { - console.error(err.message); - process.exitCode = 1; -}); -main(...process.argv.slice(2)); diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json b/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json deleted file mode 100644 index e5916e1c98e..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json +++ /dev/null @@ -1,1959 +0,0 @@ -{ - "clientLibrary": { - "name": "nodejs-backupdr", - "version": "0.1.0", - "language": "TYPESCRIPT", - "apis": [ - { - "id": "google.cloud.backupdr.v1", - "version": "v1" - } - ] - }, - "snippets": [ - { - "regionTag": "backupdr_v1_generated_BackupDR_ListManagementServers_async", - "title": "BackupDR listManagementServers Sample", - "origin": "API_DEFINITION", - "description": " Lists ManagementServers in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_management_servers.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListManagementServers", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListManagementServers", - "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.backupdr.v1.ListManagementServersResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListManagementServers", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListManagementServers", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetManagementServer_async", - "title": "BackupDR getManagementServer Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single ManagementServer.", - "canonical": true, - "file": "backup_d_r.get_management_server.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetManagementServer", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetManagementServer", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.ManagementServer", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetManagementServer", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetManagementServer", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_CreateManagementServer_async", - "title": "BackupDR createManagementServer Sample", - "origin": "API_DEFINITION", - "description": " Creates a new ManagementServer in a given project and location.", - "canonical": true, - "file": "backup_d_r.create_management_server.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateManagementServer", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateManagementServer", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "management_server_id", - "type": "TYPE_STRING" - }, - { - "name": "management_server", - "type": ".google.cloud.backupdr.v1.ManagementServer" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "CreateManagementServer", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateManagementServer", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_DeleteManagementServer_async", - "title": "BackupDR deleteManagementServer Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single ManagementServer.", - "canonical": true, - "file": "backup_d_r.delete_management_server.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteManagementServer", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteManagementServer", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "DeleteManagementServer", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteManagementServer", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupVault_async", - "title": "BackupDR createBackupVault Sample", - "origin": "API_DEFINITION", - "description": " Creates a new BackupVault in a given project and location.", - "canonical": true, - "file": "backup_d_r.create_backup_vault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_vault_id", - "type": "TYPE_STRING" - }, - { - "name": "backup_vault", - "type": ".google.cloud.backupdr.v1.BackupVault" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "CreateBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupVault", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListBackupVaults_async", - "title": "BackupDR listBackupVaults Sample", - "origin": "API_DEFINITION", - "description": " Lists BackupVaults in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_backup_vaults.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackupVaults", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", - "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" - }, - { - "name": "view", - "type": ".google.cloud.backupdr.v1.BackupVaultView" - } - ], - "resultType": ".google.cloud.backupdr.v1.ListBackupVaultsResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListBackupVaults", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupVaults", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async", - "title": "BackupDR fetchUsableBackupVaults Sample", - "origin": "API_DEFINITION", - "description": " FetchUsableBackupVaults lists usable BackupVaults in a given project and location. Usable BackupVault are the ones that user has backupdr.backupVaults.get permission.", - "canonical": true, - "file": "backup_d_r.fetch_usable_backup_vaults.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchUsableBackupVaults", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", - "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.backupdr.v1.FetchUsableBackupVaultsResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "FetchUsableBackupVaults", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchUsableBackupVaults", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetBackupVault_async", - "title": "BackupDR getBackupVault Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a BackupVault.", - "canonical": true, - "file": "backup_d_r.get_backup_vault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.backupdr.v1.BackupVaultView" - } - ], - "resultType": ".google.cloud.backupdr.v1.BackupVault", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupVault", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupVault_async", - "title": "BackupDR updateBackupVault Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a BackupVault.", - "canonical": true, - "file": "backup_d_r.update_backup_vault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 92, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "backup_vault", - "type": ".google.cloud.backupdr.v1.BackupVault" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "force", - "type": "TYPE_BOOL" - }, - { - "name": "force_update_access_restriction", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "UpdateBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupVault", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupVault_async", - "title": "BackupDR deleteBackupVault Sample", - "origin": "API_DEFINITION", - "description": " Deletes a BackupVault.", - "canonical": true, - "file": "backup_d_r.delete_backup_vault.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 94, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "force", - "type": "TYPE_BOOL" - }, - { - "name": "etag", - "type": "TYPE_STRING" - }, - { - "name": "validate_only", - "type": "TYPE_BOOL" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - }, - { - "name": "ignore_backup_plan_references", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "DeleteBackupVault", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupVault", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListDataSources_async", - "title": "BackupDR listDataSources Sample", - "origin": "API_DEFINITION", - "description": " Lists DataSources in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_data_sources.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDataSources", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", - "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.backupdr.v1.ListDataSourcesResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListDataSources", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSources", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetDataSource_async", - "title": "BackupDR getDataSource Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a DataSource.", - "canonical": true, - "file": "backup_d_r.get_data_source.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataSource", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.DataSource", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetDataSource", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSource", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_UpdateDataSource_async", - "title": "BackupDR updateDataSource Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a DataSource.", - "canonical": true, - "file": "backup_d_r.update_data_source.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateDataSource", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "data_source", - "type": ".google.cloud.backupdr.v1.DataSource" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "allow_missing", - "type": "TYPE_BOOL" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "UpdateDataSource", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateDataSource", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListBackups_async", - "title": "BackupDR listBackups Sample", - "origin": "API_DEFINITION", - "description": " Lists Backups in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_backups.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 82, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackups", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", - "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" - }, - { - "name": "view", - "type": ".google.cloud.backupdr.v1.BackupView" - } - ], - "resultType": ".google.cloud.backupdr.v1.ListBackupsResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListBackups", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackups", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async", - "title": "BackupDR fetchBackupsForResourceType Sample", - "origin": "API_DEFINITION", - "description": " Fetch Backups for a given resource type.", - "canonical": true, - "file": "backup_d_r.fetch_backups_for_resource_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 96, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchBackupsForResourceType", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceType", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "resource_type", - "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" - }, - { - "name": "view", - "type": ".google.cloud.backupdr.v1.BackupView" - } - ], - "resultType": ".google.cloud.backupdr.v1.FetchBackupsForResourceTypeResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "FetchBackupsForResourceType", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupsForResourceType", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetBackup_async", - "title": "BackupDR getBackup Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a Backup.", - "canonical": true, - "file": "backup_d_r.get_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 59, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "view", - "type": ".google.cloud.backupdr.v1.BackupView" - } - ], - "resultType": ".google.cloud.backupdr.v1.Backup", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackup", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackup_async", - "title": "BackupDR updateBackup Sample", - "origin": "API_DEFINITION", - "description": " Updates the settings of a Backup.", - "canonical": true, - "file": "backup_d_r.update_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 77, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", - "async": true, - "parameters": [ - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "backup", - "type": ".google.cloud.backupdr.v1.Backup" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "UpdateBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackup", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackup_async", - "title": "BackupDR deleteBackup Sample", - "origin": "API_DEFINITION", - "description": " Deletes a Backup.", - "canonical": true, - "file": "backup_d_r.delete_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 68, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "DeleteBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackup", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_RestoreBackup_async", - "title": "BackupDR restoreBackup Sample", - "origin": "API_DEFINITION", - "description": " Restore from a Backup", - "canonical": true, - "file": "backup_d_r.restore_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 101, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "RestoreBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "compute_instance_target_environment", - "type": ".google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment" - }, - { - "name": "disk_target_environment", - "type": ".google.cloud.backupdr.v1.DiskTargetEnvironment" - }, - { - "name": "region_disk_target_environment", - "type": ".google.cloud.backupdr.v1.RegionDiskTargetEnvironment" - }, - { - "name": "compute_instance_restore_properties", - "type": ".google.cloud.backupdr.v1.ComputeInstanceRestoreProperties" - }, - { - "name": "disk_restore_properties", - "type": ".google.cloud.backupdr.v1.DiskRestoreProperties" - }, - { - "name": "clear_overrides_field_mask", - "type": ".google.protobuf.FieldMask" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "RestoreBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.RestoreBackup", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlan_async", - "title": "BackupDR createBackupPlan Sample", - "origin": "API_DEFINITION", - "description": " Create a BackupPlan", - "canonical": true, - "file": "backup_d_r.create_backup_plan.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 83, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_plan_id", - "type": "TYPE_STRING" - }, - { - "name": "backup_plan", - "type": ".google.cloud.backupdr.v1.BackupPlan" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "CreateBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlan", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupPlan_async", - "title": "BackupDR updateBackupPlan Sample", - "origin": "API_DEFINITION", - "description": " Update a BackupPlan.", - "canonical": true, - "file": "backup_d_r.update_backup_plan.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 80, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlan", - "async": true, - "parameters": [ - { - "name": "backup_plan", - "type": ".google.cloud.backupdr.v1.BackupPlan" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "UpdateBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlan", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlan_async", - "title": "BackupDR getBackupPlan Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single BackupPlan.", - "canonical": true, - "file": "backup_d_r.get_backup_plan.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.BackupPlan", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlan", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlans_async", - "title": "BackupDR listBackupPlans Sample", - "origin": "API_DEFINITION", - "description": " Lists BackupPlans in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_backup_plans.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 85, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackupPlans", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", - "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.backupdr.v1.ListBackupPlansResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListBackupPlans", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlans", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlan_async", - "title": "BackupDR deleteBackupPlan Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single BackupPlan.", - "canonical": true, - "file": "backup_d_r.delete_backup_plan.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "DeleteBackupPlan", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlan", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async", - "title": "BackupDR getBackupPlanRevision Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single BackupPlanRevision.", - "canonical": true, - "file": "backup_d_r.get_backup_plan_revision.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackupPlanRevision", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevision", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.BackupPlanRevision", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetBackupPlanRevision", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanRevision", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async", - "title": "BackupDR listBackupPlanRevisions Sample", - "origin": "API_DEFINITION", - "description": " Lists BackupPlanRevisions in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_backup_plan_revisions.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackupPlanRevisions", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisions", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "page_size", - "type": "TYPE_INT32" - }, - { - "name": "page_token", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.ListBackupPlanRevisionsResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListBackupPlanRevisions", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanRevisions", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async", - "title": "BackupDR createBackupPlanAssociation Sample", - "origin": "API_DEFINITION", - "description": " Create a BackupPlanAssociation", - "canonical": true, - "file": "backup_d_r.create_backup_plan_association.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "CreateBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "backup_plan_association_id", - "type": "TYPE_STRING" - }, - { - "name": "backup_plan_association", - "type": ".google.cloud.backupdr.v1.BackupPlanAssociation" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "CreateBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.CreateBackupPlanAssociation", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async", - "title": "BackupDR updateBackupPlanAssociation Sample", - "origin": "API_DEFINITION", - "description": " Update a BackupPlanAssociation.", - "canonical": true, - "file": "backup_d_r.update_backup_plan_association.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 79, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "UpdateBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociation", - "async": true, - "parameters": [ - { - "name": "backup_plan_association", - "type": ".google.cloud.backupdr.v1.BackupPlanAssociation" - }, - { - "name": "update_mask", - "type": ".google.protobuf.FieldMask" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "UpdateBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.UpdateBackupPlanAssociation", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async", - "title": "BackupDR getBackupPlanAssociation Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single BackupPlanAssociation.", - "canonical": true, - "file": "backup_d_r.get_backup_plan_association.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 54, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.BackupPlanAssociation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetBackupPlanAssociation", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async", - "title": "BackupDR listBackupPlanAssociations Sample", - "origin": "API_DEFINITION", - "description": " Lists BackupPlanAssociations in a given project and location.", - "canonical": true, - "file": "backup_d_r.list_backup_plan_associations.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 73, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListBackupPlanAssociations", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", - "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.backupdr.v1.ListBackupPlanAssociationsResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListBackupPlanAssociations", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListBackupPlanAssociations", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async", - "title": "BackupDR fetchBackupPlanAssociationsForResourceType Sample", - "origin": "API_DEFINITION", - "description": " List BackupPlanAssociations for a given resource type.", - "canonical": true, - "file": "backup_d_r.fetch_backup_plan_associations_for_resource_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 97, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchBackupPlanAssociationsForResourceType", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceType", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "resource_type", - "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.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "FetchBackupPlanAssociationsForResourceType", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchBackupPlanAssociationsForResourceType", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async", - "title": "BackupDR deleteBackupPlanAssociation Sample", - "origin": "API_DEFINITION", - "description": " Deletes a single BackupPlanAssociation.", - "canonical": true, - "file": "backup_d_r.delete_backup_plan_association.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 69, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "DeleteBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "DeleteBackupPlanAssociation", - "fullName": "google.cloud.backupdr.v1.BackupDR.DeleteBackupPlanAssociation", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_TriggerBackup_async", - "title": "BackupDR triggerBackup Sample", - "origin": "API_DEFINITION", - "description": " Triggers a new Backup.", - "canonical": true, - "file": "backup_d_r.trigger_backup.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 74, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "TriggerBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "rule_id", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "TriggerBackup", - "fullName": "google.cloud.backupdr.v1.BackupDR.TriggerBackup", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_GetDataSourceReference_async", - "title": "BackupDR getDataSourceReference Sample", - "origin": "API_DEFINITION", - "description": " Gets details of a single DataSourceReference.", - "canonical": true, - "file": "backup_d_r.get_data_source_reference.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 55, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "GetDataSourceReference", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSourceReference", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - } - ], - "resultType": ".google.cloud.backupdr.v1.DataSourceReference", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "GetDataSourceReference", - "fullName": "google.cloud.backupdr.v1.BackupDR.GetDataSourceReference", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_ListDataSourceReferences_async", - "title": "BackupDR listDataSourceReferences Sample", - "origin": "API_DEFINITION", - "description": " Lists DataSourceReferences for a given project and location.", - "canonical": true, - "file": "backup_d_r.list_data_source_references.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 88, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListDataSourceReferences", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSourceReferences", - "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.backupdr.v1.ListDataSourceReferencesResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "ListDataSourceReferences", - "fullName": "google.cloud.backupdr.v1.BackupDR.ListDataSourceReferences", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async", - "title": "BackupDR fetchDataSourceReferencesForResourceType Sample", - "origin": "API_DEFINITION", - "description": " Fetch DataSourceReferences for a given project, location and resource type.", - "canonical": true, - "file": "backup_d_r.fetch_data_source_references_for_resource_type.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 101, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "FetchDataSourceReferencesForResourceType", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceType", - "async": true, - "parameters": [ - { - "name": "parent", - "type": "TYPE_STRING" - }, - { - "name": "resource_type", - "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.backupdr.v1.FetchDataSourceReferencesForResourceTypeResponse", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "FetchDataSourceReferencesForResourceType", - "fullName": "google.cloud.backupdr.v1.BackupDR.FetchDataSourceReferencesForResourceType", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDR_InitializeService_async", - "title": "BackupDR initializeService Sample", - "origin": "API_DEFINITION", - "description": " Initializes the service related config for a project.", - "canonical": true, - "file": "backup_d_r.initialize_service.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 81, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "InitializeService", - "fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService", - "async": true, - "parameters": [ - { - "name": "name", - "type": "TYPE_STRING" - }, - { - "name": "resource_type", - "type": "TYPE_STRING" - }, - { - "name": "request_id", - "type": "TYPE_STRING" - }, - { - "name": "cloud_sql_instance_initialization_config", - "type": ".google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig" - } - ], - "resultType": ".google.longrunning.Operation", - "client": { - "shortName": "BackupDRClient", - "fullName": "google.cloud.backupdr.v1.BackupDRClient" - }, - "method": { - "shortName": "InitializeService", - "fullName": "google.cloud.backupdr.v1.BackupDR.InitializeService", - "service": { - "shortName": "BackupDR", - "fullName": "google.cloud.backupdr.v1.BackupDR" - } - } - } - }, - { - "regionTag": "backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_async", - "title": "BackupDR listResourceBackupConfigs Sample", - "origin": "API_DEFINITION", - "description": " Lists ResourceBackupConfigs.", - "canonical": true, - "file": "backup_dr_protection_summary.list_resource_backup_configs.js", - "language": "JAVASCRIPT", - "segments": [ - { - "start": 25, - "end": 76, - "type": "FULL" - } - ], - "clientMethod": { - "shortName": "ListResourceBackupConfigs", - "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigs", - "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.backupdr.v1.ListResourceBackupConfigsResponse", - "client": { - "shortName": "BackupDrProtectionSummaryClient", - "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummaryClient" - }, - "method": { - "shortName": "ListResourceBackupConfigs", - "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigs", - "service": { - "shortName": "BackupDrProtectionSummary", - "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary" - } - } - } - } - ] -} diff --git a/owl-bot-staging/google-cloud-backupdr/src/index.ts b/owl-bot-staging/google-cloud-backupdr/src/index.ts deleted file mode 100644 index 5bc8aa0b7be..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/src/index.ts +++ /dev/null @@ -1,29 +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 BackupDRClient = v1.BackupDRClient; -type BackupDRClient = v1.BackupDRClient; -const BackupDrProtectionSummaryClient = v1.BackupDrProtectionSummaryClient; -type BackupDrProtectionSummaryClient = v1.BackupDrProtectionSummaryClient; - -export {v1, BackupDRClient, BackupDrProtectionSummaryClient}; -export default {v1, BackupDRClient, BackupDrProtectionSummaryClient}; -import * as protos from '../protos/protos'; -export {protos}; diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts deleted file mode 100644 index 2dda6fe7907..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client.ts +++ /dev/null @@ -1,7449 +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, LocationsClient, LocationProtos} from 'google-gax'; -import {Transform} from 'stream'; -import * as protos from '../../protos/protos'; -import jsonProtos = require('../../protos/protos.json'); -import {loggingUtils as logging, decodeAnyProtosInArray} from 'google-gax'; - -/** - * Client JSON configuration object, loaded from - * `src/v1/backup_d_r_client_config.json`. - * This file defines retry strategy and timeouts for all API methods in this library. - */ -import * as gapicConfig from './backup_d_r_client_config.json'; -const version = require('../../../package.json').version; - -/** - * The BackupDR Service - * @class - * @memberof v1 - */ -export class BackupDRClient { - 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('backupdr'); - - auth: gax.GoogleAuth; - descriptors: Descriptors = { - page: {}, - stream: {}, - longrunning: {}, - batching: {}, - }; - warn: (code: string, message: string, warnType?: string) => void; - innerApiCalls: {[name: string]: Function}; - iamClient: IamClient; - locationsClient: LocationsClient; - pathTemplates: {[name: string]: gax.PathTemplate}; - operationsClient: gax.OperationsClient; - backupDRStub?: Promise<{[name: string]: Function}>; - - /** - * Construct an instance of BackupDRClient. - * - * @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 BackupDRClient({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 BackupDRClient; - 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 = 'backupdr.' + 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); - - this.locationsClient = new this._gaxModule.LocationsClient( - this._gaxGrpc, - opts - ); - - - // Determine the client header string. - const clientHeader = [ - `gax/${this._gaxModule.version}`, - `gapic/${version}`, - ]; - if (typeof process === 'object' && 'versions' in process) { - clientHeader.push(`gl-node/${process.versions.node}`); - } else { - clientHeader.push(`gl-web/${this._gaxModule.version}`); - } - if (!opts.fallback) { - clientHeader.push(`grpc/${this._gaxGrpc.grpcVersion}`); - } else { - clientHeader.push(`rest/${this._gaxGrpc.grpcVersion}`); - } - if (opts.libName && opts.libVersion) { - clientHeader.push(`${opts.libName}/${opts.libVersion}`); - } - // Load the applicable protos. - this._protos = this._gaxGrpc.loadProtoJSON(jsonProtos); - - // This API contains "path templates"; forward-slash-separated - // identifiers to uniquely identify resources within the API. - // Create useful helper objects for these. - this.pathTemplates = { - backupPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}/backups/{backup}' - ), - backupPlanPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backupPlans/{backup_plan}' - ), - backupPlanAssociationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backupPlanAssociations/{backup_plan_association}' - ), - backupPlanRevisionPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}' - ), - backupVaultPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backupVaults/{backupvault}' - ), - dataSourcePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/backupVaults/{backupvault}/dataSources/{datasource}' - ), - dataSourceReferencePathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference}' - ), - locationPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}' - ), - managementServerPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/managementServers/{managementserver}' - ), - projectPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}' - ), - resourceBackupConfigPathTemplate: new this._gaxModule.PathTemplate( - 'projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}' - ), - }; - - // 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 = { - listManagementServers: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'managementServers'), - listBackupVaults: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupVaults'), - fetchUsableBackupVaults: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupVaults'), - listDataSources: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataSources'), - listBackups: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), - fetchBackupsForResourceType: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backups'), - listBackupPlans: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlans'), - listBackupPlanRevisions: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlanRevisions'), - listBackupPlanAssociations: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlanAssociations'), - fetchBackupPlanAssociationsForResourceType: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'backupPlanAssociations'), - listDataSourceReferences: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataSourceReferences'), - fetchDataSourceReferencesForResourceType: - new this._gaxModule.PageDescriptor('pageToken', 'nextPageToken', 'dataSourceReferences') - }; - - 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.cloud.location.Locations.GetLocation',get: '/v1/{name=projects/*/locations/*}',},{selector: 'google.cloud.location.Locations.ListLocations',get: '/v1/{name=projects/*}/locations',},{selector: 'google.iam.v1.IAMPolicy.GetIamPolicy',get: '/v1/{resource=projects/*/locations/*/managementServers/*}:getIamPolicy',},{selector: 'google.iam.v1.IAMPolicy.SetIamPolicy',post: '/v1/{resource=projects/*/locations/*/managementServers/*}:setIamPolicy',body: '*',},{selector: 'google.iam.v1.IAMPolicy.TestIamPermissions',post: '/v1/{resource=projects/*/locations/*/managementServers/*}:testIamPermissions',body: '*',},{selector: 'google.longrunning.Operations.CancelOperation',post: '/v1/{name=projects/*/locations/*/operations/*}:cancel',body: '*',},{selector: 'google.longrunning.Operations.DeleteOperation',delete: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.GetOperation',get: '/v1/{name=projects/*/locations/*/operations/*}',},{selector: 'google.longrunning.Operations.ListOperations',get: '/v1/{name=projects/*/locations/*}/operations',}]; - } - this.operationsClient = this._gaxModule.lro(lroOptions).operationsClient(opts); - const createManagementServerResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.ManagementServer') as gax.protobuf.Type; - const createManagementServerMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const deleteManagementServerResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteManagementServerMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const createBackupVaultResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupVault') as gax.protobuf.Type; - const createBackupVaultMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const updateBackupVaultResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupVault') as gax.protobuf.Type; - const updateBackupVaultMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const deleteBackupVaultResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBackupVaultMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const updateDataSourceResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.DataSource') as gax.protobuf.Type; - const updateDataSourceMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const updateBackupResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.Backup') as gax.protobuf.Type; - const updateBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const deleteBackupResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.Backup') as gax.protobuf.Type; - const deleteBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const restoreBackupResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.RestoreBackupResponse') as gax.protobuf.Type; - const restoreBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const createBackupPlanResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupPlan') as gax.protobuf.Type; - const createBackupPlanMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const updateBackupPlanResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupPlan') as gax.protobuf.Type; - const updateBackupPlanMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const deleteBackupPlanResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBackupPlanMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const createBackupPlanAssociationResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupPlanAssociation') as gax.protobuf.Type; - const createBackupPlanAssociationMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const updateBackupPlanAssociationResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupPlanAssociation') as gax.protobuf.Type; - const updateBackupPlanAssociationMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const deleteBackupPlanAssociationResponse = protoFilesRoot.lookup( - '.google.protobuf.Empty') as gax.protobuf.Type; - const deleteBackupPlanAssociationMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const triggerBackupResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.BackupPlanAssociation') as gax.protobuf.Type; - const triggerBackupMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - const initializeServiceResponse = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.InitializeServiceResponse') as gax.protobuf.Type; - const initializeServiceMetadata = protoFilesRoot.lookup( - '.google.cloud.backupdr.v1.OperationMetadata') as gax.protobuf.Type; - - this.descriptors.longrunning = { - createManagementServer: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createManagementServerResponse.decode.bind(createManagementServerResponse), - createManagementServerMetadata.decode.bind(createManagementServerMetadata)), - deleteManagementServer: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteManagementServerResponse.decode.bind(deleteManagementServerResponse), - deleteManagementServerMetadata.decode.bind(deleteManagementServerMetadata)), - createBackupVault: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupVaultResponse.decode.bind(createBackupVaultResponse), - createBackupVaultMetadata.decode.bind(createBackupVaultMetadata)), - updateBackupVault: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupVaultResponse.decode.bind(updateBackupVaultResponse), - updateBackupVaultMetadata.decode.bind(updateBackupVaultMetadata)), - deleteBackupVault: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupVaultResponse.decode.bind(deleteBackupVaultResponse), - deleteBackupVaultMetadata.decode.bind(deleteBackupVaultMetadata)), - updateDataSource: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateDataSourceResponse.decode.bind(updateDataSourceResponse), - updateDataSourceMetadata.decode.bind(updateDataSourceMetadata)), - updateBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupResponse.decode.bind(updateBackupResponse), - updateBackupMetadata.decode.bind(updateBackupMetadata)), - deleteBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupResponse.decode.bind(deleteBackupResponse), - deleteBackupMetadata.decode.bind(deleteBackupMetadata)), - restoreBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - restoreBackupResponse.decode.bind(restoreBackupResponse), - restoreBackupMetadata.decode.bind(restoreBackupMetadata)), - createBackupPlan: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupPlanResponse.decode.bind(createBackupPlanResponse), - createBackupPlanMetadata.decode.bind(createBackupPlanMetadata)), - updateBackupPlan: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupPlanResponse.decode.bind(updateBackupPlanResponse), - updateBackupPlanMetadata.decode.bind(updateBackupPlanMetadata)), - deleteBackupPlan: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupPlanResponse.decode.bind(deleteBackupPlanResponse), - deleteBackupPlanMetadata.decode.bind(deleteBackupPlanMetadata)), - createBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - createBackupPlanAssociationResponse.decode.bind(createBackupPlanAssociationResponse), - createBackupPlanAssociationMetadata.decode.bind(createBackupPlanAssociationMetadata)), - updateBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - updateBackupPlanAssociationResponse.decode.bind(updateBackupPlanAssociationResponse), - updateBackupPlanAssociationMetadata.decode.bind(updateBackupPlanAssociationMetadata)), - deleteBackupPlanAssociation: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - deleteBackupPlanAssociationResponse.decode.bind(deleteBackupPlanAssociationResponse), - deleteBackupPlanAssociationMetadata.decode.bind(deleteBackupPlanAssociationMetadata)), - triggerBackup: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - triggerBackupResponse.decode.bind(triggerBackupResponse), - triggerBackupMetadata.decode.bind(triggerBackupMetadata)), - initializeService: new this._gaxModule.LongrunningDescriptor( - this.operationsClient, - initializeServiceResponse.decode.bind(initializeServiceResponse), - initializeServiceMetadata.decode.bind(initializeServiceMetadata)) - }; - - // Put together the default options sent with requests. - this._defaults = this._gaxGrpc.constructSettings( - 'google.cloud.backupdr.v1.BackupDR', 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.backupDRStub) { - return this.backupDRStub; - } - - // Put together the "service stub" for - // google.cloud.backupdr.v1.BackupDR. - this.backupDRStub = this._gaxGrpc.createStub( - this._opts.fallback ? - (this._protos as protobuf.Root).lookupService('google.cloud.backupdr.v1.BackupDR') : - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (this._protos as any).google.cloud.backupdr.v1.BackupDR, - 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 backupDRStubMethods = - ['listManagementServers', 'getManagementServer', 'createManagementServer', 'deleteManagementServer', 'createBackupVault', 'listBackupVaults', 'fetchUsableBackupVaults', 'getBackupVault', 'updateBackupVault', 'deleteBackupVault', 'listDataSources', 'getDataSource', 'updateDataSource', 'listBackups', 'fetchBackupsForResourceType', 'getBackup', 'updateBackup', 'deleteBackup', 'restoreBackup', 'createBackupPlan', 'updateBackupPlan', 'getBackupPlan', 'listBackupPlans', 'deleteBackupPlan', 'getBackupPlanRevision', 'listBackupPlanRevisions', 'createBackupPlanAssociation', 'updateBackupPlanAssociation', 'getBackupPlanAssociation', 'listBackupPlanAssociations', 'fetchBackupPlanAssociationsForResourceType', 'deleteBackupPlanAssociation', 'triggerBackup', 'getDataSourceReference', 'listDataSourceReferences', 'fetchDataSourceReferencesForResourceType', 'initializeService']; - for (const methodName of backupDRStubMethods) { - const callPromise = this.backupDRStub.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.backupDRStub; - } - - /** - * 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 'backupdr.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 'backupdr.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 details of a single ManagementServer. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the management server resource name, in the format - * 'projects/{project_id}/locations/{location}/managementServers/{resource_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.backupdr.v1.ManagementServer|ManagementServer}. - * 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/backup_d_r.get_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_GetManagementServer_async - */ - getManagementServer( - request?: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|undefined, {}|undefined - ]>; - getManagementServer( - request: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, - {}|null|undefined>): void; - getManagementServer( - request: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, - {}|null|undefined>): void; - getManagementServer( - request?: protos.google.cloud.backupdr.v1.IGetManagementServerRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|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('getManagementServer request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getManagementServer response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getManagementServer(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IManagementServer, - protos.google.cloud.backupdr.v1.IGetManagementServerRequest|undefined, - {}|undefined - ]) => { - this._log.info('getManagementServer 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 details of a BackupVault. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backupvault store resource name, in the format - * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}' - * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * Vault - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupVault|BackupVault}. - * 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/backup_d_r.get_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_GetBackupVault_async - */ - getBackupVault( - request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|undefined, {}|undefined - ]>; - getBackupVault( - request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, - {}|null|undefined>): void; - getBackupVault( - request: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, - {}|null|undefined>): void; - getBackupVault( - request?: protos.google.cloud.backupdr.v1.IGetBackupVaultRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|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('getBackupVault request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackupVault response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackupVault(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IBackupVault, - protos.google.cloud.backupdr.v1.IGetBackupVaultRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackupVault 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 details of a DataSource. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the data source resource name, in the format - * 'projects/{project_id}/locations/{location}/backupVaults/{resource_name}/dataSource/{resource_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.backupdr.v1.DataSource|DataSource}. - * 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/backup_d_r.get_data_source.js - * region_tag:backupdr_v1_generated_BackupDR_GetDataSource_async - */ - getDataSource( - request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|undefined, {}|undefined - ]>; - getDataSource( - request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, - {}|null|undefined>): void; - getDataSource( - request: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, - {}|null|undefined>): void; - getDataSource( - request?: protos.google.cloud.backupdr.v1.IGetDataSourceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|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('getDataSource request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDataSource response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDataSource(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IDataSource, - protos.google.cloud.backupdr.v1.IGetDataSourceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDataSource 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 details of a Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the data source resource name, in the format - * 'projects/{project_id}/locations/{location}/backupVaults/{backupVault}/dataSources/{datasource}/backups/{backup}' - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.Backup|Backup}. - * 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/backup_d_r.get_backup.js - * region_tag:backupdr_v1_generated_BackupDR_GetBackup_async - */ - getBackup( - request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|undefined, {}|undefined - ]>; - getBackup( - request: protos.google.cloud.backupdr.v1.IGetBackupRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request: protos.google.cloud.backupdr.v1.IGetBackupRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): void; - getBackup( - request?: protos.google.cloud.backupdr.v1.IGetBackupRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|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('getBackup request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackup response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackup(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IBackup, - protos.google.cloud.backupdr.v1.IGetBackupRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackup 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 details of a single BackupPlan. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the `BackupPlan` to retrieve. - * - * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupPlan|BackupPlan}. - * 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/backup_d_r.get_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlan_async - */ - getBackupPlan( - request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|undefined, {}|undefined - ]>; - getBackupPlan( - request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, - {}|null|undefined>): void; - getBackupPlan( - request: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, - {}|null|undefined>): void; - getBackupPlan( - request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|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('getBackupPlan request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackupPlan response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackupPlan(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IBackupPlan, - protos.google.cloud.backupdr.v1.IGetBackupPlanRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackupPlan 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 details of a single BackupPlanRevision. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the `BackupPlanRevision` to retrieve. - * - * Format: - * `projects/{project}/locations/{location}/backupPlans/{backup_plan}/revisions/{revision}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link protos.google.cloud.backupdr.v1.BackupPlanRevision|BackupPlanRevision}. - * 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/backup_d_r.get_backup_plan_revision.js - * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlanRevision_async - */ - getBackupPlanRevision( - request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|undefined, {}|undefined - ]>; - getBackupPlanRevision( - request: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, - {}|null|undefined>): void; - getBackupPlanRevision( - request: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, - {}|null|undefined>): void; - getBackupPlanRevision( - request?: protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|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('getBackupPlanRevision request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackupPlanRevision response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackupPlanRevision(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IBackupPlanRevision, - protos.google.cloud.backupdr.v1.IGetBackupPlanRevisionRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackupPlanRevision 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 details of a single BackupPlanAssociation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup plan association resource, in the format - * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. - * 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/backup_d_r.get_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_GetBackupPlanAssociation_async - */ - getBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|undefined, {}|undefined - ]>; - getBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, - {}|null|undefined>): void; - getBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, - {}|null|undefined>): void; - getBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|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('getBackupPlanAssociation request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getBackupPlanAssociation response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getBackupPlanAssociation(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation, - protos.google.cloud.backupdr.v1.IGetBackupPlanAssociationRequest|undefined, - {}|undefined - ]) => { - this._log.info('getBackupPlanAssociation 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 details of a single DataSourceReference. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The name of the DataSourceReference to retrieve. - * Format: - * projects/{project}/locations/{location}/dataSourceReferences/{data_source_reference} - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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.backupdr.v1.DataSourceReference|DataSourceReference}. - * 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/backup_d_r.get_data_source_reference.js - * region_tag:backupdr_v1_generated_BackupDR_GetDataSourceReference_async - */ - getDataSourceReference( - request?: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|undefined, {}|undefined - ]>; - getDataSourceReference( - request: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, - options: CallOptions, - callback: Callback< - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, - {}|null|undefined>): void; - getDataSourceReference( - request: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, - callback: Callback< - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, - {}|null|undefined>): void; - getDataSourceReference( - request?: protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest, - optionsOrCallback?: CallOptions|Callback< - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, - {}|null|undefined>, - callback?: Callback< - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, - {}|null|undefined>): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|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('getDataSourceReference request %j', request); - const wrappedCallback: Callback< - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|null|undefined, - {}|null|undefined>|undefined = callback - ? (error, response, options, rawResponse) => { - this._log.info('getDataSourceReference response %j', response); - callback!(error, response, options, rawResponse); // We verified callback above. - } - : undefined; - return this.innerApiCalls.getDataSourceReference(request, options, wrappedCallback) - ?.then(([response, options, rawResponse]: [ - protos.google.cloud.backupdr.v1.IDataSourceReference, - protos.google.cloud.backupdr.v1.IGetDataSourceReferenceRequest|undefined, - {}|undefined - ]) => { - this._log.info('getDataSourceReference response %j', response); - return [response, options, rawResponse]; - }).catch((error: any) => { - if (error && 'statusDetails' in error && error.statusDetails instanceof Array) { - const protos = this._gaxModule.protobuf.Root.fromJSON(jsonProtos) as unknown as gax.protobuf.Type; - error.statusDetails = decodeAnyProtosInArray(error.statusDetails, protos); - } - throw error; - }); - } - -/** - * Creates a new ManagementServer in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The management server project and location in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR - * locations map to Google Cloud regions, for example **us-central1**. - * @param {string} request.managementServerId - * Required. The name of the management server to create. The name must be - * unique for the specified project and location. - * @param {google.cloud.backupdr.v1.ManagementServer} request.managementServer - * Required. A [management server - * resource][google.cloud.backupdr.v1.ManagementServer] - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/backup_d_r.create_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async - */ - createManagementServer( - request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createManagementServer( - request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createManagementServer( - request: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createManagementServer( - request?: protos.google.cloud.backupdr.v1.ICreateManagementServerRequest, - 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('createManagementServer response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createManagementServer request %j', request); - return this.innerApiCalls.createManagementServer(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createManagementServer response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createManagementServer()`. - * @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/backup_d_r.create_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_CreateManagementServer_async - */ - async checkCreateManagementServerProgress(name: string): Promise>{ - this._log.info('createManagementServer 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.createManagementServer, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single ManagementServer. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.delete_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async - */ - deleteManagementServer( - request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteManagementServer( - request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteManagementServer( - request: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteManagementServer( - request?: protos.google.cloud.backupdr.v1.IDeleteManagementServerRequest, - 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('deleteManagementServer response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteManagementServer request %j', request); - return this.innerApiCalls.deleteManagementServer(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteManagementServer response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteManagementServer()`. - * @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/backup_d_r.delete_management_server.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteManagementServer_async - */ - async checkDeleteManagementServerProgress(name: string): Promise>{ - this._log.info('deleteManagementServer 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.deleteManagementServer, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Creates a new BackupVault in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Value for parent. - * @param {string} request.backupVaultId - * Required. ID of the requesting object - * If auto-generating ID server-side, remove this field and - * backup_vault_id from the method_signature of Create RPC - * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault - * Required. The resource being created - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. Only validate the request, but do not perform mutations. - * The default is 'false'. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.create_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async - */ - createBackupVault( - request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackupVault( - request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackupVault( - request: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackupVault( - request?: protos.google.cloud.backupdr.v1.ICreateBackupVaultRequest, - 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('createBackupVault response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackupVault request %j', request); - return this.innerApiCalls.createBackupVault(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackupVault response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackupVault()`. - * @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/backup_d_r.create_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_CreateBackupVault_async - */ - async checkCreateBackupVaultProgress(name: string): Promise>{ - this._log.info('createBackupVault 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.createBackupVault, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the settings of a BackupVault. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * BackupVault resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * @param {google.cloud.backupdr.v1.BackupVault} request.backupVault - * Required. The resource being updated - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.validateOnly] - * Optional. Only validate the request, but do not perform mutations. - * The default is 'false'. - * @param {boolean} [request.force] - * Optional. If set to true, will not check plan duration against backup vault - * enforcement duration. - * @param {boolean} [request.forceUpdateAccessRestriction] - * Optional. If set to true, we will force update access restriction even if - * some non compliant data sources are present. The default is 'false'. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.update_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async - */ - updateBackupVault( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackupVault( - request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackupVault( - request: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackupVault( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupVaultRequest, - 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({ - 'backup_vault.name': request.backupVault!.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('updateBackupVault response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackupVault request %j', request); - return this.innerApiCalls.updateBackupVault(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackupVault response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackupVault()`. - * @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/backup_d_r.update_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupVault_async - */ - async checkUpdateBackupVaultProgress(name: string): Promise>{ - this._log.info('updateBackupVault 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.updateBackupVault, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a BackupVault. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.force] - * Optional. If set to true, any data source from this backup vault will also - * be deleted. - * @param {string} request.etag - * The current etag of the backup vault. - * If an etag is provided and does not match the current etag of the - * connection, deletion will be blocked. - * @param {boolean} [request.validateOnly] - * Optional. Only validate the request, but do not perform mutations. - * The default is 'false'. - * @param {boolean} [request.allowMissing] - * Optional. If true and the BackupVault is not found, the request will - * succeed but no action will be taken. - * @param {boolean} [request.ignoreBackupPlanReferences] - * Optional. If set to true, backupvault deletion will proceed even if there - * are backup plans referencing the backupvault. The default is 'false'. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.delete_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async - */ - deleteBackupVault( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackupVault( - request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackupVault( - request: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackupVault( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupVaultRequest, - 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('deleteBackupVault response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackupVault request %j', request); - return this.innerApiCalls.deleteBackupVault(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackupVault response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackupVault()`. - * @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/backup_d_r.delete_backup_vault.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupVault_async - */ - async checkDeleteBackupVaultProgress(name: string): Promise>{ - this._log.info('deleteBackupVault 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.deleteBackupVault, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the settings of a DataSource. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * DataSource resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * @param {google.cloud.backupdr.v1.DataSource} request.dataSource - * Required. The resource being updated - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {boolean} [request.allowMissing] - * Optional. Enable upsert. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.update_data_source.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async - */ - updateDataSource( - request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateDataSource( - request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDataSource( - request: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateDataSource( - request?: protos.google.cloud.backupdr.v1.IUpdateDataSourceRequest, - 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({ - 'data_source.name': request.dataSource!.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('updateDataSource response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateDataSource request %j', request); - return this.innerApiCalls.updateDataSource(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateDataSource response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateDataSource()`. - * @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/backup_d_r.update_data_source.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateDataSource_async - */ - async checkUpdateDataSourceProgress(name: string): Promise>{ - this._log.info('updateDataSource 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.updateDataSource, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Updates the settings of a Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.protobuf.FieldMask} request.updateMask - * Required. Field mask is used to specify the fields to be overwritten in the - * Backup resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * @param {google.cloud.backupdr.v1.Backup} request.backup - * Required. The resource being updated - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * 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/backup_d_r.update_backup.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async - */ - updateBackup( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackup( - request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackup( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupRequest, - 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({ - 'backup.name': request.backup!.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('updateBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackup request %j', request); - return this.innerApiCalls.updateBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackup()`. - * @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/backup_d_r.update_backup.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackup_async - */ - async checkUpdateBackupProgress(name: string): Promise>{ - this._log.info('updateBackup 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.updateBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the resource. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.delete_backup.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async - */ - deleteBackup( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackup( - request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackup( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupRequest, - 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('deleteBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackup request %j', request); - return this.innerApiCalls.deleteBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackup()`. - * @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/backup_d_r.delete_backup.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackup_async - */ - async checkDeleteBackupProgress(name: string): Promise>{ - this._log.info('deleteBackup 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.deleteBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Restore from a Backup - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the Backup instance, in the format - * 'projects/* /locations/* /backupVaults/* /dataSources/* /backups/'. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {google.cloud.backupdr.v1.ComputeInstanceTargetEnvironment} request.computeInstanceTargetEnvironment - * Compute Engine target environment to be used during restore. - * @param {google.cloud.backupdr.v1.DiskTargetEnvironment} request.diskTargetEnvironment - * Disk target environment to be used during restore. - * @param {google.cloud.backupdr.v1.RegionDiskTargetEnvironment} request.regionDiskTargetEnvironment - * Region disk target environment to be used during restore. - * @param {google.cloud.backupdr.v1.ComputeInstanceRestoreProperties} request.computeInstanceRestoreProperties - * Compute Engine instance properties to be overridden during restore. - * @param {google.cloud.backupdr.v1.DiskRestoreProperties} request.diskRestoreProperties - * Disk properties to be overridden during restore. - * @param {google.protobuf.FieldMask} [request.clearOverridesFieldMask] - * Optional. A field mask used to clear server-side default values - * for fields within the `instance_properties` oneof. - * - * When a field in this mask is cleared, the server will not apply its - * default logic (like inheriting a value from the source) for that field. - * - * The most common current use case is clearing default encryption keys. - * - * Examples of field mask paths: - * - Compute Instance Disks: - * `compute_instance_restore_properties.disks.*.disk_encryption_key` - * - Single Disk: `disk_restore_properties.disk_encryption_key` - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.restore_backup.js - * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async - */ - restoreBackup( - request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - restoreBackup( - request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreBackup( - request: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - restoreBackup( - request?: protos.google.cloud.backupdr.v1.IRestoreBackupRequest, - 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('restoreBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('restoreBackup request %j', request); - return this.innerApiCalls.restoreBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('restoreBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `restoreBackup()`. - * @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/backup_d_r.restore_backup.js - * region_tag:backupdr_v1_generated_BackupDR_RestoreBackup_async - */ - async checkRestoreBackupProgress(name: string): Promise>{ - this._log.info('restoreBackup 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.restoreBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Create a BackupPlan - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The `BackupPlan` project and location in the format - * `projects/{project}/locations/{location}`. In Cloud BackupDR locations - * map to GCP regions, for example **us-central1**. - * @param {string} request.backupPlanId - * Required. The name of the `BackupPlan` to create. The name must be unique - * for the specified project and location.The name must start with a lowercase - * letter followed by up to 62 lowercase letters, numbers, or hyphens. - * Pattern, /{@link protos.a-z0-9-|a-z}{,62}/. - * @param {google.cloud.backupdr.v1.BackupPlan} request.backupPlan - * Required. The `BackupPlan` resource object to create. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.create_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async - */ - createBackupPlan( - request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackupPlan( - request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackupPlan( - request: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackupPlan( - request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanRequest, - 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('createBackupPlan response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackupPlan request %j', request); - return this.innerApiCalls.createBackupPlan(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackupPlan response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackupPlan()`. - * @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/backup_d_r.create_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlan_async - */ - async checkCreateBackupPlanProgress(name: string): Promise>{ - this._log.info('createBackupPlan 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.createBackupPlan, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update a BackupPlan. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.backupdr.v1.BackupPlan} request.backupPlan - * Required. The resource being updated - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * Field mask is used to specify the fields to be overwritten in the - * BackupPlan resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * Currently, these fields are supported in update: description, schedules, - * retention period, adding and removing Backup Rules. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.update_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlan_async - */ - updateBackupPlan( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackupPlan( - request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackupPlan( - request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackupPlan( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanRequest, - 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({ - 'backup_plan.name': request.backupPlan!.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('updateBackupPlan response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackupPlan request %j', request); - return this.innerApiCalls.updateBackupPlan(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackupPlan response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackupPlan()`. - * @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/backup_d_r.update_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlan_async - */ - async checkUpdateBackupPlanProgress(name: string): Promise>{ - this._log.info('updateBackupPlan 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.updateBackupPlan, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single BackupPlan. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the `BackupPlan` to delete. - * - * Format: `projects/{project}/locations/{location}/backupPlans/{backup_plan}` - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.delete_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async - */ - deleteBackupPlan( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackupPlan( - request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackupPlan( - request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackupPlan( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanRequest, - 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('deleteBackupPlan response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackupPlan request %j', request); - return this.innerApiCalls.deleteBackupPlan(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackupPlan response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackupPlan()`. - * @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/backup_d_r.delete_backup_plan.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlan_async - */ - async checkDeleteBackupPlanProgress(name: string): Promise>{ - this._log.info('deleteBackupPlan 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.deleteBackupPlan, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Create a BackupPlanAssociation - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The backup plan association project and location in the format - * `projects/{project_id}/locations/{location}`. In Cloud BackupDR locations - * map to GCP regions, for example **us-central1**. - * @param {string} request.backupPlanAssociationId - * Required. The name of the backup plan association to create. The name must - * be unique for the specified project and location. - * @param {google.cloud.backupdr.v1.BackupPlanAssociation} request.backupPlanAssociation - * Required. The resource being created - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.create_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async - */ - createBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - createBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - createBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.ICreateBackupPlanAssociationRequest, - 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('createBackupPlanAssociation response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('createBackupPlanAssociation request %j', request); - return this.innerApiCalls.createBackupPlanAssociation(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('createBackupPlanAssociation response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `createBackupPlanAssociation()`. - * @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/backup_d_r.create_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_CreateBackupPlanAssociation_async - */ - async checkCreateBackupPlanAssociationProgress(name: string): Promise>{ - this._log.info('createBackupPlanAssociation 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.createBackupPlanAssociation, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Update a BackupPlanAssociation. - * - * @param {Object} request - * The request object that will be sent. - * @param {google.cloud.backupdr.v1.BackupPlanAssociation} request.backupPlanAssociation - * Required. The resource being updated - * @param {google.protobuf.FieldMask} request.updateMask - * Required. The list of fields to update. - * Field mask is used to specify the fields to be overwritten in the - * BackupPlanAssociation resource by the update. - * The fields specified in the update_mask are relative to the resource, not - * the full request. A field will be overwritten if it is in the mask. If the - * user does not provide a mask then the request will fail. - * Currently backup_plan_association.backup_plan is the only supported field. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.update_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async - */ - updateBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - updateBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - updateBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.IUpdateBackupPlanAssociationRequest, - 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({ - 'backup_plan_association.name': request.backupPlanAssociation!.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('updateBackupPlanAssociation response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('updateBackupPlanAssociation request %j', request); - return this.innerApiCalls.updateBackupPlanAssociation(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('updateBackupPlanAssociation response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `updateBackupPlanAssociation()`. - * @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/backup_d_r.update_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_UpdateBackupPlanAssociation_async - */ - async checkUpdateBackupPlanAssociationProgress(name: string): Promise>{ - this._log.info('updateBackupPlanAssociation 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.updateBackupPlanAssociation, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Deletes a single BackupPlanAssociation. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup plan association resource, in the format - * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.delete_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async - */ - deleteBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - deleteBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackupPlanAssociation( - request: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - deleteBackupPlanAssociation( - request?: protos.google.cloud.backupdr.v1.IDeleteBackupPlanAssociationRequest, - 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('deleteBackupPlanAssociation response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('deleteBackupPlanAssociation request %j', request); - return this.innerApiCalls.deleteBackupPlanAssociation(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('deleteBackupPlanAssociation response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `deleteBackupPlanAssociation()`. - * @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/backup_d_r.delete_backup_plan_association.js - * region_tag:backupdr_v1_generated_BackupDR_DeleteBackupPlanAssociation_async - */ - async checkDeleteBackupPlanAssociationProgress(name: string): Promise>{ - this._log.info('deleteBackupPlanAssociation 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.deleteBackupPlanAssociation, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Triggers a new Backup. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. Name of the backup plan association resource, in the format - * `projects/{project}/locations/{location}/backupPlanAssociations/{backupPlanAssociationId}` - * @param {string} request.ruleId - * Required. backup rule_id for which a backup needs to be triggered. - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes after the first request. - * - * For example, consider a situation where you make an initial request and - * the request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * a long running operation. Its `promise()` method returns a promise - * you can `await` for. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#long-running-operations | documentation } - * for more details and examples. - * @example include:samples/generated/v1/backup_d_r.trigger_backup.js - * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async - */ - triggerBackup( - request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - triggerBackup( - request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - triggerBackup( - request: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - triggerBackup( - request?: protos.google.cloud.backupdr.v1.ITriggerBackupRequest, - 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('triggerBackup response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('triggerBackup request %j', request); - return this.innerApiCalls.triggerBackup(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('triggerBackup response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `triggerBackup()`. - * @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/backup_d_r.trigger_backup.js - * region_tag:backupdr_v1_generated_BackupDR_TriggerBackup_async - */ - async checkTriggerBackupProgress(name: string): Promise>{ - this._log.info('triggerBackup 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.triggerBackup, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } -/** - * Initializes the service related config for a project. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Required. The resource name of the serviceConfig used to initialize the - * service. Format: - * `projects/{project_id}/locations/{location}/serviceConfig`. - * @param {string} request.resourceType - * Required. The resource type to which the default service config will be - * applied. Examples include, "compute.googleapis.com/Instance" and - * "storage.googleapis.com/Bucket". - * @param {string} [request.requestId] - * Optional. An optional request ID to identify requests. Specify a unique - * request ID so that if you must retry your request, the server will know to - * ignore the request if it has already been completed. The server will - * guarantee that for at least 60 minutes since the first request. - * - * For example, consider a situation where you make an initial request and t - * he request times out. If you make the request again with the same request - * ID, the server can check if original operation with the same request ID - * was received, and if so, will ignore the second request. This prevents - * clients from accidentally creating duplicate commitments. - * - * The request ID must be a valid UUID with the exception that zero UUID is - * not supported (00000000-0000-0000-0000-000000000000). - * @param {google.cloud.backupdr.v1.CloudSqlInstanceInitializationConfig} [request.cloudSqlInstanceInitializationConfig] - * Optional. The configuration for initializing a Cloud SQL instance. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.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/backup_d_r.initialize_service.js - * region_tag:backupdr_v1_generated_BackupDR_InitializeService_async - */ - initializeService( - request?: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, - options?: CallOptions): - Promise<[ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]>; - initializeService( - request: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, - options: CallOptions, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - initializeService( - request: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, - callback: Callback< - LROperation, - protos.google.longrunning.IOperation|null|undefined, - {}|null|undefined>): void; - initializeService( - request?: protos.google.cloud.backupdr.v1.IInitializeServiceRequest, - 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('initializeService response %j', rawResponse); - callback!(error, response, rawResponse, _); // We verified callback above. - } - : undefined; - this._log.info('initializeService request %j', request); - return this.innerApiCalls.initializeService(request, options, wrappedCallback) - ?.then(([response, rawResponse, _]: [ - LROperation, - protos.google.longrunning.IOperation|undefined, {}|undefined - ]) => { - this._log.info('initializeService response %j', rawResponse); - return [response, rawResponse, _]; - }); - } -/** - * Check the status of the long running operation returned by `initializeService()`. - * @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/backup_d_r.initialize_service.js - * region_tag:backupdr_v1_generated_BackupDR_InitializeService_async - */ - async checkInitializeServiceProgress(name: string): Promise>{ - this._log.info('initializeService 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.initializeService, this._gaxModule.createDefaultBackoffSettings()); - return decodeOperation as LROperation; - } - /** - * Lists ManagementServers in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.ManagementServer|ManagementServer}. - * 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 `listManagementServersAsync()` - * 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. - */ - listManagementServers( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest|null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse - ]>; - listManagementServers( - request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, - protos.google.cloud.backupdr.v1.IManagementServer>): void; - listManagementServers( - request: protos.google.cloud.backupdr.v1.IListManagementServersRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, - protos.google.cloud.backupdr.v1.IManagementServer>): void; - listManagementServers( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, - protos.google.cloud.backupdr.v1.IManagementServer>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListManagementServersRequest, - protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, - protos.google.cloud.backupdr.v1.IManagementServer>): - Promise<[ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest|null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListManagementServersRequest, - protos.google.cloud.backupdr.v1.IListManagementServersResponse|null|undefined, - protos.google.cloud.backupdr.v1.IManagementServer>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listManagementServers values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listManagementServers request %j', request); - return this.innerApiCalls - .listManagementServers(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IManagementServer[], - protos.google.cloud.backupdr.v1.IListManagementServersRequest|null, - protos.google.cloud.backupdr.v1.IListManagementServersResponse - ]) => { - this._log.info('listManagementServers values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listManagementServers`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.ManagementServer|ManagementServer} 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 `listManagementServersAsync()` - * 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. - */ - listManagementServersStream( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, - 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['listManagementServers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listManagementServers stream %j', request); - return this.descriptors.page.listManagementServers.createStream( - this.innerApiCalls.listManagementServers as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listManagementServers`, 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 project and location for which to retrieve management servers - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud BackupDR, locations map to Google Cloud regions, for example - * **us-central1**. To retrieve management servers for all locations, use "-" - * for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.ManagementServer|ManagementServer}. 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/backup_d_r.list_management_servers.js - * region_tag:backupdr_v1_generated_BackupDR_ListManagementServers_async - */ - listManagementServersAsync( - request?: protos.google.cloud.backupdr.v1.IListManagementServersRequest, - 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['listManagementServers']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listManagementServers iterate %j', request); - return this.descriptors.page.listManagementServers.asyncIterate( - this.innerApiCalls['listManagementServers'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists BackupVaults in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * Vault. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.BackupVault|BackupVault}. - * 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 `listBackupVaultsAsync()` - * 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. - */ - listBackupVaults( - request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupVault[], - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse - ]>; - listBackupVaults( - request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>): void; - listBackupVaults( - request: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>): void; - listBackupVaults( - request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupVault[], - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackupVaults values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackupVaults request %j', request); - return this.innerApiCalls - .listBackupVaults(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackupVault[], - protos.google.cloud.backupdr.v1.IListBackupVaultsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupVaultsResponse - ]) => { - this._log.info('listBackupVaults values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackupVaults`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * Vault. - * @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.backupdr.v1.BackupVault|BackupVault} 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 `listBackupVaultsAsync()` - * 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. - */ - listBackupVaultsStream( - request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - 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['listBackupVaults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupVaults stream %j', request); - return this.descriptors.page.listBackupVaults.createStream( - this.innerApiCalls.listBackupVaults as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackupVaults`, 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 project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @param {google.cloud.backupdr.v1.BackupVaultView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * Vault. - * @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.backupdr.v1.BackupVault|BackupVault}. 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/backup_d_r.list_backup_vaults.js - * region_tag:backupdr_v1_generated_BackupDR_ListBackupVaults_async - */ - listBackupVaultsAsync( - request?: protos.google.cloud.backupdr.v1.IListBackupVaultsRequest, - 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['listBackupVaults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupVaults iterate %j', request); - return this.descriptors.page.listBackupVaults.asyncIterate( - this.innerApiCalls['listBackupVaults'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * FetchUsableBackupVaults lists usable BackupVaults in a given project and - * location. Usable BackupVault are the ones that user has - * backupdr.backupVaults.get permission. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.BackupVault|BackupVault}. - * 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 `fetchUsableBackupVaultsAsync()` - * 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. - */ - fetchUsableBackupVaults( - request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupVault[], - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest|null, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse - ]>; - fetchUsableBackupVaults( - request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>): void; - fetchUsableBackupVaults( - request: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>): void; - fetchUsableBackupVaults( - request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupVault[], - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest|null, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IFetchUsableBackupVaultsRequest, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupVault>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('fetchUsableBackupVaults values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('fetchUsableBackupVaults request %j', request); - return this.innerApiCalls - .fetchUsableBackupVaults(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackupVault[], - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest|null, - protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsResponse - ]) => { - this._log.info('fetchUsableBackupVaults values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `fetchUsableBackupVaults`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.BackupVault|BackupVault} 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 `fetchUsableBackupVaultsAsync()` - * 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. - */ - fetchUsableBackupVaultsStream( - request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - 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['fetchUsableBackupVaults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchUsableBackupVaults stream %j', request); - return this.descriptors.page.fetchUsableBackupVaults.createStream( - this.innerApiCalls.fetchUsableBackupVaults as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `fetchUsableBackupVaults`, 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 project and location for which to retrieve backupvault stores - * information, in the format 'projects/{project_id}/locations/{location}'. In - * Cloud Backup and DR, locations map to Google Cloud regions, for example - * **us-central1**. - * To retrieve backupvault stores for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.BackupVault|BackupVault}. 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/backup_d_r.fetch_usable_backup_vaults.js - * region_tag:backupdr_v1_generated_BackupDR_FetchUsableBackupVaults_async - */ - fetchUsableBackupVaultsAsync( - request?: protos.google.cloud.backupdr.v1.IFetchUsableBackupVaultsRequest, - 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['fetchUsableBackupVaults']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchUsableBackupVaults iterate %j', request); - return this.descriptors.page.fetchUsableBackupVaults.asyncIterate( - this.innerApiCalls['fetchUsableBackupVaults'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataSources in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve data - * sources information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.DataSource|DataSource}. - * 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 `listDataSourcesAsync()` - * 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. - */ - listDataSources( - request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSource[], - protos.google.cloud.backupdr.v1.IListDataSourcesRequest|null, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse - ]>; - listDataSources( - request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSource>): void; - listDataSources( - request: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSource>): void; - listDataSources( - request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSource>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSource>): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSource[], - protos.google.cloud.backupdr.v1.IListDataSourcesRequest|null, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListDataSourcesRequest, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSource>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDataSources values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDataSources request %j', request); - return this.innerApiCalls - .listDataSources(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IDataSource[], - protos.google.cloud.backupdr.v1.IListDataSourcesRequest|null, - protos.google.cloud.backupdr.v1.IListDataSourcesResponse - ]) => { - this._log.info('listDataSources values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDataSources`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve data - * sources information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.DataSource|DataSource} 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 `listDataSourcesAsync()` - * 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. - */ - listDataSourcesStream( - request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - 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['listDataSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDataSources stream %j', request); - return this.descriptors.page.listDataSources.createStream( - this.innerApiCalls.listDataSources as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataSources`, 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 project and location for which to retrieve data - * sources information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the 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.backupdr.v1.DataSource|DataSource}. 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/backup_d_r.list_data_sources.js - * region_tag:backupdr_v1_generated_BackupDR_ListDataSources_async - */ - listDataSourcesAsync( - request?: protos.google.cloud.backupdr.v1.IListDataSourcesRequest, - 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['listDataSources']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDataSources iterate %j', request); - return this.descriptors.page.listDataSources.asyncIterate( - this.innerApiCalls['listDataSources'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists Backups in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backup - * information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * resource. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.Backup|Backup}. - * 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 `listBackupsAsync()` - * 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. - */ - listBackups( - request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackup[], - protos.google.cloud.backupdr.v1.IListBackupsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupsResponse - ]>; - listBackups( - request: protos.google.cloud.backupdr.v1.IListBackupsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupsRequest, - protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>): void; - listBackups( - request: protos.google.cloud.backupdr.v1.IListBackupsRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupsRequest, - protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>): void; - listBackups( - request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupsRequest, - protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupsRequest, - protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackup[], - protos.google.cloud.backupdr.v1.IListBackupsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListBackupsRequest, - protos.google.cloud.backupdr.v1.IListBackupsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackups values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackups request %j', request); - return this.innerApiCalls - .listBackups(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackup[], - protos.google.cloud.backupdr.v1.IListBackupsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupsResponse - ]) => { - this._log.info('listBackups values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackups`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backup - * information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * resource. - * @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.backupdr.v1.Backup|Backup} 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 `listBackupsAsync()` - * 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. - */ - listBackupsStream( - request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, - 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['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups stream %j', request); - return this.descriptors.page.listBackups.createStream( - this.innerApiCalls.listBackups as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackups`, 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 project and location for which to retrieve backup - * information, in the format - * 'projects/{project_id}/locations/{location}'. In Cloud Backup and DR, - * locations map to Google Cloud regions, for example **us-central1**. - * To retrieve data sources for all locations, use "-" for the - * '{location}' value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering results. - * @param {string} [request.orderBy] - * Optional. Hint for how to order the results. - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. Reserved for future use to provide a BASIC & FULL view of Backup - * resource. - * @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.backupdr.v1.Backup|Backup}. 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/backup_d_r.list_backups.js - * region_tag:backupdr_v1_generated_BackupDR_ListBackups_async - */ - listBackupsAsync( - request?: protos.google.cloud.backupdr.v1.IListBackupsRequest, - 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['listBackups']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackups iterate %j', request); - return this.descriptors.page.listBackups.asyncIterate( - this.innerApiCalls['listBackups'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Fetch Backups for a given resource type. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Datasources are the parent resource for the backups. - * Format: - * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sqladmin.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of Backups to return. The service may - * return fewer than this value. If unspecified, at most 50 - * Backups will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchBackupsForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchBackupsForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. This parameter is used to specify the view of the backup. - * If not specified, the default view is BASIC. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.Backup|Backup}. - * 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 `fetchBackupsForResourceTypeAsync()` - * 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. - */ - fetchBackupsForResourceType( - request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackup[], - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse - ]>; - fetchBackupsForResourceType( - request: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>): void; - fetchBackupsForResourceType( - request: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>): void; - fetchBackupsForResourceType( - request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackup[], - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IFetchBackupsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackup>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('fetchBackupsForResourceType values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('fetchBackupsForResourceType request %j', request); - return this.innerApiCalls - .fetchBackupsForResourceType(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackup[], - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeResponse - ]) => { - this._log.info('fetchBackupsForResourceType values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `fetchBackupsForResourceType`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. Datasources are the parent resource for the backups. - * Format: - * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sqladmin.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of Backups to return. The service may - * return fewer than this value. If unspecified, at most 50 - * Backups will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchBackupsForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchBackupsForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. This parameter is used to specify the view of the backup. - * If not specified, the default view is BASIC. - * @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.backupdr.v1.Backup|Backup} 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 `fetchBackupsForResourceTypeAsync()` - * 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. - */ - fetchBackupsForResourceTypeStream( - request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - 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['fetchBackupsForResourceType']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchBackupsForResourceType stream %j', request); - return this.descriptors.page.fetchBackupsForResourceType.createStream( - this.innerApiCalls.fetchBackupsForResourceType as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `fetchBackupsForResourceType`, 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. Datasources are the parent resource for the backups. - * Format: - * projects/{project}/locations/{location}/backupVaults/{backupVaultId}/dataSources/{datasourceId} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sqladmin.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of Backups to return. The service may - * return fewer than this value. If unspecified, at most 50 - * Backups will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchBackupsForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchBackupsForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * @param {google.cloud.backupdr.v1.BackupView} [request.view] - * Optional. This parameter is used to specify the view of the backup. - * If not specified, the default view is BASIC. - * @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.backupdr.v1.Backup|Backup}. 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/backup_d_r.fetch_backups_for_resource_type.js - * region_tag:backupdr_v1_generated_BackupDR_FetchBackupsForResourceType_async - */ - fetchBackupsForResourceTypeAsync( - request?: protos.google.cloud.backupdr.v1.IFetchBackupsForResourceTypeRequest, - 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['fetchBackupsForResourceType']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchBackupsForResourceType iterate %j', request); - return this.descriptors.page.fetchBackupsForResourceType.asyncIterate( - this.innerApiCalls['fetchBackupsForResourceType'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists BackupPlans in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve `BackupPlans` - * information. Format: `projects/{project}/locations/{location}`. In Cloud - * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To - * retrieve backup plans for all locations, use "-" for the - * `{location}` value. - * @param {number} [request.pageSize] - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * to determine if there are more instances left to be queried. - * @param {string} [request.pageToken] - * Optional. The value of - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the page token. - * @param {string} [request.filter] - * Optional. Field match expression used to filter the results. - * @param {string} [request.orderBy] - * Optional. Field by which to sort the 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.backupdr.v1.BackupPlan|BackupPlan}. - * 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 `listBackupPlansAsync()` - * 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. - */ - listBackupPlans( - request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlan[], - protos.google.cloud.backupdr.v1.IListBackupPlansRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse - ]>; - listBackupPlans( - request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlan>): void; - listBackupPlans( - request: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlan>): void; - listBackupPlans( - request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlan>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlan>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlan[], - protos.google.cloud.backupdr.v1.IListBackupPlansRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListBackupPlansRequest, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlan>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackupPlans values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackupPlans request %j', request); - return this.innerApiCalls - .listBackupPlans(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackupPlan[], - protos.google.cloud.backupdr.v1.IListBackupPlansRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlansResponse - ]) => { - this._log.info('listBackupPlans values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackupPlans`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve `BackupPlans` - * information. Format: `projects/{project}/locations/{location}`. In Cloud - * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To - * retrieve backup plans for all locations, use "-" for the - * `{location}` value. - * @param {number} [request.pageSize] - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * to determine if there are more instances left to be queried. - * @param {string} [request.pageToken] - * Optional. The value of - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the page token. - * @param {string} [request.filter] - * Optional. Field match expression used to filter the results. - * @param {string} [request.orderBy] - * Optional. Field by which to sort the 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.backupdr.v1.BackupPlan|BackupPlan} 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 `listBackupPlansAsync()` - * 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. - */ - listBackupPlansStream( - request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - 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['listBackupPlans']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupPlans stream %j', request); - return this.descriptors.page.listBackupPlans.createStream( - this.innerApiCalls.listBackupPlans as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackupPlans`, 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 project and location for which to retrieve `BackupPlans` - * information. Format: `projects/{project}/locations/{location}`. In Cloud - * BackupDR, locations map to GCP regions, for e.g. **us-central1**. To - * retrieve backup plans for all locations, use "-" for the - * `{location}` value. - * @param {number} [request.pageSize] - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * to determine if there are more instances left to be queried. - * @param {string} [request.pageToken] - * Optional. The value of - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the page token. - * @param {string} [request.filter] - * Optional. Field match expression used to filter the results. - * @param {string} [request.orderBy] - * Optional. Field by which to sort the 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.backupdr.v1.BackupPlan|BackupPlan}. 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/backup_d_r.list_backup_plans.js - * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlans_async - */ - listBackupPlansAsync( - request?: protos.google.cloud.backupdr.v1.IListBackupPlansRequest, - 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['listBackupPlans']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupPlans iterate %j', request); - return this.descriptors.page.listBackupPlans.asyncIterate( - this.innerApiCalls['listBackupPlans'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists BackupPlanRevisions in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve - * `BackupPlanRevisions` information. Format: - * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In - * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. - * @param {number} [request.pageSize] - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * to determine if there are more instances left to be queried. - * @param {string} [request.pageToken] - * Optional. The value of - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the 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.backupdr.v1.BackupPlanRevision|BackupPlanRevision}. - * 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 `listBackupPlanRevisionsAsync()` - * 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. - */ - listBackupPlanRevisions( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanRevision[], - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse - ]>; - listBackupPlanRevisions( - request: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanRevision>): void; - listBackupPlanRevisions( - request: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanRevision>): void; - listBackupPlanRevisions( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanRevision>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanRevision>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanRevision[], - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListBackupPlanRevisionsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanRevision>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackupPlanRevisions values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackupPlanRevisions request %j', request); - return this.innerApiCalls - .listBackupPlanRevisions(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackupPlanRevision[], - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsResponse - ]) => { - this._log.info('listBackupPlanRevisions values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackupPlanRevisions`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve - * `BackupPlanRevisions` information. Format: - * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In - * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. - * @param {number} [request.pageSize] - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * to determine if there are more instances left to be queried. - * @param {string} [request.pageToken] - * Optional. The value of - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the 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.backupdr.v1.BackupPlanRevision|BackupPlanRevision} 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 `listBackupPlanRevisionsAsync()` - * 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. - */ - listBackupPlanRevisionsStream( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - 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['listBackupPlanRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupPlanRevisions stream %j', request); - return this.descriptors.page.listBackupPlanRevisions.createStream( - this.innerApiCalls.listBackupPlanRevisions as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackupPlanRevisions`, 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 project and location for which to retrieve - * `BackupPlanRevisions` information. Format: - * `projects/{project}/locations/{location}/backupPlans/{backup_plan}`. In - * Cloud BackupDR, locations map to GCP regions, for e.g. **us-central1**. - * @param {number} [request.pageSize] - * Optional. The maximum number of `BackupPlans` to return in a single - * response. If not specified, a default value will be chosen by the service. - * Note that the response may include a partial list and a caller should - * only rely on the response's - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * to determine if there are more instances left to be queried. - * @param {string} [request.pageToken] - * Optional. The value of - * {@link protos.google.cloud.backupdr.v1.ListBackupPlansResponse.next_page_token|next_page_token} - * received from a previous `ListBackupPlans` call. - * Provide this to retrieve the subsequent page in a multi-page list of - * results. When paginating, all other parameters provided to - * `ListBackupPlans` must match the call that provided the 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.backupdr.v1.BackupPlanRevision|BackupPlanRevision}. 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/backup_d_r.list_backup_plan_revisions.js - * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlanRevisions_async - */ - listBackupPlanRevisionsAsync( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanRevisionsRequest, - 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['listBackupPlanRevisions']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupPlanRevisions iterate %j', request); - return this.descriptors.page.listBackupPlanRevisions.asyncIterate( - this.innerApiCalls['listBackupPlanRevisions'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists BackupPlanAssociations in a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backup Plan - * Associations information, in the format - * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations - * map to GCP regions, for example **us-central1**. To retrieve backup plan - * associations for all locations, use "-" for the - * `{location}` value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering 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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. - * 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 `listBackupPlanAssociationsAsync()` - * 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. - */ - listBackupPlanAssociations( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse - ]>; - listBackupPlanAssociations( - request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; - listBackupPlanAssociations( - request: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; - listBackupPlanAssociations( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListBackupPlanAssociationsRequest, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listBackupPlanAssociations values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listBackupPlanAssociations request %j', request); - return this.innerApiCalls - .listBackupPlanAssociations(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest|null, - protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsResponse - ]) => { - this._log.info('listBackupPlanAssociations values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listBackupPlanAssociations`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The project and location for which to retrieve backup Plan - * Associations information, in the format - * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations - * map to GCP regions, for example **us-central1**. To retrieve backup plan - * associations for all locations, use "-" for the - * `{location}` value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering 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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation} 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 `listBackupPlanAssociationsAsync()` - * 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. - */ - listBackupPlanAssociationsStream( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - 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['listBackupPlanAssociations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupPlanAssociations stream %j', request); - return this.descriptors.page.listBackupPlanAssociations.createStream( - this.innerApiCalls.listBackupPlanAssociations as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listBackupPlanAssociations`, 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 project and location for which to retrieve backup Plan - * Associations information, in the format - * `projects/{project_id}/locations/{location}`. In Cloud BackupDR, locations - * map to GCP regions, for example **us-central1**. To retrieve backup plan - * associations for all locations, use "-" for the - * `{location}` value. - * @param {number} [request.pageSize] - * Optional. Requested page size. Server may return fewer items than - * requested. If unspecified, server will pick an appropriate default. - * @param {string} [request.pageToken] - * Optional. A token identifying a page of results the server should return. - * @param {string} [request.filter] - * Optional. Filtering 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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. 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/backup_d_r.list_backup_plan_associations.js - * region_tag:backupdr_v1_generated_BackupDR_ListBackupPlanAssociations_async - */ - listBackupPlanAssociationsAsync( - request?: protos.google.cloud.backupdr.v1.IListBackupPlanAssociationsRequest, - 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['listBackupPlanAssociations']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listBackupPlanAssociations iterate %j', request); - return this.descriptors.page.listBackupPlanAssociations.asyncIterate( - this.innerApiCalls['listBackupPlanAssociations'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * List BackupPlanAssociations for a given resource type. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of BackupPlanAssociations to return. The - * service may return fewer than this value. If unspecified, at most 50 - * BackupPlanAssociations will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchBackupPlanAssociationsForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchBackupPlanAssociationsForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * resource - * * backup_plan - * * state - * * data_source - * * cloud_sql_instance_backup_plan_association_properties.instance_create_time - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * * 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 Array of {@link protos.google.cloud.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. - * 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 `fetchBackupPlanAssociationsForResourceTypeAsync()` - * 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. - */ - fetchBackupPlanAssociationsForResourceType( - request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse - ]>; - fetchBackupPlanAssociationsForResourceType( - request: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; - fetchBackupPlanAssociationsForResourceType( - request: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): void; - fetchBackupPlanAssociationsForResourceType( - request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>): - Promise<[ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IBackupPlanAssociation>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('fetchBackupPlanAssociationsForResourceType values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('fetchBackupPlanAssociationsForResourceType request %j', request); - return this.innerApiCalls - .fetchBackupPlanAssociationsForResourceType(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IBackupPlanAssociation[], - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeResponse - ]) => { - this._log.info('fetchBackupPlanAssociationsForResourceType values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `fetchBackupPlanAssociationsForResourceType`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of BackupPlanAssociations to return. The - * service may return fewer than this value. If unspecified, at most 50 - * BackupPlanAssociations will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchBackupPlanAssociationsForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchBackupPlanAssociationsForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * resource - * * backup_plan - * * state - * * data_source - * * cloud_sql_instance_backup_plan_association_properties.instance_create_time - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * * name - * @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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation} 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 `fetchBackupPlanAssociationsForResourceTypeAsync()` - * 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. - */ - fetchBackupPlanAssociationsForResourceTypeStream( - request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - 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['fetchBackupPlanAssociationsForResourceType']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchBackupPlanAssociationsForResourceType stream %j', request); - return this.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream( - this.innerApiCalls.fetchBackupPlanAssociationsForResourceType as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `fetchBackupPlanAssociationsForResourceType`, 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 resource name. - * Format: projects/{project}/locations/{location} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of BackupPlanAssociations to return. The - * service may return fewer than this value. If unspecified, at most 50 - * BackupPlanAssociations will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchBackupPlanAssociationsForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchBackupPlanAssociationsForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * resource - * * backup_plan - * * state - * * data_source - * * cloud_sql_instance_backup_plan_association_properties.instance_create_time - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * * name - * @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.backupdr.v1.BackupPlanAssociation|BackupPlanAssociation}. 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/backup_d_r.fetch_backup_plan_associations_for_resource_type.js - * region_tag:backupdr_v1_generated_BackupDR_FetchBackupPlanAssociationsForResourceType_async - */ - fetchBackupPlanAssociationsForResourceTypeAsync( - request?: protos.google.cloud.backupdr.v1.IFetchBackupPlanAssociationsForResourceTypeRequest, - 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['fetchBackupPlanAssociationsForResourceType']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchBackupPlanAssociationsForResourceType iterate %j', request); - return this.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate( - this.innerApiCalls['fetchBackupPlanAssociationsForResourceType'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Lists DataSourceReferences for a given project and location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - * @param {number} [request.pageSize] - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDataSourceReferences` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDataSourceReferences` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. - * - * The following field and operator combinations are supported: - * - * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` - * * data_source_gcp_resource_info.type with `=`, `!=` - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/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.backupdr.v1.DataSourceReference|DataSourceReference}. - * 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 `listDataSourceReferencesAsync()` - * 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. - */ - listDataSourceReferences( - request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSourceReference[], - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest|null, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse - ]>; - listDataSourceReferences( - request: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>): void; - listDataSourceReferences( - request: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>): void; - listDataSourceReferences( - request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSourceReference[], - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest|null, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IListDataSourceReferencesRequest, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('listDataSourceReferences values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('listDataSourceReferences request %j', request); - return this.innerApiCalls - .listDataSourceReferences(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IDataSourceReference[], - protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest|null, - protos.google.cloud.backupdr.v1.IListDataSourceReferencesResponse - ]) => { - this._log.info('listDataSourceReferences values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `listDataSourceReferences`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - * @param {number} [request.pageSize] - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDataSourceReferences` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDataSourceReferences` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. - * - * The following field and operator combinations are supported: - * - * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` - * * data_source_gcp_resource_info.type with `=`, `!=` - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * @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.backupdr.v1.DataSourceReference|DataSourceReference} 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 `listDataSourceReferencesAsync()` - * 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. - */ - listDataSourceReferencesStream( - request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - 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['listDataSourceReferences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDataSourceReferences stream %j', request); - return this.descriptors.page.listDataSourceReferences.createStream( - this.innerApiCalls.listDataSourceReferences as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `listDataSourceReferences`, 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 resource name. - * Format: projects/{project}/locations/{location} - * @param {number} [request.pageSize] - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous `ListDataSourceReferences` - * call. Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `ListDataSourceReferences` must match the call that provided the page - * token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results listed in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. - * - * The following field and operator combinations are supported: - * - * * data_source_gcp_resource_info.gcp_resourcename with `=`, `!=` - * * data_source_gcp_resource_info.type with `=`, `!=` - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * @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.backupdr.v1.DataSourceReference|DataSourceReference}. 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/backup_d_r.list_data_source_references.js - * region_tag:backupdr_v1_generated_BackupDR_ListDataSourceReferences_async - */ - listDataSourceReferencesAsync( - request?: protos.google.cloud.backupdr.v1.IListDataSourceReferencesRequest, - 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['listDataSourceReferences']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('listDataSourceReferences iterate %j', request); - return this.descriptors.page.listDataSourceReferences.asyncIterate( - this.innerApiCalls['listDataSourceReferences'] as GaxCall, - request as {}, - callSettings - ) as AsyncIterable; - } - /** - * Fetch DataSourceReferences for a given project, location and resource type. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchDataSourceReferencesForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchDataSourceReferencesForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_backup_config_state - * * data_source_backup_count - * * data_source_backup_config_info.last_backup_state - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_gcp_resource_info.type - * * data_source_gcp_resource_info.location - * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * * 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 Array of {@link protos.google.cloud.backupdr.v1.DataSourceReference|DataSourceReference}. - * 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 `fetchDataSourceReferencesForResourceTypeAsync()` - * 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. - */ - fetchDataSourceReferencesForResourceType( - request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - options?: CallOptions): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSourceReference[], - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse - ]>; - fetchDataSourceReferencesForResourceType( - request: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - options: CallOptions, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>): void; - fetchDataSourceReferencesForResourceType( - request: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - callback: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>): void; - fetchDataSourceReferencesForResourceType( - request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - optionsOrCallback?: CallOptions|PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>, - callback?: PaginationCallback< - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>): - Promise<[ - protos.google.cloud.backupdr.v1.IDataSourceReference[], - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse - ]>|void { - request = request || {}; - let options: CallOptions; - if (typeof 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.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse|null|undefined, - protos.google.cloud.backupdr.v1.IDataSourceReference>|undefined = callback - ? (error, values, nextPageRequest, rawResponse) => { - this._log.info('fetchDataSourceReferencesForResourceType values %j', values); - callback!(error, values, nextPageRequest, rawResponse); // We verified callback above. - } - : undefined; - this._log.info('fetchDataSourceReferencesForResourceType request %j', request); - return this.innerApiCalls - .fetchDataSourceReferencesForResourceType(request, options, wrappedCallback) - ?.then(([response, input, output]: [ - protos.google.cloud.backupdr.v1.IDataSourceReference[], - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest|null, - protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeResponse - ]) => { - this._log.info('fetchDataSourceReferencesForResourceType values %j', response); - return [response, input, output]; - }); - } - -/** - * Equivalent to `fetchDataSourceReferencesForResourceType`, but returns a NodeJS Stream object. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.parent - * Required. The parent resource name. - * Format: projects/{project}/locations/{location} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchDataSourceReferencesForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchDataSourceReferencesForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_backup_config_state - * * data_source_backup_count - * * data_source_backup_config_info.last_backup_state - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_gcp_resource_info.type - * * data_source_gcp_resource_info.location - * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * * name - * @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.backupdr.v1.DataSourceReference|DataSourceReference} 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 `fetchDataSourceReferencesForResourceTypeAsync()` - * 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. - */ - fetchDataSourceReferencesForResourceTypeStream( - request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - 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['fetchDataSourceReferencesForResourceType']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchDataSourceReferencesForResourceType stream %j', request); - return this.descriptors.page.fetchDataSourceReferencesForResourceType.createStream( - this.innerApiCalls.fetchDataSourceReferencesForResourceType as GaxCall, - request, - callSettings - ); - } - -/** - * Equivalent to `fetchDataSourceReferencesForResourceType`, 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 resource name. - * Format: projects/{project}/locations/{location} - * @param {string} request.resourceType - * Required. The type of the GCP resource. - * Ex: sql.googleapis.com/Instance - * @param {number} [request.pageSize] - * Optional. The maximum number of DataSourceReferences to return. The service - * may return fewer than this value. If unspecified, at most 50 - * DataSourceReferences will be returned. The maximum value is 100; values - * above 100 will be coerced to 100. - * @param {string} [request.pageToken] - * Optional. A page token, received from a previous call of - * `FetchDataSourceReferencesForResourceType`. - * Provide this to retrieve the subsequent page. - * - * When paginating, all other parameters provided to - * `FetchDataSourceReferencesForResourceType` must match - * the call that provided the page token. - * @param {string} [request.filter] - * Optional. A filter expression that filters the results fetched in the - * response. The expression must specify the field name, a comparison - * operator, and the value that you want to use for filtering. Supported - * fields: - * * data_source - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_backup_config_state - * * data_source_backup_count - * * data_source_backup_config_info.last_backup_state - * * data_source_gcp_resource_info.gcp_resourcename - * * data_source_gcp_resource_info.type - * * data_source_gcp_resource_info.location - * * data_source_gcp_resource_info.cloud_sql_instance_properties.instance_create_time - * @param {string} [request.orderBy] - * Optional. A comma-separated list of fields to order by, sorted in ascending - * order. Use "desc" after a field name for descending. - * - * Supported fields: - * * name - * @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.backupdr.v1.DataSourceReference|DataSourceReference}. 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/backup_d_r.fetch_data_source_references_for_resource_type.js - * region_tag:backupdr_v1_generated_BackupDR_FetchDataSourceReferencesForResourceType_async - */ - fetchDataSourceReferencesForResourceTypeAsync( - request?: protos.google.cloud.backupdr.v1.IFetchDataSourceReferencesForResourceTypeRequest, - 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['fetchDataSourceReferencesForResourceType']; - const callSettings = defaultCallSettings.merge(options); - this.initialize().catch(err => {throw err}); - this._log.info('fetchDataSourceReferencesForResourceType iterate %j', request); - return this.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate( - this.innerApiCalls['fetchDataSourceReferencesForResourceType'] 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 information about a location. - * - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * Resource name for the location. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html | CallOptions} for more details. - * @returns {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing {@link google.cloud.location.Location | Location}. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation } - * for more details and examples. - * @example - * ``` - * const [response] = await client.getLocation(request); - * ``` - */ - getLocation( - request: LocationProtos.google.cloud.location.IGetLocationRequest, - options?: - | gax.CallOptions - | Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - >, - callback?: Callback< - LocationProtos.google.cloud.location.ILocation, - | LocationProtos.google.cloud.location.IGetLocationRequest - | null - | undefined, - {} | null | undefined - > - ): Promise { - return this.locationsClient.getLocation(request, options, callback); - } - -/** - * Lists information about the supported locations for this service. Returns an iterable object. - * - * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand. - * @param {Object} request - * The request object that will be sent. - * @param {string} request.name - * The resource that owns the locations collection, if applicable. - * @param {string} request.filter - * The standard list filter. - * @param {number} request.pageSize - * The standard list page size. - * @param {string} request.pageToken - * The standard list page token. - * @param {object} [options] - * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details. - * @returns {Object} - * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }. - * When you iterate the returned iterable, each element will be an object representing - * {@link google.cloud.location.Location | Location}. The API will be called under the hood as needed, once per the page, - * so you can stop the iteration when you don't need more results. - * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation } - * for more details and examples. - * @example - * ``` - * const iterable = client.listLocationsAsync(request); - * for await (const response of iterable) { - * // process response - * } - * ``` - */ - listLocationsAsync( - request: LocationProtos.google.cloud.location.IListLocationsRequest, - options?: CallOptions - ): AsyncIterable { - return this.locationsClient.listLocationsAsync(request, options); - } - -/** - * Gets the latest state of a long-running operation. Clients can use this - * method to poll the operation result at intervals as recommended by the API - * service. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error, ?Object)=} callback - * The function which will be called with the result of the API call. - * - * The second parameter to the callback is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * @return {Promise} - The promise which resolves to an array. - * The first element of the array is an object representing - * {@link google.longrunning.Operation | google.longrunning.Operation}. - * The promise has a method named "cancel" which cancels the ongoing API call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * const name = ''; - * const [response] = await client.getOperation({name}); - * // doThingsWith(response) - * ``` - */ - getOperation( - request: protos.google.longrunning.GetOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.longrunning.Operation, - protos.google.longrunning.GetOperationRequest, - {} | null | undefined - > - ): Promise<[protos.google.longrunning.Operation]> { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.getOperation(request, options, callback); - } - /** - * Lists operations that match the specified filter in the request. If the - * server doesn't support this method, it returns `UNIMPLEMENTED`. Returns an iterable object. - * - * For-await-of syntax is used with the iterable to recursively get response element on-demand. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation collection. - * @param {string} request.filter - The standard list filter. - * @param {number=} request.pageSize - - * The maximum number of resources contained in the underlying API - * response. If page streaming is performed per-resource, this - * parameter does not affect the return value. If page streaming is - * performed per-page, this determines the maximum number of - * resources in a page. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @returns {Object} - * An iterable Object that conforms to {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | iteration protocols}. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * for await (const response of client.listOperationsAsync(request)); - * // doThingsWith(response) - * ``` - */ - listOperationsAsync( - request: protos.google.longrunning.ListOperationsRequest, - options?: gax.CallOptions - ): AsyncIterable { - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.listOperationsAsync(request, options); - } - /** - * Starts asynchronous cancellation on a long-running operation. The server - * makes a best effort to cancel the operation, but success is not - * guaranteed. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. Clients can use - * {@link Operations.GetOperation} or - * other methods to check whether the cancellation succeeded or whether the - * operation completed despite cancellation. On successful cancellation, - * the operation is not deleted; instead, it becomes an operation with - * an {@link Operation.error} value with a {@link google.rpc.Status.code} of - * 1, corresponding to `Code.CANCELLED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be cancelled. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} for the - * details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.cancelOperation({name: ''}); - * ``` - */ - cancelOperation( - request: protos.google.longrunning.CancelOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - >, - callback?: Callback< - protos.google.longrunning.CancelOperationRequest, - protos.google.protobuf.Empty, - {} | undefined | null - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.cancelOperation(request, options, callback); - } - - /** - * Deletes a long-running operation. This method indicates that the client is - * no longer interested in the operation result. It does not cancel the - * operation. If the server doesn't support this method, it returns - * `google.rpc.Code.UNIMPLEMENTED`. - * - * @param {Object} request - The request object that will be sent. - * @param {string} request.name - The name of the operation resource to be deleted. - * @param {Object=} options - * Optional parameters. You can override the default settings for this call, - * e.g, timeout, retries, paginations, etc. See {@link - * https://googleapis.github.io/gax-nodejs/global.html#CallOptions | gax.CallOptions} - * for the details. - * @param {function(?Error)=} callback - * The function which will be called with the result of the API call. - * @return {Promise} - The promise which resolves when API call finishes. - * The promise has a method named "cancel" which cancels the ongoing API - * call. - * - * @example - * ``` - * const client = longrunning.operationsClient(); - * await client.deleteOperation({name: ''}); - * ``` - */ - deleteOperation( - request: protos.google.longrunning.DeleteOperationRequest, - optionsOrCallback?: - | gax.CallOptions - | Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - >, - callback?: Callback< - protos.google.protobuf.Empty, - protos.google.longrunning.DeleteOperationRequest, - {} | null | undefined - > - ): Promise { - let options: gax.CallOptions; - if (typeof optionsOrCallback === 'function' && callback === undefined) { - callback = optionsOrCallback; - options = {}; - } else { - options = optionsOrCallback as gax.CallOptions; - } - options = options || {}; - options.otherArgs = options.otherArgs || {}; - options.otherArgs.headers = options.otherArgs.headers || {}; - options.otherArgs.headers['x-goog-request-params'] = - this._gaxModule.routingHeader.fromParams({ - name: request.name ?? '', - }); - return this.operationsClient.deleteOperation(request, options, callback); - } - - // -------------------- - // -- Path templates -- - // -------------------- - - /** - * Return a fully-qualified backup resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backupvault - * @param {string} datasource - * @param {string} backup - * @returns {string} Resource name string. - */ - backupPath(project:string,location:string,backupvault:string,datasource:string,backup:string) { - return this.pathTemplates.backupPathTemplate.render({ - project: project, - location: location, - backupvault: backupvault, - datasource: datasource, - backup: backup, - }); - } - - /** - * Parse the project from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).project; - } - - /** - * Parse the location from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).location; - } - - /** - * Parse the backupvault from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backupvault. - */ - matchBackupvaultFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backupvault; - } - - /** - * Parse the datasource from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the datasource. - */ - matchDatasourceFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).datasource; - } - - /** - * Parse the backup from Backup resource. - * - * @param {string} backupName - * A fully-qualified path representing Backup resource. - * @returns {string} A string representing the backup. - */ - matchBackupFromBackupName(backupName: string) { - return this.pathTemplates.backupPathTemplate.match(backupName).backup; - } - - /** - * Return a fully-qualified backupPlan resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup_plan - * @returns {string} Resource name string. - */ - backupPlanPath(project:string,location:string,backupPlan:string) { - return this.pathTemplates.backupPlanPathTemplate.render({ - project: project, - location: location, - backup_plan: backupPlan, - }); - } - - /** - * Parse the project from BackupPlan resource. - * - * @param {string} backupPlanName - * A fully-qualified path representing BackupPlan resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupPlanName(backupPlanName: string) { - return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).project; - } - - /** - * Parse the location from BackupPlan resource. - * - * @param {string} backupPlanName - * A fully-qualified path representing BackupPlan resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupPlanName(backupPlanName: string) { - return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).location; - } - - /** - * Parse the backup_plan from BackupPlan resource. - * - * @param {string} backupPlanName - * A fully-qualified path representing BackupPlan resource. - * @returns {string} A string representing the backup_plan. - */ - matchBackupPlanFromBackupPlanName(backupPlanName: string) { - return this.pathTemplates.backupPlanPathTemplate.match(backupPlanName).backup_plan; - } - - /** - * Return a fully-qualified backupPlanAssociation resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup_plan_association - * @returns {string} Resource name string. - */ - backupPlanAssociationPath(project:string,location:string,backupPlanAssociation:string) { - return this.pathTemplates.backupPlanAssociationPathTemplate.render({ - project: project, - location: location, - backup_plan_association: backupPlanAssociation, - }); - } - - /** - * Parse the project from BackupPlanAssociation resource. - * - * @param {string} backupPlanAssociationName - * A fully-qualified path representing BackupPlanAssociation resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupPlanAssociationName(backupPlanAssociationName: string) { - return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).project; - } - - /** - * Parse the location from BackupPlanAssociation resource. - * - * @param {string} backupPlanAssociationName - * A fully-qualified path representing BackupPlanAssociation resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupPlanAssociationName(backupPlanAssociationName: string) { - return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).location; - } - - /** - * Parse the backup_plan_association from BackupPlanAssociation resource. - * - * @param {string} backupPlanAssociationName - * A fully-qualified path representing BackupPlanAssociation resource. - * @returns {string} A string representing the backup_plan_association. - */ - matchBackupPlanAssociationFromBackupPlanAssociationName(backupPlanAssociationName: string) { - return this.pathTemplates.backupPlanAssociationPathTemplate.match(backupPlanAssociationName).backup_plan_association; - } - - /** - * Return a fully-qualified backupPlanRevision resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backup_plan - * @param {string} revision - * @returns {string} Resource name string. - */ - backupPlanRevisionPath(project:string,location:string,backupPlan:string,revision:string) { - return this.pathTemplates.backupPlanRevisionPathTemplate.render({ - project: project, - location: location, - backup_plan: backupPlan, - revision: revision, - }); - } - - /** - * Parse the project from BackupPlanRevision resource. - * - * @param {string} backupPlanRevisionName - * A fully-qualified path representing BackupPlanRevision resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupPlanRevisionName(backupPlanRevisionName: string) { - return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).project; - } - - /** - * Parse the location from BackupPlanRevision resource. - * - * @param {string} backupPlanRevisionName - * A fully-qualified path representing BackupPlanRevision resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupPlanRevisionName(backupPlanRevisionName: string) { - return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).location; - } - - /** - * Parse the backup_plan from BackupPlanRevision resource. - * - * @param {string} backupPlanRevisionName - * A fully-qualified path representing BackupPlanRevision resource. - * @returns {string} A string representing the backup_plan. - */ - matchBackupPlanFromBackupPlanRevisionName(backupPlanRevisionName: string) { - return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).backup_plan; - } - - /** - * Parse the revision from BackupPlanRevision resource. - * - * @param {string} backupPlanRevisionName - * A fully-qualified path representing BackupPlanRevision resource. - * @returns {string} A string representing the revision. - */ - matchRevisionFromBackupPlanRevisionName(backupPlanRevisionName: string) { - return this.pathTemplates.backupPlanRevisionPathTemplate.match(backupPlanRevisionName).revision; - } - - /** - * Return a fully-qualified backupVault resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backupvault - * @returns {string} Resource name string. - */ - backupVaultPath(project:string,location:string,backupvault:string) { - return this.pathTemplates.backupVaultPathTemplate.render({ - project: project, - location: location, - backupvault: backupvault, - }); - } - - /** - * Parse the project from BackupVault resource. - * - * @param {string} backupVaultName - * A fully-qualified path representing BackupVault resource. - * @returns {string} A string representing the project. - */ - matchProjectFromBackupVaultName(backupVaultName: string) { - return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).project; - } - - /** - * Parse the location from BackupVault resource. - * - * @param {string} backupVaultName - * A fully-qualified path representing BackupVault resource. - * @returns {string} A string representing the location. - */ - matchLocationFromBackupVaultName(backupVaultName: string) { - return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).location; - } - - /** - * Parse the backupvault from BackupVault resource. - * - * @param {string} backupVaultName - * A fully-qualified path representing BackupVault resource. - * @returns {string} A string representing the backupvault. - */ - matchBackupvaultFromBackupVaultName(backupVaultName: string) { - return this.pathTemplates.backupVaultPathTemplate.match(backupVaultName).backupvault; - } - - /** - * Return a fully-qualified dataSource resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} backupvault - * @param {string} datasource - * @returns {string} Resource name string. - */ - dataSourcePath(project:string,location:string,backupvault:string,datasource:string) { - return this.pathTemplates.dataSourcePathTemplate.render({ - project: project, - location: location, - backupvault: backupvault, - datasource: datasource, - }); - } - - /** - * Parse the project from DataSource resource. - * - * @param {string} dataSourceName - * A fully-qualified path representing DataSource resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataSourceName(dataSourceName: string) { - return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).project; - } - - /** - * Parse the location from DataSource resource. - * - * @param {string} dataSourceName - * A fully-qualified path representing DataSource resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataSourceName(dataSourceName: string) { - return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).location; - } - - /** - * Parse the backupvault from DataSource resource. - * - * @param {string} dataSourceName - * A fully-qualified path representing DataSource resource. - * @returns {string} A string representing the backupvault. - */ - matchBackupvaultFromDataSourceName(dataSourceName: string) { - return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).backupvault; - } - - /** - * Parse the datasource from DataSource resource. - * - * @param {string} dataSourceName - * A fully-qualified path representing DataSource resource. - * @returns {string} A string representing the datasource. - */ - matchDatasourceFromDataSourceName(dataSourceName: string) { - return this.pathTemplates.dataSourcePathTemplate.match(dataSourceName).datasource; - } - - /** - * Return a fully-qualified dataSourceReference resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} data_source_reference - * @returns {string} Resource name string. - */ - dataSourceReferencePath(project:string,location:string,dataSourceReference:string) { - return this.pathTemplates.dataSourceReferencePathTemplate.render({ - project: project, - location: location, - data_source_reference: dataSourceReference, - }); - } - - /** - * Parse the project from DataSourceReference resource. - * - * @param {string} dataSourceReferenceName - * A fully-qualified path representing DataSourceReference resource. - * @returns {string} A string representing the project. - */ - matchProjectFromDataSourceReferenceName(dataSourceReferenceName: string) { - return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).project; - } - - /** - * Parse the location from DataSourceReference resource. - * - * @param {string} dataSourceReferenceName - * A fully-qualified path representing DataSourceReference resource. - * @returns {string} A string representing the location. - */ - matchLocationFromDataSourceReferenceName(dataSourceReferenceName: string) { - return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).location; - } - - /** - * Parse the data_source_reference from DataSourceReference resource. - * - * @param {string} dataSourceReferenceName - * A fully-qualified path representing DataSourceReference resource. - * @returns {string} A string representing the data_source_reference. - */ - matchDataSourceReferenceFromDataSourceReferenceName(dataSourceReferenceName: string) { - return this.pathTemplates.dataSourceReferencePathTemplate.match(dataSourceReferenceName).data_source_reference; - } - - /** - * 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 managementServer resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} managementserver - * @returns {string} Resource name string. - */ - managementServerPath(project:string,location:string,managementserver:string) { - return this.pathTemplates.managementServerPathTemplate.render({ - project: project, - location: location, - managementserver: managementserver, - }); - } - - /** - * Parse the project from ManagementServer resource. - * - * @param {string} managementServerName - * A fully-qualified path representing ManagementServer resource. - * @returns {string} A string representing the project. - */ - matchProjectFromManagementServerName(managementServerName: string) { - return this.pathTemplates.managementServerPathTemplate.match(managementServerName).project; - } - - /** - * Parse the location from ManagementServer resource. - * - * @param {string} managementServerName - * A fully-qualified path representing ManagementServer resource. - * @returns {string} A string representing the location. - */ - matchLocationFromManagementServerName(managementServerName: string) { - return this.pathTemplates.managementServerPathTemplate.match(managementServerName).location; - } - - /** - * Parse the managementserver from ManagementServer resource. - * - * @param {string} managementServerName - * A fully-qualified path representing ManagementServer resource. - * @returns {string} A string representing the managementserver. - */ - matchManagementserverFromManagementServerName(managementServerName: string) { - return this.pathTemplates.managementServerPathTemplate.match(managementServerName).managementserver; - } - - /** - * 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 resourceBackupConfig resource name string. - * - * @param {string} project - * @param {string} location - * @param {string} resource_backup_config - * @returns {string} Resource name string. - */ - resourceBackupConfigPath(project:string,location:string,resourceBackupConfig:string) { - return this.pathTemplates.resourceBackupConfigPathTemplate.render({ - project: project, - location: location, - resource_backup_config: resourceBackupConfig, - }); - } - - /** - * Parse the project from ResourceBackupConfig resource. - * - * @param {string} resourceBackupConfigName - * A fully-qualified path representing ResourceBackupConfig resource. - * @returns {string} A string representing the project. - */ - matchProjectFromResourceBackupConfigName(resourceBackupConfigName: string) { - return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).project; - } - - /** - * Parse the location from ResourceBackupConfig resource. - * - * @param {string} resourceBackupConfigName - * A fully-qualified path representing ResourceBackupConfig resource. - * @returns {string} A string representing the location. - */ - matchLocationFromResourceBackupConfigName(resourceBackupConfigName: string) { - return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).location; - } - - /** - * Parse the resource_backup_config from ResourceBackupConfig resource. - * - * @param {string} resourceBackupConfigName - * A fully-qualified path representing ResourceBackupConfig resource. - * @returns {string} A string representing the resource_backup_config. - */ - matchResourceBackupConfigFromResourceBackupConfigName(resourceBackupConfigName: string) { - return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).resource_backup_config; - } - - /** - * 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.backupDRStub && !this._terminated) { - return this.backupDRStub.then(stub => { - this._log.info('ending gRPC channel'); - this._terminated = true; - stub.close(); - this.iamClient.close().catch(err => {throw err}); - this.locationsClient.close().catch(err => {throw err}); - void this.operationsClient.close(); - }); - } - return Promise.resolve(); - } -} \ No newline at end of file diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json deleted file mode 100644 index 4621626acd4..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_client_config.json +++ /dev/null @@ -1,204 +0,0 @@ -{ - "interfaces": { - "google.cloud.backupdr.v1.BackupDR": { - "retry_codes": { - "non_idempotent": [], - "idempotent": [ - "DEADLINE_EXCEEDED", - "UNAVAILABLE" - ], - "unavailable": [ - "UNAVAILABLE" - ] - }, - "retry_params": { - "default": { - "initial_retry_delay_millis": 100, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 60000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - }, - "ce5b960a6ed052e690863808e4f0deff3dc7d49f": { - "initial_retry_delay_millis": 1000, - "retry_delay_multiplier": 1.3, - "max_retry_delay_millis": 10000, - "initial_rpc_timeout_millis": 60000, - "rpc_timeout_multiplier": 1, - "max_rpc_timeout_millis": 60000, - "total_timeout_millis": 600000 - } - }, - "methods": { - "ListManagementServers": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetManagementServer": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "CreateManagementServer": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteManagementServer": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListBackupVaults": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "FetchUsableBackupVaults": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackupVault": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "ListDataSources": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "GetDataSource": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateDataSource": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackups": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "FetchBackupsForResourceType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBackup": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - }, - "UpdateBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackup": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "RestoreBackup": { - "timeout_millis": 60000, - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBackupPlan": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateBackupPlan": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBackupPlan": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackupPlans": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackupPlan": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBackupPlanRevision": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackupPlanRevisions": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "CreateBackupPlanAssociation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "UpdateBackupPlanAssociation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetBackupPlanAssociation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListBackupPlanAssociations": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchBackupPlanAssociationsForResourceType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "DeleteBackupPlanAssociation": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "TriggerBackup": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "GetDataSourceReference": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "ListDataSourceReferences": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "FetchDataSourceReferencesForResourceType": { - "retry_codes_name": "non_idempotent", - "retry_params_name": "default" - }, - "InitializeService": { - "timeout_millis": 60000, - "retry_codes_name": "unavailable", - "retry_params_name": "ce5b960a6ed052e690863808e4f0deff3dc7d49f" - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json b/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json deleted file mode 100644 index 0a7f3ffd5b0..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json +++ /dev/null @@ -1,12 +0,0 @@ -[ - "../../protos/google/cloud/backupdr/v1/backupdr.proto", - "../../protos/google/cloud/backupdr/v1/backupplan.proto", - "../../protos/google/cloud/backupdr/v1/backupplanassociation.proto", - "../../protos/google/cloud/backupdr/v1/backupvault.proto", - "../../protos/google/cloud/backupdr/v1/backupvault_ba.proto", - "../../protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto", - "../../protos/google/cloud/backupdr/v1/backupvault_disk.proto", - "../../protos/google/cloud/backupdr/v1/backupvault_gce.proto", - "../../protos/google/cloud/backupdr/v1/datasourcereference.proto", - "../../protos/google/cloud/backupdr/v1/protection_summary.proto" -] diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json b/owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json deleted file mode 100644 index 4d7fc4ea0bb..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/src/v1/gapic_metadata.json +++ /dev/null @@ -1,469 +0,0 @@ -{ - "schema": "1.0", - "comment": "This file maps proto services/RPCs to the corresponding library clients/methods", - "language": "typescript", - "protoPackage": "google.cloud.backupdr.v1", - "libraryPackage": "@google-cloud/backupdr", - "services": { - "BackupDR": { - "clients": { - "grpc": { - "libraryClient": "BackupDRClient", - "rpcs": { - "GetManagementServer": { - "methods": [ - "getManagementServer" - ] - }, - "GetBackupVault": { - "methods": [ - "getBackupVault" - ] - }, - "GetDataSource": { - "methods": [ - "getDataSource" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetBackupPlan": { - "methods": [ - "getBackupPlan" - ] - }, - "GetBackupPlanRevision": { - "methods": [ - "getBackupPlanRevision" - ] - }, - "GetBackupPlanAssociation": { - "methods": [ - "getBackupPlanAssociation" - ] - }, - "GetDataSourceReference": { - "methods": [ - "getDataSourceReference" - ] - }, - "CreateManagementServer": { - "methods": [ - "createManagementServer" - ] - }, - "DeleteManagementServer": { - "methods": [ - "deleteManagementServer" - ] - }, - "CreateBackupVault": { - "methods": [ - "createBackupVault" - ] - }, - "UpdateBackupVault": { - "methods": [ - "updateBackupVault" - ] - }, - "DeleteBackupVault": { - "methods": [ - "deleteBackupVault" - ] - }, - "UpdateDataSource": { - "methods": [ - "updateDataSource" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "RestoreBackup": { - "methods": [ - "restoreBackup" - ] - }, - "CreateBackupPlan": { - "methods": [ - "createBackupPlan" - ] - }, - "UpdateBackupPlan": { - "methods": [ - "updateBackupPlan" - ] - }, - "DeleteBackupPlan": { - "methods": [ - "deleteBackupPlan" - ] - }, - "CreateBackupPlanAssociation": { - "methods": [ - "createBackupPlanAssociation" - ] - }, - "UpdateBackupPlanAssociation": { - "methods": [ - "updateBackupPlanAssociation" - ] - }, - "DeleteBackupPlanAssociation": { - "methods": [ - "deleteBackupPlanAssociation" - ] - }, - "TriggerBackup": { - "methods": [ - "triggerBackup" - ] - }, - "InitializeService": { - "methods": [ - "initializeService" - ] - }, - "ListManagementServers": { - "methods": [ - "listManagementServers", - "listManagementServersStream", - "listManagementServersAsync" - ] - }, - "ListBackupVaults": { - "methods": [ - "listBackupVaults", - "listBackupVaultsStream", - "listBackupVaultsAsync" - ] - }, - "FetchUsableBackupVaults": { - "methods": [ - "fetchUsableBackupVaults", - "fetchUsableBackupVaultsStream", - "fetchUsableBackupVaultsAsync" - ] - }, - "ListDataSources": { - "methods": [ - "listDataSources", - "listDataSourcesStream", - "listDataSourcesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "FetchBackupsForResourceType": { - "methods": [ - "fetchBackupsForResourceType", - "fetchBackupsForResourceTypeStream", - "fetchBackupsForResourceTypeAsync" - ] - }, - "ListBackupPlans": { - "methods": [ - "listBackupPlans", - "listBackupPlansStream", - "listBackupPlansAsync" - ] - }, - "ListBackupPlanRevisions": { - "methods": [ - "listBackupPlanRevisions", - "listBackupPlanRevisionsStream", - "listBackupPlanRevisionsAsync" - ] - }, - "ListBackupPlanAssociations": { - "methods": [ - "listBackupPlanAssociations", - "listBackupPlanAssociationsStream", - "listBackupPlanAssociationsAsync" - ] - }, - "FetchBackupPlanAssociationsForResourceType": { - "methods": [ - "fetchBackupPlanAssociationsForResourceType", - "fetchBackupPlanAssociationsForResourceTypeStream", - "fetchBackupPlanAssociationsForResourceTypeAsync" - ] - }, - "ListDataSourceReferences": { - "methods": [ - "listDataSourceReferences", - "listDataSourceReferencesStream", - "listDataSourceReferencesAsync" - ] - }, - "FetchDataSourceReferencesForResourceType": { - "methods": [ - "fetchDataSourceReferencesForResourceType", - "fetchDataSourceReferencesForResourceTypeStream", - "fetchDataSourceReferencesForResourceTypeAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BackupDRClient", - "rpcs": { - "GetManagementServer": { - "methods": [ - "getManagementServer" - ] - }, - "GetBackupVault": { - "methods": [ - "getBackupVault" - ] - }, - "GetDataSource": { - "methods": [ - "getDataSource" - ] - }, - "GetBackup": { - "methods": [ - "getBackup" - ] - }, - "GetBackupPlan": { - "methods": [ - "getBackupPlan" - ] - }, - "GetBackupPlanRevision": { - "methods": [ - "getBackupPlanRevision" - ] - }, - "GetBackupPlanAssociation": { - "methods": [ - "getBackupPlanAssociation" - ] - }, - "GetDataSourceReference": { - "methods": [ - "getDataSourceReference" - ] - }, - "CreateManagementServer": { - "methods": [ - "createManagementServer" - ] - }, - "DeleteManagementServer": { - "methods": [ - "deleteManagementServer" - ] - }, - "CreateBackupVault": { - "methods": [ - "createBackupVault" - ] - }, - "UpdateBackupVault": { - "methods": [ - "updateBackupVault" - ] - }, - "DeleteBackupVault": { - "methods": [ - "deleteBackupVault" - ] - }, - "UpdateDataSource": { - "methods": [ - "updateDataSource" - ] - }, - "UpdateBackup": { - "methods": [ - "updateBackup" - ] - }, - "DeleteBackup": { - "methods": [ - "deleteBackup" - ] - }, - "RestoreBackup": { - "methods": [ - "restoreBackup" - ] - }, - "CreateBackupPlan": { - "methods": [ - "createBackupPlan" - ] - }, - "UpdateBackupPlan": { - "methods": [ - "updateBackupPlan" - ] - }, - "DeleteBackupPlan": { - "methods": [ - "deleteBackupPlan" - ] - }, - "CreateBackupPlanAssociation": { - "methods": [ - "createBackupPlanAssociation" - ] - }, - "UpdateBackupPlanAssociation": { - "methods": [ - "updateBackupPlanAssociation" - ] - }, - "DeleteBackupPlanAssociation": { - "methods": [ - "deleteBackupPlanAssociation" - ] - }, - "TriggerBackup": { - "methods": [ - "triggerBackup" - ] - }, - "InitializeService": { - "methods": [ - "initializeService" - ] - }, - "ListManagementServers": { - "methods": [ - "listManagementServers", - "listManagementServersStream", - "listManagementServersAsync" - ] - }, - "ListBackupVaults": { - "methods": [ - "listBackupVaults", - "listBackupVaultsStream", - "listBackupVaultsAsync" - ] - }, - "FetchUsableBackupVaults": { - "methods": [ - "fetchUsableBackupVaults", - "fetchUsableBackupVaultsStream", - "fetchUsableBackupVaultsAsync" - ] - }, - "ListDataSources": { - "methods": [ - "listDataSources", - "listDataSourcesStream", - "listDataSourcesAsync" - ] - }, - "ListBackups": { - "methods": [ - "listBackups", - "listBackupsStream", - "listBackupsAsync" - ] - }, - "FetchBackupsForResourceType": { - "methods": [ - "fetchBackupsForResourceType", - "fetchBackupsForResourceTypeStream", - "fetchBackupsForResourceTypeAsync" - ] - }, - "ListBackupPlans": { - "methods": [ - "listBackupPlans", - "listBackupPlansStream", - "listBackupPlansAsync" - ] - }, - "ListBackupPlanRevisions": { - "methods": [ - "listBackupPlanRevisions", - "listBackupPlanRevisionsStream", - "listBackupPlanRevisionsAsync" - ] - }, - "ListBackupPlanAssociations": { - "methods": [ - "listBackupPlanAssociations", - "listBackupPlanAssociationsStream", - "listBackupPlanAssociationsAsync" - ] - }, - "FetchBackupPlanAssociationsForResourceType": { - "methods": [ - "fetchBackupPlanAssociationsForResourceType", - "fetchBackupPlanAssociationsForResourceTypeStream", - "fetchBackupPlanAssociationsForResourceTypeAsync" - ] - }, - "ListDataSourceReferences": { - "methods": [ - "listDataSourceReferences", - "listDataSourceReferencesStream", - "listDataSourceReferencesAsync" - ] - }, - "FetchDataSourceReferencesForResourceType": { - "methods": [ - "fetchDataSourceReferencesForResourceType", - "fetchDataSourceReferencesForResourceTypeStream", - "fetchDataSourceReferencesForResourceTypeAsync" - ] - } - } - } - } - }, - "BackupDrProtectionSummary": { - "clients": { - "grpc": { - "libraryClient": "BackupDrProtectionSummaryClient", - "rpcs": { - "ListResourceBackupConfigs": { - "methods": [ - "listResourceBackupConfigs", - "listResourceBackupConfigsStream", - "listResourceBackupConfigsAsync" - ] - } - } - }, - "grpc-fallback": { - "libraryClient": "BackupDrProtectionSummaryClient", - "rpcs": { - "ListResourceBackupConfigs": { - "methods": [ - "listResourceBackupConfigs", - "listResourceBackupConfigsStream", - "listResourceBackupConfigsAsync" - ] - } - } - } - } - } - } -} diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/index.ts b/owl-bot-staging/google-cloud-backupdr/src/v1/index.ts deleted file mode 100644 index 576f9dae209..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/src/v1/index.ts +++ /dev/null @@ -1,20 +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 {BackupDRClient} from './backup_d_r_client'; -export {BackupDrProtectionSummaryClient} from './backup_dr_protection_summary_client'; diff --git a/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js b/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js deleted file mode 100644 index 6557b418888..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.js +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** 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 backupdr = require('@google-cloud/backupdr'); - -function main() { - const backupDRClient = new backupdr.BackupDRClient(); - const backupDrProtectionSummaryClient = new backupdr.BackupDrProtectionSummaryClient(); -} - -main(); diff --git a/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts b/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts deleted file mode 100644 index b0ba9f95bdf..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts +++ /dev/null @@ -1,38 +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 {BackupDRClient, BackupDrProtectionSummaryClient} from '@google-cloud/backupdr'; - -// check that the client class type name can be used -function doStuffWithBackupDRClient(client: BackupDRClient) { - client.close(); -} -function doStuffWithBackupDrProtectionSummaryClient(client: BackupDrProtectionSummaryClient) { - client.close(); -} - -function main() { - // check that the client instance can be created - const backupDRClient = new BackupDRClient(); - doStuffWithBackupDRClient(backupDRClient); - // check that the client instance can be created - const backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient(); - doStuffWithBackupDrProtectionSummaryClient(backupDrProtectionSummaryClient); -} - -main(); diff --git a/owl-bot-staging/google-cloud-backupdr/system-test/install.ts b/owl-bot-staging/google-cloud-backupdr/system-test/install.ts deleted file mode 100644 index 394f3362d20..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/system-test/install.ts +++ /dev/null @@ -1,49 +0,0 @@ -// Copyright 2026 Google LLC -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// https://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. -// -// ** This file is automatically generated by gapic-generator-typescript. ** -// ** https://github.com/googleapis/gapic-generator-typescript ** -// ** All changes to this file may be overwritten. ** - -import {packNTest} from 'pack-n-play'; -import {readFileSync} from 'fs'; -import {describe, it} from 'mocha'; - -describe('📦 pack-n-play test', () => { - - it('TypeScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'TypeScript user can use the type definitions', - ts: readFileSync('./system-test/fixtures/sample/src/index.ts').toString() - } - }; - await packNTest(options); - }); - - it('JavaScript code', async function() { - this.timeout(300000); - const options = { - packageDir: process.cwd(), - sample: { - description: 'JavaScript user can use the library', - ts: readFileSync('./system-test/fixtures/sample/src/index.js').toString() - } - }; - await packNTest(options); - }); - -}); diff --git a/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts b/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts deleted file mode 100644 index 843d6ef43f6..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts +++ /dev/null @@ -1,7933 +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 backupdrModule from '../src'; - -import {PassThrough} from 'stream'; - -import {protobuf, LROperation, operationsProtos, IamProtos, LocationProtos} from 'google-gax'; - -// Dynamically loaded proto JSON is needed to get the type information -// to fill in default values for request objects -const root = protobuf.Root.fromJSON(require('../protos/protos.json')).resolveAll(); - -// eslint-disable-next-line @typescript-eslint/no-unused-vars -function getTypeDefaultValue(typeName: string, fields: string[]) { - let type = root.lookupType(typeName) as protobuf.Type; - for (const field of fields.slice(0, -1)) { - type = type.fields[field]?.resolvedType as protobuf.Type; - } - return type.fields[fields[fields.length - 1]]?.defaultValue; -} - -function generateSampleMessage(instance: T) { - const filledObject = (instance.constructor as typeof protobuf.Message) - .toObject(instance as protobuf.Message, {defaults: true}); - return (instance.constructor as typeof protobuf.Message).fromObject(filledObject) as T; -} - -function stubSimpleCall(response?: ResponseType, error?: Error) { - return error ? sinon.stub().rejects(error) : sinon.stub().resolves([response]); -} - -function stubSimpleCallWithCallback(response?: ResponseType, error?: Error) { - return error ? sinon.stub().callsArgWith(2, error) : sinon.stub().callsArgWith(2, null, response); -} - -function stubLongRunningCall(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().rejects(callError) : sinon.stub().resolves([mockOperation]); -} - -function stubLongRunningCallWithCallback(response?: ResponseType, callError?: Error, lroError?: Error) { - const innerStub = lroError ? sinon.stub().rejects(lroError) : sinon.stub().resolves([response]); - const mockOperation = { - promise: innerStub, - }; - return callError ? sinon.stub().callsArgWith(2, callError) : sinon.stub().callsArgWith(2, null, mockOperation); -} - -function stubPageStreamingCall(responses?: ResponseType[], error?: Error) { - const pagingStub = sinon.stub(); - if (responses) { - for (let i = 0; i < responses.length; ++i) { - pagingStub.onCall(i).callsArgWith(2, null, responses[i]); - } - } - const transformStub = error ? sinon.stub().callsArgWith(2, error) : pagingStub; - const mockStream = new PassThrough({ - objectMode: true, - transform: transformStub, - }); - // trigger as many responses as needed - if (responses) { - for (let i = 0; i < responses.length; ++i) { - setImmediate(() => { mockStream.write({}); }); - } - setImmediate(() => { mockStream.end(); }); - } else { - setImmediate(() => { mockStream.write({}); }); - setImmediate(() => { mockStream.end(); }); - } - return sinon.stub().returns(mockStream); -} - -function stubAsyncIterationCall(responses?: ResponseType[], error?: Error) { - let counter = 0; - const asyncIterable = { - [Symbol.asyncIterator]() { - return { - async next() { - if (error) { - return Promise.reject(error); - } - if (counter >= responses!.length) { - return Promise.resolve({done: true, value: undefined}); - } - return Promise.resolve({done: false, value: responses![counter++]}); - } - }; - } - }; - return sinon.stub().returns(asyncIterable); -} - -describe('v1.BackupDRClient', () => { - describe('Common methods', () => { - it('has apiEndpoint', () => { - const client = new backupdrModule.v1.BackupDRClient(); - const apiEndpoint = client.apiEndpoint; - assert.strictEqual(apiEndpoint, 'backupdr.googleapis.com'); - }); - - it('has universeDomain', () => { - const client = new backupdrModule.v1.BackupDRClient(); - 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 = backupdrModule.v1.BackupDRClient.servicePath; - assert.strictEqual(servicePath, 'backupdr.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - - it('throws DeprecationWarning if static apiEndpoint is used', () => { - const stub = sinon.stub(process, 'emitWarning'); - const apiEndpoint = backupdrModule.v1.BackupDRClient.apiEndpoint; - assert.strictEqual(apiEndpoint, 'backupdr.googleapis.com'); - assert(stub.called); - stub.restore(); - }); - } - it('sets apiEndpoint according to universe domain camelCase', () => { - const client = new backupdrModule.v1.BackupDRClient({universeDomain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'backupdr.example.com'); - }); - - it('sets apiEndpoint according to universe domain snakeCase', () => { - const client = new backupdrModule.v1.BackupDRClient({universe_domain: 'example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'backupdr.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 backupdrModule.v1.BackupDRClient(); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'backupdr.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 backupdrModule.v1.BackupDRClient({universeDomain: 'configured.example.com'}); - const servicePath = client.apiEndpoint; - assert.strictEqual(servicePath, 'backupdr.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 backupdrModule.v1.BackupDRClient({universe_domain: 'example.com', universeDomain: 'example.net'}); }); - }); - - it('has port', () => { - const port = backupdrModule.v1.BackupDRClient.port; - assert(port); - assert(typeof port === 'number'); - }); - - it('should create a client with no option', () => { - const client = new backupdrModule.v1.BackupDRClient(); - assert(client); - }); - - it('should create a client with gRPC fallback', () => { - const client = new backupdrModule.v1.BackupDRClient({ - fallback: true, - }); - assert(client); - }); - - it('has initialize method and supports deferred initialization', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.backupDRStub, undefined); - await client.initialize(); - assert(client.backupDRStub); - }); - - it('has close method for the initialized client', done => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - client.initialize().catch(err => {throw err}); - assert(client.backupDRStub); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has close method for the non-initialized client', done => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - assert.strictEqual(client.backupDRStub, undefined); - client.close().then(() => { - done(); - }).catch(err => {throw err}); - }); - - it('has getProjectId method', async () => { - const fakeProjectId = 'fake-project-id'; - const client = new backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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('getManagementServer', () => { - it('invokes getManagementServer without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() - ); - client.innerApiCalls.getManagementServer = stubSimpleCall(expectedResponse); - const [response] = await client.getManagementServer(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getManagementServer without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ManagementServer() - ); - client.innerApiCalls.getManagementServer = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getManagementServer( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IManagementServer|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getManagementServer with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getManagementServer = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getManagementServer(request), expectedError); - const actualRequest = (client.innerApiCalls.getManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getManagementServer with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getManagementServer(request), expectedError); - }); - }); - - describe('getBackupVault', () => { - it('invokes getBackupVault without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupVault() - ); - client.innerApiCalls.getBackupVault = stubSimpleCall(expectedResponse); - const [response] = await client.getBackupVault(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupVault without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupVault() - ); - client.innerApiCalls.getBackupVault = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackupVault( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupVault|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupVault with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackupVault = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackupVault(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupVault with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackupVault(request), expectedError); - }); - }); - - describe('getDataSource', () => { - it('invokes getDataSource without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DataSource() - ); - client.innerApiCalls.getDataSource = stubSimpleCall(expectedResponse); - const [response] = await client.getDataSource(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSource without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DataSource() - ); - client.innerApiCalls.getDataSource = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataSource( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSource|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSource with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataSource = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataSource(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSource with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDataSource(request), expectedError); - }); - }); - - describe('getBackup', () => { - it('invokes getBackup without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCall(expectedResponse); - const [response] = await client.getBackup(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.Backup() - ); - client.innerApiCalls.getBackup = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackup( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackup|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackup = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackup with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackup(request), expectedError); - }); - }); - - describe('getBackupPlan', () => { - it('invokes getBackupPlan without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupPlan() - ); - client.innerApiCalls.getBackupPlan = stubSimpleCall(expectedResponse); - const [response] = await client.getBackupPlan(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlan without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupPlan() - ); - client.innerApiCalls.getBackupPlan = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackupPlan( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlan|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlan with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackupPlan = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackupPlan(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlan with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackupPlan(request), expectedError); - }); - }); - - describe('getBackupPlanRevision', () => { - it('invokes getBackupPlanRevision without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupPlanRevision() - ); - client.innerApiCalls.getBackupPlanRevision = stubSimpleCall(expectedResponse); - const [response] = await client.getBackupPlanRevision(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupPlanRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlanRevision without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupPlanRevision() - ); - client.innerApiCalls.getBackupPlanRevision = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackupPlanRevision( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanRevision|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupPlanRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlanRevision with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackupPlanRevision = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackupPlanRevision(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackupPlanRevision as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanRevision as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlanRevision with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanRevisionRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackupPlanRevision(request), expectedError); - }); - }); - - describe('getBackupPlanAssociation', () => { - it('invokes getBackupPlanAssociation without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupPlanAssociation() - ); - client.innerApiCalls.getBackupPlanAssociation = stubSimpleCall(expectedResponse); - const [response] = await client.getBackupPlanAssociation(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlanAssociation without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.BackupPlanAssociation() - ); - client.innerApiCalls.getBackupPlanAssociation = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getBackupPlanAssociation( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlanAssociation with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getBackupPlanAssociation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getBackupPlanAssociation(request), expectedError); - const actualRequest = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getBackupPlanAssociation with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getBackupPlanAssociation(request), expectedError); - }); - }); - - describe('getDataSourceReference', () => { - it('invokes getDataSourceReference without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DataSourceReference() - ); - client.innerApiCalls.getDataSourceReference = stubSimpleCall(expectedResponse); - const [response] = await client.getDataSourceReference(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataSourceReference as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSourceReference as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSourceReference without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DataSourceReference() - ); - client.innerApiCalls.getDataSourceReference = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getDataSourceReference( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSourceReference|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.getDataSourceReference as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSourceReference as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSourceReference with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.getDataSourceReference = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getDataSourceReference(request), expectedError); - const actualRequest = (client.innerApiCalls.getDataSourceReference as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.getDataSourceReference as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes getDataSourceReference with closed client', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.GetDataSourceReferenceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.GetDataSourceReferenceRequest', ['name']); - request.name = defaultValue1; - const expectedError = new Error('The client has already been closed.'); - client.close().catch(err => {throw err}); - await assert.rejects(client.getDataSourceReference(request), expectedError); - }); - }); - - describe('createManagementServer', () => { - it('invokes createManagementServer without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createManagementServer = stubLongRunningCall(expectedResponse); - const [operation] = await client.createManagementServer(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createManagementServer without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createManagementServer = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createManagementServer( - 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.createManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createManagementServer with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createManagementServer = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createManagementServer(request), expectedError); - const actualRequest = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createManagementServer with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateManagementServerRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createManagementServer = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createManagementServer(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateManagementServerProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateManagementServerProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateManagementServerProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateManagementServerProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteManagementServer', () => { - it('invokes deleteManagementServer without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteManagementServer(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteManagementServer without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteManagementServer = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteManagementServer( - 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.deleteManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteManagementServer with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteManagementServer(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteManagementServer with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteManagementServerRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteManagementServerRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteManagementServer = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteManagementServer(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteManagementServer as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteManagementServerProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteManagementServerProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteManagementServerProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteManagementServerProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackupVault', () => { - it('invokes createBackupVault without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackupVault = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackupVault(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupVault without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackupVault = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackupVault( - 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.createBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupVault with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupVault = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackupVault(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupVault with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupVaultRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupVault = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackupVault(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupVaultProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateBackupVaultProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupVaultProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateBackupVaultProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackupVault', () => { - it('invokes updateBackupVault without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() - ); - request.backupVault ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); - request.backupVault.name = defaultValue1; - const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackupVault = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackupVault(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupVault without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() - ); - request.backupVault ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); - request.backupVault.name = defaultValue1; - const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackupVault = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackupVault( - 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.updateBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupVault with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() - ); - request.backupVault ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); - request.backupVault.name = defaultValue1; - const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupVault = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackupVault(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupVault with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupVaultRequest() - ); - request.backupVault ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupVaultRequest', ['backupVault', 'name']); - request.backupVault.name = defaultValue1; - const expectedHeaderRequestParams = `backup_vault.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupVault = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackupVault(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupVaultProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupVaultProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupVaultProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupVaultProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackupVault', () => { - it('invokes deleteBackupVault without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackupVault = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackupVault(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupVault without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackupVault = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackupVault( - 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.deleteBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupVault with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupVault = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackupVault(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupVault with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupVaultRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupVaultRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupVault = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackupVault(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupVault as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupVaultProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupVaultProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupVaultProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupVaultProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateDataSource', () => { - it('invokes updateDataSource without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() - ); - request.dataSource ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); - request.dataSource.name = defaultValue1; - const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDataSource = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateDataSource(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataSource without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() - ); - request.dataSource ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); - request.dataSource.name = defaultValue1; - const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateDataSource = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateDataSource( - 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.updateDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataSource with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() - ); - request.dataSource ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); - request.dataSource.name = defaultValue1; - const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataSource = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateDataSource(request), expectedError); - const actualRequest = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateDataSource with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateDataSourceRequest() - ); - request.dataSource ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateDataSourceRequest', ['dataSource', 'name']); - request.dataSource.name = defaultValue1; - const expectedHeaderRequestParams = `data_source.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateDataSource = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateDataSource(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateDataSource as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateDataSourceProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateDataSourceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateDataSourceProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateDataSourceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackup', () => { - it('invokes updateBackup without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackup( - 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.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackup with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupRequest() - ); - request.backup ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupRequest', ['backup', 'name']); - request.backup.name = defaultValue1; - const expectedHeaderRequestParams = `backup.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackup', () => { - it('invokes deleteBackup without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackup( - 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.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackup with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('restoreBackup', () => { - it('invokes restoreBackup without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.RestoreBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.restoreBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreBackup without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.RestoreBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.restoreBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.restoreBackup( - 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.restoreBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreBackup with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.RestoreBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.restoreBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes restoreBackup with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.RestoreBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.RestoreBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.restoreBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.restoreBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.restoreBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkRestoreBackupProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkRestoreBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkRestoreBackupProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkRestoreBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackupPlan', () => { - it('invokes createBackupPlan without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackupPlan = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackupPlan(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupPlan without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackupPlan = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackupPlan( - 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.createBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupPlan with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupPlan = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackupPlan(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupPlan with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupPlan = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackupPlan(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupPlanProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateBackupPlanProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupPlanProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateBackupPlanProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackupPlan', () => { - it('invokes updateBackupPlan without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() - ); - request.backupPlan ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); - request.backupPlan.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackupPlan = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackupPlan(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupPlan without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() - ); - request.backupPlan ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); - request.backupPlan.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackupPlan = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackupPlan( - 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.updateBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupPlan with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() - ); - request.backupPlan ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); - request.backupPlan.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupPlan = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackupPlan(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupPlan with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanRequest() - ); - request.backupPlan ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanRequest', ['backupPlan', 'name']); - request.backupPlan.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupPlan = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackupPlan(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupPlanProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupPlanProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupPlanProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupPlanProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackupPlan', () => { - it('invokes deleteBackupPlan without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackupPlan = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackupPlan(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupPlan without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackupPlan = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackupPlan( - 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.deleteBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupPlan with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupPlan = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackupPlan(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupPlan with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupPlan = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackupPlan(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlan as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupPlanProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupPlanProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupPlanProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupPlanProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('createBackupPlanAssociation', () => { - it('invokes createBackupPlanAssociation without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall(expectedResponse); - const [operation] = await client.createBackupPlanAssociation(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupPlanAssociation without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.createBackupPlanAssociation( - 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.createBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupPlanAssociation with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.createBackupPlanAssociation(request), expectedError); - const actualRequest = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes createBackupPlanAssociation with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.CreateBackupPlanAssociationRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.createBackupPlanAssociation = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.createBackupPlanAssociation(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.createBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkCreateBackupPlanAssociationProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateBackupPlanAssociationProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkCreateBackupPlanAssociationProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkCreateBackupPlanAssociationProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('updateBackupPlanAssociation', () => { - it('invokes updateBackupPlanAssociation without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() - ); - request.backupPlanAssociation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); - request.backupPlanAssociation.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCall(expectedResponse); - const [operation] = await client.updateBackupPlanAssociation(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupPlanAssociation without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() - ); - request.backupPlanAssociation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); - request.backupPlanAssociation.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.updateBackupPlanAssociation( - 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.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupPlanAssociation with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() - ); - request.backupPlanAssociation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); - request.backupPlanAssociation.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.updateBackupPlanAssociation(request), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes updateBackupPlanAssociation with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest() - ); - request.backupPlanAssociation ??= {}; - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.UpdateBackupPlanAssociationRequest', ['backupPlanAssociation', 'name']); - request.backupPlanAssociation.name = defaultValue1; - const expectedHeaderRequestParams = `backup_plan_association.name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.updateBackupPlanAssociation = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.updateBackupPlanAssociation(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.updateBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkUpdateBackupPlanAssociationProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupPlanAssociationProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkUpdateBackupPlanAssociationProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkUpdateBackupPlanAssociationProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('deleteBackupPlanAssociation', () => { - it('invokes deleteBackupPlanAssociation without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall(expectedResponse); - const [operation] = await client.deleteBackupPlanAssociation(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupPlanAssociation without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.deleteBackupPlanAssociation( - 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.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupPlanAssociation with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.deleteBackupPlanAssociation(request), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes deleteBackupPlanAssociation with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.DeleteBackupPlanAssociationRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.deleteBackupPlanAssociation = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.deleteBackupPlanAssociation(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.deleteBackupPlanAssociation as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkDeleteBackupPlanAssociationProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupPlanAssociationProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkDeleteBackupPlanAssociationProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkDeleteBackupPlanAssociationProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('triggerBackup', () => { - it('invokes triggerBackup without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.TriggerBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.triggerBackup = stubLongRunningCall(expectedResponse); - const [operation] = await client.triggerBackup(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes triggerBackup without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.TriggerBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.triggerBackup = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.triggerBackup( - 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.triggerBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes triggerBackup with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.TriggerBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.triggerBackup = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.triggerBackup(request), expectedError); - const actualRequest = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes triggerBackup with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.TriggerBackupRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.TriggerBackupRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.triggerBackup = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.triggerBackup(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.triggerBackup as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkTriggerBackupProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkTriggerBackupProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkTriggerBackupProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkTriggerBackupProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('initializeService', () => { - it('invokes initializeService without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.InitializeServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.initializeService = stubLongRunningCall(expectedResponse); - const [operation] = await client.initializeService(request); - const [response] = await operation.promise(); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes initializeService without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.InitializeServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedResponse = generateSampleMessage( - new protos.google.longrunning.Operation() - ); - client.innerApiCalls.initializeService = stubLongRunningCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.initializeService( - 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.initializeService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes initializeService with call error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.InitializeServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.initializeService = stubLongRunningCall(undefined, expectedError); - await assert.rejects(client.initializeService(request), expectedError); - const actualRequest = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes initializeService with LRO error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.InitializeServiceRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.InitializeServiceRequest', ['name']); - request.name = defaultValue1; - const expectedHeaderRequestParams = `name=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.initializeService = stubLongRunningCall(undefined, undefined, expectedError); - const [operation] = await client.initializeService(request); - await assert.rejects(operation.promise(), expectedError); - const actualRequest = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.initializeService as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes checkInitializeServiceProgress without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkInitializeServiceProgress(expectedResponse.name); - assert.deepStrictEqual(decodedOperation.name, expectedResponse.name); - assert(decodedOperation.metadata); - assert((client.operationsClient.getOperation as SinonStub).getCall(0)); - }); - - it('invokes checkInitializeServiceProgress with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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.checkInitializeServiceProgress(''), expectedError); - assert((client.operationsClient.getOperation as SinonStub) - .getCall(0)); - }); - }); - - describe('listManagementServers', () => { - it('invokes listManagementServers without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - ]; - client.innerApiCalls.listManagementServers = stubSimpleCall(expectedResponse); - const [response] = await client.listManagementServers(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listManagementServers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listManagementServers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listManagementServers without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - ]; - client.innerApiCalls.listManagementServers = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listManagementServers( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IManagementServer[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listManagementServers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listManagementServers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listManagementServers with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listManagementServers = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listManagementServers(request), expectedError); - const actualRequest = (client.innerApiCalls.listManagementServers as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listManagementServers as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listManagementServersStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - ]; - client.descriptors.page.listManagementServers.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listManagementServersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.ManagementServer) => { - 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.listManagementServers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listManagementServers, request)); - assert( - (client.descriptors.page.listManagementServers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listManagementServersStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listManagementServers.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listManagementServersStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.ManagementServer[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.ManagementServer) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listManagementServers.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listManagementServers, request)); - assert( - (client.descriptors.page.listManagementServers.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listManagementServers without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.ManagementServer()), - ]; - client.descriptors.page.listManagementServers.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; - const iterable = client.listManagementServersAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listManagementServers with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListManagementServersRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListManagementServersRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listManagementServers.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listManagementServersAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IManagementServer[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listManagementServers.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackupVaults', () => { - it('invokes listBackupVaults without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.innerApiCalls.listBackupVaults = stubSimpleCall(expectedResponse); - const [response] = await client.listBackupVaults(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupVaults as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupVaults as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupVaults without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.innerApiCalls.listBackupVaults = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackupVaults( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupVault[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupVaults as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupVaults as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupVaults with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackupVaults = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackupVaults(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackupVaults as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupVaults as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupVaultsStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.descriptors.page.listBackupVaults.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupVaultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { - 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.listBackupVaults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupVaults, request)); - assert( - (client.descriptors.page.listBackupVaults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupVaultsStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupVaults.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupVaultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackupVaults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupVaults, request)); - assert( - (client.descriptors.page.listBackupVaults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupVaults without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.descriptors.page.listBackupVaults.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; - const iterable = client.listBackupVaultsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupVaults with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupVaults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupVaultsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('fetchUsableBackupVaults', () => { - it('invokes fetchUsableBackupVaults without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCall(expectedResponse); - const [response] = await client.fetchUsableBackupVaults(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchUsableBackupVaults without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchUsableBackupVaults( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupVault[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchUsableBackupVaults with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchUsableBackupVaults = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchUsableBackupVaults(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchUsableBackupVaults as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchUsableBackupVaultsStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.descriptors.page.fetchUsableBackupVaults.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.fetchUsableBackupVaultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { - 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.fetchUsableBackupVaults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchUsableBackupVaults, request)); - assert( - (client.descriptors.page.fetchUsableBackupVaults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes fetchUsableBackupVaultsStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchUsableBackupVaults.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.fetchUsableBackupVaultsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupVault[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupVault) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.fetchUsableBackupVaults.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchUsableBackupVaults, request)); - assert( - (client.descriptors.page.fetchUsableBackupVaults.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchUsableBackupVaults without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupVault()), - ]; - client.descriptors.page.fetchUsableBackupVaults.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; - const iterable = client.fetchUsableBackupVaultsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchUsableBackupVaults with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchUsableBackupVaultsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchUsableBackupVaults.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.fetchUsableBackupVaultsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackupVault[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchUsableBackupVaults.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDataSources', () => { - it('invokes listDataSources without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - ]; - client.innerApiCalls.listDataSources = stubSimpleCall(expectedResponse); - const [response] = await client.listDataSources(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataSources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataSources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataSources without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - ]; - client.innerApiCalls.listDataSources = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataSources( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSource[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataSources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataSources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataSources with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataSources = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataSources(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataSources as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataSources as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataSourcesStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - ]; - client.descriptors.page.listDataSources.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataSourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSource) => { - 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.listDataSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataSources, request)); - assert( - (client.descriptors.page.listDataSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDataSourcesStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDataSources.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataSourcesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.DataSource[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSource) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataSources.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataSources, request)); - assert( - (client.descriptors.page.listDataSources.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataSources without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSource()), - ]; - client.descriptors.page.listDataSources.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; - const iterable = client.listDataSourcesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataSources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDataSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataSources with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourcesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourcesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDataSources.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataSourcesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IDataSource[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataSources.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDataSources.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackups', () => { - it('invokes listBackups without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCall(expectedResponse); - const [response] = await client.listBackups(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.innerApiCalls.listBackups = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackups( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackups with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackups = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackups(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackups as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupsStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { - 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.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupsStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackups, request)); - assert( - (client.descriptors.page.listBackups.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; - const iterable = client.listBackupsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackups with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackups.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackups.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('fetchBackupsForResourceType', () => { - it('invokes fetchBackupsForResourceType without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.innerApiCalls.fetchBackupsForResourceType = stubSimpleCall(expectedResponse); - const [response] = await client.fetchBackupsForResourceType(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchBackupsForResourceType without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.innerApiCalls.fetchBackupsForResourceType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchBackupsForResourceType( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackup[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchBackupsForResourceType with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchBackupsForResourceType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchBackupsForResourceType(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupsForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchBackupsForResourceTypeStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.descriptors.page.fetchBackupsForResourceType.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.fetchBackupsForResourceTypeStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { - 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.fetchBackupsForResourceType.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchBackupsForResourceType, request)); - assert( - (client.descriptors.page.fetchBackupsForResourceType.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes fetchBackupsForResourceTypeStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchBackupsForResourceType.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.fetchBackupsForResourceTypeStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.Backup[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.Backup) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.fetchBackupsForResourceType.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchBackupsForResourceType, request)); - assert( - (client.descriptors.page.fetchBackupsForResourceType.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchBackupsForResourceType without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.Backup()), - ]; - client.descriptors.page.fetchBackupsForResourceType.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; - const iterable = client.fetchBackupsForResourceTypeAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchBackupsForResourceType with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchBackupsForResourceType.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.fetchBackupsForResourceTypeAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackup[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchBackupsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackupPlans', () => { - it('invokes listBackupPlans without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - ]; - client.innerApiCalls.listBackupPlans = stubSimpleCall(expectedResponse); - const [response] = await client.listBackupPlans(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupPlans as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlans as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlans without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - ]; - client.innerApiCalls.listBackupPlans = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackupPlans( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlan[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupPlans as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlans as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlans with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackupPlans = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackupPlans(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackupPlans as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlans as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlansStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - ]; - client.descriptors.page.listBackupPlans.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupPlansStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlan) => { - 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.listBackupPlans.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupPlans, request)); - assert( - (client.descriptors.page.listBackupPlans.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupPlansStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupPlans.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupPlansStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlan[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlan) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackupPlans.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupPlans, request)); - assert( - (client.descriptors.page.listBackupPlans.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupPlans without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlan()), - ]; - client.descriptors.page.listBackupPlans.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; - const iterable = client.listBackupPlansAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupPlans with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlansRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlansRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupPlans.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupPlansAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackupPlan[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupPlans.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackupPlanRevisions', () => { - it('invokes listBackupPlanRevisions without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - ]; - client.innerApiCalls.listBackupPlanRevisions = stubSimpleCall(expectedResponse); - const [response] = await client.listBackupPlanRevisions(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlanRevisions without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - ]; - client.innerApiCalls.listBackupPlanRevisions = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackupPlanRevisions( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanRevision[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlanRevisions with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackupPlanRevisions = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackupPlanRevisions(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanRevisions as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlanRevisionsStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - ]; - client.descriptors.page.listBackupPlanRevisions.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupPlanRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlanRevision[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanRevision) => { - 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.listBackupPlanRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupPlanRevisions, request)); - assert( - (client.descriptors.page.listBackupPlanRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupPlanRevisionsStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupPlanRevisions.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupPlanRevisionsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlanRevision[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanRevision) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackupPlanRevisions.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupPlanRevisions, request)); - assert( - (client.descriptors.page.listBackupPlanRevisions.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupPlanRevisions without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanRevision()), - ]; - client.descriptors.page.listBackupPlanRevisions.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackupPlanRevision[] = []; - const iterable = client.listBackupPlanRevisionsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupPlanRevisions with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanRevisionsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupPlanRevisions.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupPlanRevisionsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackupPlanRevision[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupPlanRevisions.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listBackupPlanAssociations', () => { - it('invokes listBackupPlanAssociations without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall(expectedResponse); - const [response] = await client.listBackupPlanAssociations(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlanAssociations without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.innerApiCalls.listBackupPlanAssociations = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listBackupPlanAssociations( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlanAssociations with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listBackupPlanAssociations = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listBackupPlanAssociations(request), expectedError); - const actualRequest = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listBackupPlanAssociations as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listBackupPlanAssociationsStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listBackupPlanAssociationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { - 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.listBackupPlanAssociations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupPlanAssociations, request)); - assert( - (client.descriptors.page.listBackupPlanAssociations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listBackupPlanAssociationsStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupPlanAssociations.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listBackupPlanAssociationsStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listBackupPlanAssociations.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listBackupPlanAssociations, request)); - assert( - (client.descriptors.page.listBackupPlanAssociations.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupPlanAssociations without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; - const iterable = client.listBackupPlanAssociationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listBackupPlanAssociations with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListBackupPlanAssociationsRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listBackupPlanAssociations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listBackupPlanAssociationsAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listBackupPlanAssociations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('fetchBackupPlanAssociationsForResourceType', () => { - it('invokes fetchBackupPlanAssociationsForResourceType without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.innerApiCalls.fetchBackupPlanAssociationsForResourceType = stubSimpleCall(expectedResponse); - const [response] = await client.fetchBackupPlanAssociationsForResourceType(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchBackupPlanAssociationsForResourceType without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.innerApiCalls.fetchBackupPlanAssociationsForResourceType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchBackupPlanAssociationsForResourceType( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchBackupPlanAssociationsForResourceType with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchBackupPlanAssociationsForResourceType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchBackupPlanAssociationsForResourceType(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchBackupPlanAssociationsForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchBackupPlanAssociationsForResourceTypeStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.fetchBackupPlanAssociationsForResourceTypeStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { - 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.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchBackupPlanAssociationsForResourceType, request)); - assert( - (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes fetchBackupPlanAssociationsForResourceTypeStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.fetchBackupPlanAssociationsForResourceTypeStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.BackupPlanAssociation[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.BackupPlanAssociation) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchBackupPlanAssociationsForResourceType, request)); - assert( - (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchBackupPlanAssociationsForResourceType without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.BackupPlanAssociation()), - ]; - client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; - const iterable = client.fetchBackupPlanAssociationsForResourceTypeAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchBackupPlanAssociationsForResourceType with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchBackupPlanAssociationsForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.fetchBackupPlanAssociationsForResourceTypeAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IBackupPlanAssociation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchBackupPlanAssociationsForResourceType.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('listDataSourceReferences', () => { - it('invokes listDataSourceReferences without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.innerApiCalls.listDataSourceReferences = stubSimpleCall(expectedResponse); - const [response] = await client.listDataSourceReferences(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataSourceReferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataSourceReferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataSourceReferences without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.innerApiCalls.listDataSourceReferences = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.listDataSourceReferences( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSourceReference[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.listDataSourceReferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataSourceReferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataSourceReferences with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.listDataSourceReferences = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.listDataSourceReferences(request), expectedError); - const actualRequest = (client.innerApiCalls.listDataSourceReferences as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.listDataSourceReferences as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes listDataSourceReferencesStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.descriptors.page.listDataSourceReferences.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.listDataSourceReferencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { - 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.listDataSourceReferences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataSourceReferences, request)); - assert( - (client.descriptors.page.listDataSourceReferences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes listDataSourceReferencesStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDataSourceReferences.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.listDataSourceReferencesStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.listDataSourceReferences.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.listDataSourceReferences, request)); - assert( - (client.descriptors.page.listDataSourceReferences.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataSourceReferences without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.descriptors.page.listDataSourceReferences.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; - const iterable = client.listDataSourceReferencesAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with listDataSourceReferences with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.ListDataSourceReferencesRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.ListDataSourceReferencesRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.listDataSourceReferences.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listDataSourceReferencesAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.listDataSourceReferences.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - - describe('fetchDataSourceReferencesForResourceType', () => { - it('invokes fetchDataSourceReferencesForResourceType without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.innerApiCalls.fetchDataSourceReferencesForResourceType = stubSimpleCall(expectedResponse); - const [response] = await client.fetchDataSourceReferencesForResourceType(request); - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchDataSourceReferencesForResourceType without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`;const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.innerApiCalls.fetchDataSourceReferencesForResourceType = stubSimpleCallWithCallback(expectedResponse); - const promise = new Promise((resolve, reject) => { - client.fetchDataSourceReferencesForResourceType( - request, - (err?: Error|null, result?: protos.google.cloud.backupdr.v1.IDataSourceReference[]|null) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - const actualRequest = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchDataSourceReferencesForResourceType with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.innerApiCalls.fetchDataSourceReferencesForResourceType = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.fetchDataSourceReferencesForResourceType(request), expectedError); - const actualRequest = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) - .getCall(0).args[0]; - assert.deepStrictEqual(actualRequest, request); - const actualHeaderRequestParams = (client.innerApiCalls.fetchDataSourceReferencesForResourceType as SinonStub) - .getCall(0).args[1].otherArgs.headers['x-goog-request-params']; - assert(actualHeaderRequestParams.includes(expectedHeaderRequestParams)); - }); - - it('invokes fetchDataSourceReferencesForResourceTypeStream without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream = stubPageStreamingCall(expectedResponse); - const stream = client.fetchDataSourceReferencesForResourceTypeStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { - 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.fetchDataSourceReferencesForResourceType.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchDataSourceReferencesForResourceType, request)); - assert( - (client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('invokes fetchDataSourceReferencesForResourceTypeStream with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream = stubPageStreamingCall(undefined, expectedError); - const stream = client.fetchDataSourceReferencesForResourceTypeStream(request); - const promise = new Promise((resolve, reject) => { - const responses: protos.google.cloud.backupdr.v1.DataSourceReference[] = []; - stream.on('data', (response: protos.google.cloud.backupdr.v1.DataSourceReference) => { - responses.push(response); - }); - stream.on('end', () => { - resolve(responses); - }); - stream.on('error', (err: Error) => { - reject(err); - }); - }); - await assert.rejects(promise, expectedError); - assert((client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream as SinonStub) - .getCall(0).calledWith(client.innerApiCalls.fetchDataSourceReferencesForResourceType, request)); - assert( - (client.descriptors.page.fetchDataSourceReferencesForResourceType.createStream as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchDataSourceReferencesForResourceType without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedResponse = [ - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - generateSampleMessage(new protos.google.cloud.backupdr.v1.DataSourceReference()), - ]; - client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; - const iterable = client.fetchDataSourceReferencesForResourceTypeAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - - it('uses async iteration with fetchDataSourceReferencesForResourceType with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new protos.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest() - ); - const defaultValue1 = - getTypeDefaultValue('.google.cloud.backupdr.v1.FetchDataSourceReferencesForResourceTypeRequest', ['parent']); - request.parent = defaultValue1; - const expectedHeaderRequestParams = `parent=${defaultValue1 ?? '' }`; - const expectedError = new Error('expected'); - client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.fetchDataSourceReferencesForResourceTypeAsync(request); - await assert.rejects(async () => { - const responses: protos.google.cloud.backupdr.v1.IDataSourceReference[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.descriptors.page.fetchDataSourceReferencesForResourceType.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.descriptors.page.fetchDataSourceReferencesForResourceType.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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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('getLocation', () => { - it('invokes getLocation without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = stubSimpleCall(expectedResponse); - const response = await client.getLocation(request, expectedOptions); - assert.deepStrictEqual(response, [expectedResponse]); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - it('invokes getLocation without error using callback', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedResponse = generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ); - client.locationsClient.getLocation = sinon.stub().callsArgWith(2, null, expectedResponse); - const promise = new Promise((resolve, reject) => { - client.getLocation( - request, - expectedOptions, - ( - err?: Error | null, - result?: LocationProtos.google.cloud.location.ILocation | null - ) => { - if (err) { - reject(err); - } else { - resolve(result); - } - }); - }); - const response = await promise; - assert.deepStrictEqual(response, expectedResponse); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0)); - }); - it('invokes getLocation with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.GetLocationRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedOptions = { - otherArgs: { - headers: { - 'x-goog-request-params': expectedHeaderRequestParams, - }, - }, - }; - const expectedError = new Error('expected'); - client.locationsClient.getLocation = stubSimpleCall(undefined, expectedError); - await assert.rejects(client.getLocation(request, expectedOptions), expectedError); - assert((client.locationsClient.getLocation as SinonStub) - .getCall(0).calledWith(request, expectedOptions, undefined)); - }); - }); - describe('listLocationsAsync', () => { - it('uses async iteration with listLocations without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedResponse = [ - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - generateSampleMessage( - new LocationProtos.google.cloud.location.Location() - ), - ]; - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(expectedResponse); - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - const iterable = client.listLocationsAsync(request); - for await (const resource of iterable) { - responses.push(resource!); - } - assert.deepStrictEqual(responses, expectedResponse); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - it('uses async iteration with listLocations with error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - const request = generateSampleMessage( - new LocationProtos.google.cloud.location.ListLocationsRequest() - ); - request.name = ''; - const expectedHeaderRequestParams = 'name='; - const expectedError = new Error('expected'); - client.locationsClient.descriptors.page.listLocations.asyncIterate = stubAsyncIterationCall(undefined, expectedError); - const iterable = client.listLocationsAsync(request); - await assert.rejects(async () => { - const responses: LocationProtos.google.cloud.location.ILocation[] = []; - for await (const resource of iterable) { - responses.push(resource!); - } - }); - assert.deepStrictEqual( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[1], request); - assert( - (client.locationsClient.descriptors.page.listLocations.asyncIterate as SinonStub) - .getCall(0).args[2].otherArgs.headers['x-goog-request-params'].includes( - expectedHeaderRequestParams - ) - ); - }); - }); - describe('getOperation', () => { - it('invokes getOperation without error', async () => { - const client = new backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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 backupdrModule.v1.BackupDRClient({ - 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('backup', async () => { - const fakePath = "/rendered/path/backup"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backupvault: "backupvaultValue", - datasource: "datasourceValue", - backup: "backupValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPath', () => { - const result = client.backupPath("projectValue", "locationValue", "backupvaultValue", "datasourceValue", "backupValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupName', () => { - const result = client.matchProjectFromBackupName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupName', () => { - const result = client.matchLocationFromBackupName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupvaultFromBackupName', () => { - const result = client.matchBackupvaultFromBackupName(fakePath); - assert.strictEqual(result, "backupvaultValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasourceFromBackupName', () => { - const result = client.matchDatasourceFromBackupName(fakePath); - assert.strictEqual(result, "datasourceValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupFromBackupName', () => { - const result = client.matchBackupFromBackupName(fakePath); - assert.strictEqual(result, "backupValue"); - assert((client.pathTemplates.backupPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backupPlan', async () => { - const fakePath = "/rendered/path/backupPlan"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup_plan: "backupPlanValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPlanPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPlanPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPlanPath', () => { - const result = client.backupPlanPath("projectValue", "locationValue", "backupPlanValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPlanPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupPlanName', () => { - const result = client.matchProjectFromBackupPlanName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupPlanName', () => { - const result = client.matchLocationFromBackupPlanName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupPlanFromBackupPlanName', () => { - const result = client.matchBackupPlanFromBackupPlanName(fakePath); - assert.strictEqual(result, "backupPlanValue"); - assert((client.pathTemplates.backupPlanPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backupPlanAssociation', async () => { - const fakePath = "/rendered/path/backupPlanAssociation"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup_plan_association: "backupPlanAssociationValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPlanAssociationPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPlanAssociationPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPlanAssociationPath', () => { - const result = client.backupPlanAssociationPath("projectValue", "locationValue", "backupPlanAssociationValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPlanAssociationPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupPlanAssociationName', () => { - const result = client.matchProjectFromBackupPlanAssociationName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupPlanAssociationName', () => { - const result = client.matchLocationFromBackupPlanAssociationName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupPlanAssociationFromBackupPlanAssociationName', () => { - const result = client.matchBackupPlanAssociationFromBackupPlanAssociationName(fakePath); - assert.strictEqual(result, "backupPlanAssociationValue"); - assert((client.pathTemplates.backupPlanAssociationPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backupPlanRevision', async () => { - const fakePath = "/rendered/path/backupPlanRevision"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backup_plan: "backupPlanValue", - revision: "revisionValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupPlanRevisionPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupPlanRevisionPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupPlanRevisionPath', () => { - const result = client.backupPlanRevisionPath("projectValue", "locationValue", "backupPlanValue", "revisionValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupPlanRevisionPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupPlanRevisionName', () => { - const result = client.matchProjectFromBackupPlanRevisionName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupPlanRevisionName', () => { - const result = client.matchLocationFromBackupPlanRevisionName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupPlanFromBackupPlanRevisionName', () => { - const result = client.matchBackupPlanFromBackupPlanRevisionName(fakePath); - assert.strictEqual(result, "backupPlanValue"); - assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchRevisionFromBackupPlanRevisionName', () => { - const result = client.matchRevisionFromBackupPlanRevisionName(fakePath); - assert.strictEqual(result, "revisionValue"); - assert((client.pathTemplates.backupPlanRevisionPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('backupVault', async () => { - const fakePath = "/rendered/path/backupVault"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backupvault: "backupvaultValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.backupVaultPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.backupVaultPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('backupVaultPath', () => { - const result = client.backupVaultPath("projectValue", "locationValue", "backupvaultValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.backupVaultPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromBackupVaultName', () => { - const result = client.matchProjectFromBackupVaultName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromBackupVaultName', () => { - const result = client.matchLocationFromBackupVaultName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupvaultFromBackupVaultName', () => { - const result = client.matchBackupvaultFromBackupVaultName(fakePath); - assert.strictEqual(result, "backupvaultValue"); - assert((client.pathTemplates.backupVaultPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataSource', async () => { - const fakePath = "/rendered/path/dataSource"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - backupvault: "backupvaultValue", - datasource: "datasourceValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.dataSourcePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataSourcePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataSourcePath', () => { - const result = client.dataSourcePath("projectValue", "locationValue", "backupvaultValue", "datasourceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataSourcePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataSourceName', () => { - const result = client.matchProjectFromDataSourceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataSourceName', () => { - const result = client.matchLocationFromDataSourceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchBackupvaultFromDataSourceName', () => { - const result = client.matchBackupvaultFromDataSourceName(fakePath); - assert.strictEqual(result, "backupvaultValue"); - assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDatasourceFromDataSourceName', () => { - const result = client.matchDatasourceFromDataSourceName(fakePath); - assert.strictEqual(result, "datasourceValue"); - assert((client.pathTemplates.dataSourcePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('dataSourceReference', async () => { - const fakePath = "/rendered/path/dataSourceReference"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - data_source_reference: "dataSourceReferenceValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.dataSourceReferencePathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.dataSourceReferencePathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('dataSourceReferencePath', () => { - const result = client.dataSourceReferencePath("projectValue", "locationValue", "dataSourceReferenceValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.dataSourceReferencePathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromDataSourceReferenceName', () => { - const result = client.matchProjectFromDataSourceReferenceName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromDataSourceReferenceName', () => { - const result = client.matchLocationFromDataSourceReferenceName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchDataSourceReferenceFromDataSourceReferenceName', () => { - const result = client.matchDataSourceReferenceFromDataSourceReferenceName(fakePath); - assert.strictEqual(result, "dataSourceReferenceValue"); - assert((client.pathTemplates.dataSourceReferencePathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('location', async () => { - const fakePath = "/rendered/path/location"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - 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('managementServer', async () => { - const fakePath = "/rendered/path/managementServer"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - managementserver: "managementserverValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.managementServerPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.managementServerPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('managementServerPath', () => { - const result = client.managementServerPath("projectValue", "locationValue", "managementserverValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.managementServerPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromManagementServerName', () => { - const result = client.matchProjectFromManagementServerName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromManagementServerName', () => { - const result = client.matchLocationFromManagementServerName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchManagementserverFromManagementServerName', () => { - const result = client.matchManagementserverFromManagementServerName(fakePath); - assert.strictEqual(result, "managementserverValue"); - assert((client.pathTemplates.managementServerPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - - describe('project', async () => { - const fakePath = "/rendered/path/project"; - const expectedParameters = { - project: "projectValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - 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('resourceBackupConfig', async () => { - const fakePath = "/rendered/path/resourceBackupConfig"; - const expectedParameters = { - project: "projectValue", - location: "locationValue", - resource_backup_config: "resourceBackupConfigValue", - }; - const client = new backupdrModule.v1.BackupDRClient({ - credentials: {client_email: 'bogus', private_key: 'bogus'}, - projectId: 'bogus', - }); - await client.initialize(); - client.pathTemplates.resourceBackupConfigPathTemplate.render = - sinon.stub().returns(fakePath); - client.pathTemplates.resourceBackupConfigPathTemplate.match = - sinon.stub().returns(expectedParameters); - - it('resourceBackupConfigPath', () => { - const result = client.resourceBackupConfigPath("projectValue", "locationValue", "resourceBackupConfigValue"); - assert.strictEqual(result, fakePath); - assert((client.pathTemplates.resourceBackupConfigPathTemplate.render as SinonStub) - .getCall(-1).calledWith(expectedParameters)); - }); - - it('matchProjectFromResourceBackupConfigName', () => { - const result = client.matchProjectFromResourceBackupConfigName(fakePath); - assert.strictEqual(result, "projectValue"); - assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchLocationFromResourceBackupConfigName', () => { - const result = client.matchLocationFromResourceBackupConfigName(fakePath); - assert.strictEqual(result, "locationValue"); - assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - - it('matchResourceBackupConfigFromResourceBackupConfigName', () => { - const result = client.matchResourceBackupConfigFromResourceBackupConfigName(fakePath); - assert.strictEqual(result, "resourceBackupConfigValue"); - assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) - .getCall(-1).calledWith(fakePath)); - }); - }); - }); -}); diff --git a/owl-bot-staging/google-cloud-backupdr/tsconfig.json b/owl-bot-staging/google-cloud-backupdr/tsconfig.json deleted file mode 100644 index ca73e7bfc82..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/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-backupdr/webpack.config.js b/owl-bot-staging/google-cloud-backupdr/webpack.config.js deleted file mode 100644 index 72a35713b8c..00000000000 --- a/owl-bot-staging/google-cloud-backupdr/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: 'BackupDR', - filename: './backup-d-r.js', - }, - node: { - child_process: 'empty', - fs: 'empty', - crypto: 'empty', - }, - resolve: { - alias: { - '../../../package.json': path.resolve(__dirname, 'package.json'), - }, - extensions: ['.js', '.json', '.ts'], - }, - module: { - rules: [ - { - test: /\.tsx?$/, - use: 'ts-loader', - exclude: /node_modules/ - }, - { - test: /node_modules[\\/]@grpc[\\/]grpc-js/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]grpc/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]retry-request/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]https?-proxy-agent/, - use: 'null-loader' - }, - { - test: /node_modules[\\/]gtoken/, - use: 'null-loader' - }, - ], - }, - mode: 'production', -}; diff --git a/packages/google-cloud-backupdr/.jsdoc.js b/packages/google-cloud-backupdr/.jsdoc.js index f6b96e7b70a..c694adb20c8 100644 --- a/packages/google-cloud-backupdr/.jsdoc.js +++ b/packages/google-cloud-backupdr/.jsdoc.js @@ -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. @@ -40,7 +40,7 @@ module.exports = { includePattern: '\\.js$' }, templates: { - copyright: 'Copyright 2025 Google LLC', + copyright: 'Copyright 2026 Google LLC', includeDate: false, sourceFiles: false, systemName: '@google-cloud/backupdr', diff --git a/packages/google-cloud-backupdr/.mocharc.js b/packages/google-cloud-backupdr/.mocharc.js index 24e9d15257f..5eb34e86c87 100644 --- a/packages/google-cloud-backupdr/.mocharc.js +++ b/packages/google-cloud-backupdr/.mocharc.js @@ -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. diff --git a/packages/google-cloud-backupdr/.prettierrc.js b/packages/google-cloud-backupdr/.prettierrc.js index d89a632f90b..7649ee3c254 100644 --- a/packages/google-cloud-backupdr/.prettierrc.js +++ b/packages/google-cloud-backupdr/.prettierrc.js @@ -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. diff --git a/packages/google-cloud-backupdr/README.md b/packages/google-cloud-backupdr/README.md index 6284940c753..e6ee413b3b5 100644 --- a/packages/google-cloud-backupdr/README.md +++ b/packages/google-cloud-backupdr/README.md @@ -95,6 +95,7 @@ Samples are in the [`samples/`][homepage_samples] directory. Each sample's `READ | update backup plan association | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js) | | update backup vault | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js) | | update data source | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js) | +| list resource backup configs | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js) | | cloud | [source code](https://github.com/googleapis/google-cloud-node/blob/main/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json) | diff --git a/owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto b/packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto similarity index 100% rename from owl-bot-staging/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto rename to packages/google-cloud-backupdr/protos/google/cloud/backupdr/v1/protection_summary.proto diff --git a/packages/google-cloud-backupdr/protos/protos.d.ts b/packages/google-cloud-backupdr/protos/protos.d.ts index 1795a47a51d..30f0900de60 100644 --- a/packages/google-cloud-backupdr/protos/protos.d.ts +++ b/packages/google-cloud-backupdr/protos/protos.d.ts @@ -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. @@ -15573,6 +15573,1126 @@ export namespace google { */ public static getTypeUrl(typeUrlPrefix?: string): string; } + + /** Represents a BackupDrProtectionSummary */ + class BackupDrProtectionSummary extends $protobuf.rpc.Service { + + /** + * Constructs a new BackupDrProtectionSummary 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 BackupDrProtectionSummary 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): BackupDrProtectionSummary; + + /** + * Calls ListResourceBackupConfigs. + * @param request ListResourceBackupConfigsRequest message or plain object + * @param callback Node-style callback called with the error, if any, and ListResourceBackupConfigsResponse + */ + public listResourceBackupConfigs(request: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, callback: google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigsCallback): void; + + /** + * Calls ListResourceBackupConfigs. + * @param request ListResourceBackupConfigsRequest message or plain object + * @returns Promise + */ + public listResourceBackupConfigs(request: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest): Promise; + } + + namespace BackupDrProtectionSummary { + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDrProtectionSummary|listResourceBackupConfigs}. + * @param error Error, if any + * @param [response] ListResourceBackupConfigsResponse + */ + type ListResourceBackupConfigsCallback = (error: (Error|null), response?: google.cloud.backupdr.v1.ListResourceBackupConfigsResponse) => void; + } + + /** Properties of a ListResourceBackupConfigsRequest. */ + interface IListResourceBackupConfigsRequest { + + /** ListResourceBackupConfigsRequest parent */ + parent?: (string|null); + + /** ListResourceBackupConfigsRequest pageSize */ + pageSize?: (number|null); + + /** ListResourceBackupConfigsRequest pageToken */ + pageToken?: (string|null); + + /** ListResourceBackupConfigsRequest filter */ + filter?: (string|null); + + /** ListResourceBackupConfigsRequest orderBy */ + orderBy?: (string|null); + } + + /** Represents a ListResourceBackupConfigsRequest. */ + class ListResourceBackupConfigsRequest implements IListResourceBackupConfigsRequest { + + /** + * Constructs a new ListResourceBackupConfigsRequest. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest); + + /** ListResourceBackupConfigsRequest parent. */ + public parent: string; + + /** ListResourceBackupConfigsRequest pageSize. */ + public pageSize: number; + + /** ListResourceBackupConfigsRequest pageToken. */ + public pageToken: string; + + /** ListResourceBackupConfigsRequest filter. */ + public filter: string; + + /** ListResourceBackupConfigsRequest orderBy. */ + public orderBy: string; + + /** + * Creates a new ListResourceBackupConfigsRequest instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceBackupConfigsRequest instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Encodes the specified ListResourceBackupConfigsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @param message ListResourceBackupConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceBackupConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @param message ListResourceBackupConfigsRequest message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListResourceBackupConfigsRequest, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Verifies a ListResourceBackupConfigsRequest message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceBackupConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceBackupConfigsRequest + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListResourceBackupConfigsRequest; + + /** + * Creates a plain object from a ListResourceBackupConfigsRequest message. Also converts values to other types if specified. + * @param message ListResourceBackupConfigsRequest + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListResourceBackupConfigsRequest, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceBackupConfigsRequest to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceBackupConfigsRequest + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ListResourceBackupConfigsResponse. */ + interface IListResourceBackupConfigsResponse { + + /** ListResourceBackupConfigsResponse resourceBackupConfigs */ + resourceBackupConfigs?: (google.cloud.backupdr.v1.IResourceBackupConfig[]|null); + + /** ListResourceBackupConfigsResponse nextPageToken */ + nextPageToken?: (string|null); + } + + /** Represents a ListResourceBackupConfigsResponse. */ + class ListResourceBackupConfigsResponse implements IListResourceBackupConfigsResponse { + + /** + * Constructs a new ListResourceBackupConfigsResponse. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse); + + /** ListResourceBackupConfigsResponse resourceBackupConfigs. */ + public resourceBackupConfigs: google.cloud.backupdr.v1.IResourceBackupConfig[]; + + /** ListResourceBackupConfigsResponse nextPageToken. */ + public nextPageToken: string; + + /** + * Creates a new ListResourceBackupConfigsResponse instance using the specified properties. + * @param [properties] Properties to set + * @returns ListResourceBackupConfigsResponse instance + */ + public static create(properties?: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Encodes the specified ListResourceBackupConfigsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @param message ListResourceBackupConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ListResourceBackupConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @param message ListResourceBackupConfigsResponse message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IListResourceBackupConfigsResponse, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Verifies a ListResourceBackupConfigsResponse message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ListResourceBackupConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ListResourceBackupConfigsResponse + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ListResourceBackupConfigsResponse; + + /** + * Creates a plain object from a ListResourceBackupConfigsResponse message. Also converts values to other types if specified. + * @param message ListResourceBackupConfigsResponse + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ListResourceBackupConfigsResponse, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ListResourceBackupConfigsResponse to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ListResourceBackupConfigsResponse + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a ResourceBackupConfig. */ + interface IResourceBackupConfig { + + /** ResourceBackupConfig name */ + name?: (string|null); + + /** ResourceBackupConfig uid */ + uid?: (string|null); + + /** ResourceBackupConfig targetResource */ + targetResource?: (string|null); + + /** ResourceBackupConfig targetResourceDisplayName */ + targetResourceDisplayName?: (string|null); + + /** ResourceBackupConfig targetResourceType */ + targetResourceType?: (google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|keyof typeof google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|null); + + /** ResourceBackupConfig targetResourceLabels */ + targetResourceLabels?: ({ [k: string]: string }|null); + + /** ResourceBackupConfig backupConfigsDetails */ + backupConfigsDetails?: (google.cloud.backupdr.v1.IBackupConfigDetails[]|null); + + /** ResourceBackupConfig backupConfigured */ + backupConfigured?: (boolean|null); + + /** ResourceBackupConfig vaulted */ + vaulted?: (boolean|null); + } + + /** Represents a ResourceBackupConfig. */ + class ResourceBackupConfig implements IResourceBackupConfig { + + /** + * Constructs a new ResourceBackupConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IResourceBackupConfig); + + /** ResourceBackupConfig name. */ + public name: string; + + /** ResourceBackupConfig uid. */ + public uid: string; + + /** ResourceBackupConfig targetResource. */ + public targetResource: string; + + /** ResourceBackupConfig targetResourceDisplayName. */ + public targetResourceDisplayName: string; + + /** ResourceBackupConfig targetResourceType. */ + public targetResourceType: (google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|keyof typeof google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType); + + /** ResourceBackupConfig targetResourceLabels. */ + public targetResourceLabels: { [k: string]: string }; + + /** ResourceBackupConfig backupConfigsDetails. */ + public backupConfigsDetails: google.cloud.backupdr.v1.IBackupConfigDetails[]; + + /** ResourceBackupConfig backupConfigured. */ + public backupConfigured: boolean; + + /** ResourceBackupConfig vaulted. */ + public vaulted: boolean; + + /** + * Creates a new ResourceBackupConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns ResourceBackupConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IResourceBackupConfig): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Encodes the specified ResourceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @param message ResourceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IResourceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ResourceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @param message ResourceBackupConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IResourceBackupConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Verifies a ResourceBackupConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ResourceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ResourceBackupConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.ResourceBackupConfig; + + /** + * Creates a plain object from a ResourceBackupConfig message. Also converts values to other types if specified. + * @param message ResourceBackupConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.ResourceBackupConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ResourceBackupConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for ResourceBackupConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace ResourceBackupConfig { + + /** ResourceType enum. */ + enum ResourceType { + RESOURCE_TYPE_UNSPECIFIED = 0, + CLOUD_SQL_INSTANCE = 1, + COMPUTE_ENGINE_VM = 2, + COMPUTE_ENGINE_DISK = 3, + COMPUTE_ENGINE_REGIONAL_DISK = 4 + } + } + + /** Properties of a BackupConfigDetails. */ + interface IBackupConfigDetails { + + /** BackupConfigDetails backupConfigSource */ + backupConfigSource?: (string|null); + + /** BackupConfigDetails backupConfigSourceDisplayName */ + backupConfigSourceDisplayName?: (string|null); + + /** BackupConfigDetails type */ + type?: (google.cloud.backupdr.v1.BackupConfigDetails.Type|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.Type|null); + + /** BackupConfigDetails state */ + state?: (google.cloud.backupdr.v1.BackupConfigDetails.State|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.State|null); + + /** BackupConfigDetails pitrSettings */ + pitrSettings?: (google.cloud.backupdr.v1.IPitrSettings|null); + + /** BackupConfigDetails latestSuccessfulBackupTime */ + latestSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigDetails applicableResource */ + applicableResource?: (string|null); + + /** BackupConfigDetails backupVault */ + backupVault?: (string|null); + + /** BackupConfigDetails backupLocations */ + backupLocations?: (google.cloud.backupdr.v1.IBackupLocation[]|null); + + /** BackupConfigDetails backupDrPlanConfig */ + backupDrPlanConfig?: (google.cloud.backupdr.v1.IBackupDrPlanConfig|null); + + /** BackupConfigDetails backupDrTemplateConfig */ + backupDrTemplateConfig?: (google.cloud.backupdr.v1.IBackupDrTemplateConfig|null); + } + + /** Represents a BackupConfigDetails. */ + class BackupConfigDetails implements IBackupConfigDetails { + + /** + * Constructs a new BackupConfigDetails. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupConfigDetails); + + /** BackupConfigDetails backupConfigSource. */ + public backupConfigSource: string; + + /** BackupConfigDetails backupConfigSourceDisplayName. */ + public backupConfigSourceDisplayName: string; + + /** BackupConfigDetails type. */ + public type: (google.cloud.backupdr.v1.BackupConfigDetails.Type|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.Type); + + /** BackupConfigDetails state. */ + public state: (google.cloud.backupdr.v1.BackupConfigDetails.State|keyof typeof google.cloud.backupdr.v1.BackupConfigDetails.State); + + /** BackupConfigDetails pitrSettings. */ + public pitrSettings?: (google.cloud.backupdr.v1.IPitrSettings|null); + + /** BackupConfigDetails latestSuccessfulBackupTime. */ + public latestSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + + /** BackupConfigDetails applicableResource. */ + public applicableResource: string; + + /** BackupConfigDetails backupVault. */ + public backupVault: string; + + /** BackupConfigDetails backupLocations. */ + public backupLocations: google.cloud.backupdr.v1.IBackupLocation[]; + + /** BackupConfigDetails backupDrPlanConfig. */ + public backupDrPlanConfig?: (google.cloud.backupdr.v1.IBackupDrPlanConfig|null); + + /** BackupConfigDetails backupDrTemplateConfig. */ + public backupDrTemplateConfig?: (google.cloud.backupdr.v1.IBackupDrTemplateConfig|null); + + /** BackupConfigDetails planSpecificConfig. */ + public planSpecificConfig?: ("backupDrPlanConfig"|"backupDrTemplateConfig"); + + /** + * Creates a new BackupConfigDetails instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupConfigDetails instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupConfigDetails): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Encodes the specified BackupConfigDetails message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @param message BackupConfigDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupConfigDetails message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @param message BackupConfigDetails message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupConfigDetails, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Verifies a BackupConfigDetails message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupConfigDetails message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupConfigDetails + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupConfigDetails; + + /** + * Creates a plain object from a BackupConfigDetails message. Also converts values to other types if specified. + * @param message BackupConfigDetails + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupConfigDetails, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupConfigDetails to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupConfigDetails + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupConfigDetails { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + CLOUD_SQL_INSTANCE_BACKUP_CONFIG = 1, + COMPUTE_ENGINE_RESOURCE_POLICY = 2, + BACKUPDR_BACKUP_PLAN = 3, + BACKUPDR_TEMPLATE = 4 + } + + /** State enum. */ + enum State { + STATE_UNSPECIFIED = 0, + ACTIVE = 1, + INACTIVE = 2, + ERROR = 3 + } + } + + /** Properties of a PitrSettings. */ + interface IPitrSettings { + + /** PitrSettings retentionDays */ + retentionDays?: (number|null); + } + + /** Represents a PitrSettings. */ + class PitrSettings implements IPitrSettings { + + /** + * Constructs a new PitrSettings. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IPitrSettings); + + /** PitrSettings retentionDays. */ + public retentionDays: number; + + /** + * Creates a new PitrSettings instance using the specified properties. + * @param [properties] Properties to set + * @returns PitrSettings instance + */ + public static create(properties?: google.cloud.backupdr.v1.IPitrSettings): google.cloud.backupdr.v1.PitrSettings; + + /** + * Encodes the specified PitrSettings message. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @param message PitrSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IPitrSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PitrSettings message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @param message PitrSettings message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IPitrSettings, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PitrSettings message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.PitrSettings; + + /** + * Decodes a PitrSettings message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.PitrSettings; + + /** + * Verifies a PitrSettings message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PitrSettings message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PitrSettings + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.PitrSettings; + + /** + * Creates a plain object from a PitrSettings message. Also converts values to other types if specified. + * @param message PitrSettings + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.PitrSettings, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PitrSettings to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for PitrSettings + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupDrTemplateConfig. */ + interface IBackupDrTemplateConfig { + + /** BackupDrTemplateConfig firstPartyManagementUri */ + firstPartyManagementUri?: (string|null); + + /** BackupDrTemplateConfig thirdPartyManagementUri */ + thirdPartyManagementUri?: (string|null); + } + + /** Represents a BackupDrTemplateConfig. */ + class BackupDrTemplateConfig implements IBackupDrTemplateConfig { + + /** + * Constructs a new BackupDrTemplateConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupDrTemplateConfig); + + /** BackupDrTemplateConfig firstPartyManagementUri. */ + public firstPartyManagementUri: string; + + /** BackupDrTemplateConfig thirdPartyManagementUri. */ + public thirdPartyManagementUri: string; + + /** + * Creates a new BackupDrTemplateConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDrTemplateConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupDrTemplateConfig): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Encodes the specified BackupDrTemplateConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @param message BackupDrTemplateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupDrTemplateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDrTemplateConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @param message BackupDrTemplateConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrTemplateConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Verifies a BackupDrTemplateConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDrTemplateConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDrTemplateConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrTemplateConfig; + + /** + * Creates a plain object from a BackupDrTemplateConfig message. Also converts values to other types if specified. + * @param message BackupDrTemplateConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupDrTemplateConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDrTemplateConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDrTemplateConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupDrPlanConfig. */ + interface IBackupDrPlanConfig { + + /** BackupDrPlanConfig backupDrPlanRules */ + backupDrPlanRules?: (google.cloud.backupdr.v1.IBackupDrPlanRule[]|null); + } + + /** Represents a BackupDrPlanConfig. */ + class BackupDrPlanConfig implements IBackupDrPlanConfig { + + /** + * Constructs a new BackupDrPlanConfig. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupDrPlanConfig); + + /** BackupDrPlanConfig backupDrPlanRules. */ + public backupDrPlanRules: google.cloud.backupdr.v1.IBackupDrPlanRule[]; + + /** + * Creates a new BackupDrPlanConfig instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDrPlanConfig instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupDrPlanConfig): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Encodes the specified BackupDrPlanConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @param message BackupDrPlanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupDrPlanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDrPlanConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @param message BackupDrPlanConfig message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrPlanConfig, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Verifies a BackupDrPlanConfig message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDrPlanConfig message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDrPlanConfig + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrPlanConfig; + + /** + * Creates a plain object from a BackupDrPlanConfig message. Also converts values to other types if specified. + * @param message BackupDrPlanConfig + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupDrPlanConfig, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDrPlanConfig to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDrPlanConfig + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupDrPlanRule. */ + interface IBackupDrPlanRule { + + /** BackupDrPlanRule ruleId */ + ruleId?: (string|null); + + /** BackupDrPlanRule lastSuccessfulBackupTime */ + lastSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + } + + /** Represents a BackupDrPlanRule. */ + class BackupDrPlanRule implements IBackupDrPlanRule { + + /** + * Constructs a new BackupDrPlanRule. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupDrPlanRule); + + /** BackupDrPlanRule ruleId. */ + public ruleId: string; + + /** BackupDrPlanRule lastSuccessfulBackupTime. */ + public lastSuccessfulBackupTime?: (google.protobuf.ITimestamp|null); + + /** + * Creates a new BackupDrPlanRule instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupDrPlanRule instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupDrPlanRule): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Encodes the specified BackupDrPlanRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @param message BackupDrPlanRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupDrPlanRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupDrPlanRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @param message BackupDrPlanRule message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupDrPlanRule, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Verifies a BackupDrPlanRule message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupDrPlanRule message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupDrPlanRule + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupDrPlanRule; + + /** + * Creates a plain object from a BackupDrPlanRule message. Also converts values to other types if specified. + * @param message BackupDrPlanRule + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupDrPlanRule, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupDrPlanRule to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupDrPlanRule + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + /** Properties of a BackupLocation. */ + interface IBackupLocation { + + /** BackupLocation type */ + type?: (google.cloud.backupdr.v1.BackupLocation.Type|keyof typeof google.cloud.backupdr.v1.BackupLocation.Type|null); + + /** BackupLocation locationId */ + locationId?: (string|null); + } + + /** Represents a BackupLocation. */ + class BackupLocation implements IBackupLocation { + + /** + * Constructs a new BackupLocation. + * @param [properties] Properties to set + */ + constructor(properties?: google.cloud.backupdr.v1.IBackupLocation); + + /** BackupLocation type. */ + public type: (google.cloud.backupdr.v1.BackupLocation.Type|keyof typeof google.cloud.backupdr.v1.BackupLocation.Type); + + /** BackupLocation locationId. */ + public locationId: string; + + /** + * Creates a new BackupLocation instance using the specified properties. + * @param [properties] Properties to set + * @returns BackupLocation instance + */ + public static create(properties?: google.cloud.backupdr.v1.IBackupLocation): google.cloud.backupdr.v1.BackupLocation; + + /** + * Encodes the specified BackupLocation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @param message BackupLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.cloud.backupdr.v1.IBackupLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified BackupLocation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @param message BackupLocation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.cloud.backupdr.v1.IBackupLocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a BackupLocation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.cloud.backupdr.v1.BackupLocation; + + /** + * Decodes a BackupLocation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.cloud.backupdr.v1.BackupLocation; + + /** + * Verifies a BackupLocation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a BackupLocation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns BackupLocation + */ + public static fromObject(object: { [k: string]: any }): google.cloud.backupdr.v1.BackupLocation; + + /** + * Creates a plain object from a BackupLocation message. Also converts values to other types if specified. + * @param message BackupLocation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.cloud.backupdr.v1.BackupLocation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this BackupLocation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + + /** + * Gets the default type url for BackupLocation + * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns The default type url + */ + public static getTypeUrl(typeUrlPrefix?: string): string; + } + + namespace BackupLocation { + + /** Type enum. */ + enum Type { + TYPE_UNSPECIFIED = 0, + ZONAL = 1, + REGIONAL = 2, + MULTI_REGIONAL = 3 + } + } } } } diff --git a/packages/google-cloud-backupdr/protos/protos.js b/packages/google-cloud-backupdr/protos/protos.js index 41d226cbad6..2eab54d52dd 100644 --- a/packages/google-cloud-backupdr/protos/protos.js +++ b/packages/google-cloud-backupdr/protos/protos.js @@ -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. @@ -42945,6 +42945,2900 @@ return FetchDataSourceReferencesForResourceTypeResponse; })(); + v1.BackupDrProtectionSummary = (function() { + + /** + * Constructs a new BackupDrProtectionSummary service. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrProtectionSummary + * @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 BackupDrProtectionSummary(rpcImpl, requestDelimited, responseDelimited) { + $protobuf.rpc.Service.call(this, rpcImpl, requestDelimited, responseDelimited); + } + + (BackupDrProtectionSummary.prototype = Object.create($protobuf.rpc.Service.prototype)).constructor = BackupDrProtectionSummary; + + /** + * Creates new BackupDrProtectionSummary service using the specified rpc implementation. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @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 {BackupDrProtectionSummary} RPC service. Useful where requests and/or responses are streamed. + */ + BackupDrProtectionSummary.create = function create(rpcImpl, requestDelimited, responseDelimited) { + return new this(rpcImpl, requestDelimited, responseDelimited); + }; + + /** + * Callback as used by {@link google.cloud.backupdr.v1.BackupDrProtectionSummary|listResourceBackupConfigs}. + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @typedef ListResourceBackupConfigsCallback + * @type {function} + * @param {Error|null} error Error, if any + * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} [response] ListResourceBackupConfigsResponse + */ + + /** + * Calls ListResourceBackupConfigs. + * @function listResourceBackupConfigs + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @instance + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} request ListResourceBackupConfigsRequest message or plain object + * @param {google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigsCallback} callback Node-style callback called with the error, if any, and ListResourceBackupConfigsResponse + * @returns {undefined} + * @variation 1 + */ + Object.defineProperty(BackupDrProtectionSummary.prototype.listResourceBackupConfigs = function listResourceBackupConfigs(request, callback) { + return this.rpcCall(listResourceBackupConfigs, $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest, $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse, request, callback); + }, "name", { value: "ListResourceBackupConfigs" }); + + /** + * Calls ListResourceBackupConfigs. + * @function listResourceBackupConfigs + * @memberof google.cloud.backupdr.v1.BackupDrProtectionSummary + * @instance + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} request ListResourceBackupConfigsRequest message or plain object + * @returns {Promise} Promise + * @variation 2 + */ + + return BackupDrProtectionSummary; + })(); + + v1.ListResourceBackupConfigsRequest = (function() { + + /** + * Properties of a ListResourceBackupConfigsRequest. + * @memberof google.cloud.backupdr.v1 + * @interface IListResourceBackupConfigsRequest + * @property {string|null} [parent] ListResourceBackupConfigsRequest parent + * @property {number|null} [pageSize] ListResourceBackupConfigsRequest pageSize + * @property {string|null} [pageToken] ListResourceBackupConfigsRequest pageToken + * @property {string|null} [filter] ListResourceBackupConfigsRequest filter + * @property {string|null} [orderBy] ListResourceBackupConfigsRequest orderBy + */ + + /** + * Constructs a new ListResourceBackupConfigsRequest. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListResourceBackupConfigsRequest. + * @implements IListResourceBackupConfigsRequest + * @constructor + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest=} [properties] Properties to set + */ + function ListResourceBackupConfigsRequest(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceBackupConfigsRequest parent. + * @member {string} parent + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.parent = ""; + + /** + * ListResourceBackupConfigsRequest pageSize. + * @member {number} pageSize + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.pageSize = 0; + + /** + * ListResourceBackupConfigsRequest pageToken. + * @member {string} pageToken + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.pageToken = ""; + + /** + * ListResourceBackupConfigsRequest filter. + * @member {string} filter + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.filter = ""; + + /** + * ListResourceBackupConfigsRequest orderBy. + * @member {string} orderBy + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + */ + ListResourceBackupConfigsRequest.prototype.orderBy = ""; + + /** + * Creates a new ListResourceBackupConfigsRequest instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest instance + */ + ListResourceBackupConfigsRequest.create = function create(properties) { + return new ListResourceBackupConfigsRequest(properties); + }; + + /** + * Encodes the specified ListResourceBackupConfigsRequest message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsRequest.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsRequest.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceBackupConfigsRequest message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsRequest.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest(); + 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 ListResourceBackupConfigsRequest message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsRequest.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceBackupConfigsRequest message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} ListResourceBackupConfigsRequest + */ + ListResourceBackupConfigsRequest.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest) + return object; + var message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsRequest(); + 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 ListResourceBackupConfigsRequest message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsRequest} message ListResourceBackupConfigsRequest + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceBackupConfigsRequest.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 ListResourceBackupConfigsRequest to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @instance + * @returns {Object.} JSON object + */ + ListResourceBackupConfigsRequest.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceBackupConfigsRequest + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsRequest + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceBackupConfigsRequest.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListResourceBackupConfigsRequest"; + }; + + return ListResourceBackupConfigsRequest; + })(); + + v1.ListResourceBackupConfigsResponse = (function() { + + /** + * Properties of a ListResourceBackupConfigsResponse. + * @memberof google.cloud.backupdr.v1 + * @interface IListResourceBackupConfigsResponse + * @property {Array.|null} [resourceBackupConfigs] ListResourceBackupConfigsResponse resourceBackupConfigs + * @property {string|null} [nextPageToken] ListResourceBackupConfigsResponse nextPageToken + */ + + /** + * Constructs a new ListResourceBackupConfigsResponse. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ListResourceBackupConfigsResponse. + * @implements IListResourceBackupConfigsResponse + * @constructor + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse=} [properties] Properties to set + */ + function ListResourceBackupConfigsResponse(properties) { + this.resourceBackupConfigs = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ListResourceBackupConfigsResponse resourceBackupConfigs. + * @member {Array.} resourceBackupConfigs + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @instance + */ + ListResourceBackupConfigsResponse.prototype.resourceBackupConfigs = $util.emptyArray; + + /** + * ListResourceBackupConfigsResponse nextPageToken. + * @member {string} nextPageToken + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @instance + */ + ListResourceBackupConfigsResponse.prototype.nextPageToken = ""; + + /** + * Creates a new ListResourceBackupConfigsResponse instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse instance + */ + ListResourceBackupConfigsResponse.create = function create(properties) { + return new ListResourceBackupConfigsResponse(properties); + }; + + /** + * Encodes the specified ListResourceBackupConfigsResponse message. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsResponse.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.resourceBackupConfigs != null && message.resourceBackupConfigs.length) + for (var i = 0; i < message.resourceBackupConfigs.length; ++i) + $root.google.cloud.backupdr.v1.ResourceBackupConfig.encode(message.resourceBackupConfigs[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 ListResourceBackupConfigsResponse message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.IListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ListResourceBackupConfigsResponse.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsResponse.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.resourceBackupConfigs && message.resourceBackupConfigs.length)) + message.resourceBackupConfigs = []; + message.resourceBackupConfigs.push($root.google.cloud.backupdr.v1.ResourceBackupConfig.decode(reader, reader.uint32())); + break; + } + case 2: { + message.nextPageToken = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ListResourceBackupConfigsResponse message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ListResourceBackupConfigsResponse.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ListResourceBackupConfigsResponse message. + * @function verify + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ListResourceBackupConfigsResponse.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.resourceBackupConfigs != null && message.hasOwnProperty("resourceBackupConfigs")) { + if (!Array.isArray(message.resourceBackupConfigs)) + return "resourceBackupConfigs: array expected"; + for (var i = 0; i < message.resourceBackupConfigs.length; ++i) { + var error = $root.google.cloud.backupdr.v1.ResourceBackupConfig.verify(message.resourceBackupConfigs[i]); + if (error) + return "resourceBackupConfigs." + error; + } + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + if (!$util.isString(message.nextPageToken)) + return "nextPageToken: string expected"; + return null; + }; + + /** + * Creates a ListResourceBackupConfigsResponse message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} ListResourceBackupConfigsResponse + */ + ListResourceBackupConfigsResponse.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse) + return object; + var message = new $root.google.cloud.backupdr.v1.ListResourceBackupConfigsResponse(); + if (object.resourceBackupConfigs) { + if (!Array.isArray(object.resourceBackupConfigs)) + throw TypeError(".google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.resourceBackupConfigs: array expected"); + message.resourceBackupConfigs = []; + for (var i = 0; i < object.resourceBackupConfigs.length; ++i) { + if (typeof object.resourceBackupConfigs[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ListResourceBackupConfigsResponse.resourceBackupConfigs: object expected"); + message.resourceBackupConfigs[i] = $root.google.cloud.backupdr.v1.ResourceBackupConfig.fromObject(object.resourceBackupConfigs[i]); + } + } + if (object.nextPageToken != null) + message.nextPageToken = String(object.nextPageToken); + return message; + }; + + /** + * Creates a plain object from a ListResourceBackupConfigsResponse message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {google.cloud.backupdr.v1.ListResourceBackupConfigsResponse} message ListResourceBackupConfigsResponse + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ListResourceBackupConfigsResponse.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.resourceBackupConfigs = []; + if (options.defaults) + object.nextPageToken = ""; + if (message.resourceBackupConfigs && message.resourceBackupConfigs.length) { + object.resourceBackupConfigs = []; + for (var j = 0; j < message.resourceBackupConfigs.length; ++j) + object.resourceBackupConfigs[j] = $root.google.cloud.backupdr.v1.ResourceBackupConfig.toObject(message.resourceBackupConfigs[j], options); + } + if (message.nextPageToken != null && message.hasOwnProperty("nextPageToken")) + object.nextPageToken = message.nextPageToken; + return object; + }; + + /** + * Converts this ListResourceBackupConfigsResponse to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @instance + * @returns {Object.} JSON object + */ + ListResourceBackupConfigsResponse.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ListResourceBackupConfigsResponse + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ListResourceBackupConfigsResponse + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ListResourceBackupConfigsResponse.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ListResourceBackupConfigsResponse"; + }; + + return ListResourceBackupConfigsResponse; + })(); + + v1.ResourceBackupConfig = (function() { + + /** + * Properties of a ResourceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IResourceBackupConfig + * @property {string|null} [name] ResourceBackupConfig name + * @property {string|null} [uid] ResourceBackupConfig uid + * @property {string|null} [targetResource] ResourceBackupConfig targetResource + * @property {string|null} [targetResourceDisplayName] ResourceBackupConfig targetResourceDisplayName + * @property {google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType|null} [targetResourceType] ResourceBackupConfig targetResourceType + * @property {Object.|null} [targetResourceLabels] ResourceBackupConfig targetResourceLabels + * @property {Array.|null} [backupConfigsDetails] ResourceBackupConfig backupConfigsDetails + * @property {boolean|null} [backupConfigured] ResourceBackupConfig backupConfigured + * @property {boolean|null} [vaulted] ResourceBackupConfig vaulted + */ + + /** + * Constructs a new ResourceBackupConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a ResourceBackupConfig. + * @implements IResourceBackupConfig + * @constructor + * @param {google.cloud.backupdr.v1.IResourceBackupConfig=} [properties] Properties to set + */ + function ResourceBackupConfig(properties) { + this.targetResourceLabels = {}; + this.backupConfigsDetails = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * ResourceBackupConfig name. + * @member {string} name + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.name = ""; + + /** + * ResourceBackupConfig uid. + * @member {string} uid + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.uid = ""; + + /** + * ResourceBackupConfig targetResource. + * @member {string} targetResource + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResource = ""; + + /** + * ResourceBackupConfig targetResourceDisplayName. + * @member {string} targetResourceDisplayName + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResourceDisplayName = ""; + + /** + * ResourceBackupConfig targetResourceType. + * @member {google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType} targetResourceType + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResourceType = 0; + + /** + * ResourceBackupConfig targetResourceLabels. + * @member {Object.} targetResourceLabels + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.targetResourceLabels = $util.emptyObject; + + /** + * ResourceBackupConfig backupConfigsDetails. + * @member {Array.} backupConfigsDetails + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.backupConfigsDetails = $util.emptyArray; + + /** + * ResourceBackupConfig backupConfigured. + * @member {boolean} backupConfigured + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.backupConfigured = false; + + /** + * ResourceBackupConfig vaulted. + * @member {boolean} vaulted + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + */ + ResourceBackupConfig.prototype.vaulted = false; + + /** + * Creates a new ResourceBackupConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IResourceBackupConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig instance + */ + ResourceBackupConfig.create = function create(properties) { + return new ResourceBackupConfig(properties); + }; + + /** + * Encodes the specified ResourceBackupConfig message. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IResourceBackupConfig} message ResourceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceBackupConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.uid != null && Object.hasOwnProperty.call(message, "uid")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.uid); + if (message.targetResource != null && Object.hasOwnProperty.call(message, "targetResource")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.targetResource); + if (message.targetResourceDisplayName != null && Object.hasOwnProperty.call(message, "targetResourceDisplayName")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.targetResourceDisplayName); + if (message.targetResourceType != null && Object.hasOwnProperty.call(message, "targetResourceType")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.targetResourceType); + if (message.targetResourceLabels != null && Object.hasOwnProperty.call(message, "targetResourceLabels")) + for (var keys = Object.keys(message.targetResourceLabels), 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.targetResourceLabels[keys[i]]).ldelim(); + if (message.backupConfigsDetails != null && message.backupConfigsDetails.length) + for (var i = 0; i < message.backupConfigsDetails.length; ++i) + $root.google.cloud.backupdr.v1.BackupConfigDetails.encode(message.backupConfigsDetails[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.backupConfigured != null && Object.hasOwnProperty.call(message, "backupConfigured")) + writer.uint32(/* id 8, wireType 0 =*/64).bool(message.backupConfigured); + if (message.vaulted != null && Object.hasOwnProperty.call(message, "vaulted")) + writer.uint32(/* id 9, wireType 0 =*/72).bool(message.vaulted); + return writer; + }; + + /** + * Encodes the specified ResourceBackupConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.ResourceBackupConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.IResourceBackupConfig} message ResourceBackupConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ResourceBackupConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceBackupConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.ResourceBackupConfig(), key, value; + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.name = reader.string(); + break; + } + case 2: { + message.uid = reader.string(); + break; + } + case 3: { + message.targetResource = reader.string(); + break; + } + case 4: { + message.targetResourceDisplayName = reader.string(); + break; + } + case 5: { + message.targetResourceType = reader.int32(); + break; + } + case 6: { + if (message.targetResourceLabels === $util.emptyObject) + message.targetResourceLabels = {}; + var end2 = reader.uint32() + reader.pos; + key = ""; + value = ""; + while (reader.pos < end2) { + var tag2 = reader.uint32(); + switch (tag2 >>> 3) { + case 1: + key = reader.string(); + break; + case 2: + value = reader.string(); + break; + default: + reader.skipType(tag2 & 7); + break; + } + } + message.targetResourceLabels[key] = value; + break; + } + case 7: { + if (!(message.backupConfigsDetails && message.backupConfigsDetails.length)) + message.backupConfigsDetails = []; + message.backupConfigsDetails.push($root.google.cloud.backupdr.v1.BackupConfigDetails.decode(reader, reader.uint32())); + break; + } + case 8: { + message.backupConfigured = reader.bool(); + break; + } + case 9: { + message.vaulted = reader.bool(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ResourceBackupConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ResourceBackupConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ResourceBackupConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ResourceBackupConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.uid != null && message.hasOwnProperty("uid")) + if (!$util.isString(message.uid)) + return "uid: string expected"; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + if (!$util.isString(message.targetResource)) + return "targetResource: string expected"; + if (message.targetResourceDisplayName != null && message.hasOwnProperty("targetResourceDisplayName")) + if (!$util.isString(message.targetResourceDisplayName)) + return "targetResourceDisplayName: string expected"; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + switch (message.targetResourceType) { + default: + return "targetResourceType: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + if (message.targetResourceLabels != null && message.hasOwnProperty("targetResourceLabels")) { + if (!$util.isObject(message.targetResourceLabels)) + return "targetResourceLabels: object expected"; + var key = Object.keys(message.targetResourceLabels); + for (var i = 0; i < key.length; ++i) + if (!$util.isString(message.targetResourceLabels[key[i]])) + return "targetResourceLabels: string{k:string} expected"; + } + if (message.backupConfigsDetails != null && message.hasOwnProperty("backupConfigsDetails")) { + if (!Array.isArray(message.backupConfigsDetails)) + return "backupConfigsDetails: array expected"; + for (var i = 0; i < message.backupConfigsDetails.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupConfigDetails.verify(message.backupConfigsDetails[i]); + if (error) + return "backupConfigsDetails." + error; + } + } + if (message.backupConfigured != null && message.hasOwnProperty("backupConfigured")) + if (typeof message.backupConfigured !== "boolean") + return "backupConfigured: boolean expected"; + if (message.vaulted != null && message.hasOwnProperty("vaulted")) + if (typeof message.vaulted !== "boolean") + return "vaulted: boolean expected"; + return null; + }; + + /** + * Creates a ResourceBackupConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.ResourceBackupConfig} ResourceBackupConfig + */ + ResourceBackupConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.ResourceBackupConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.ResourceBackupConfig(); + if (object.name != null) + message.name = String(object.name); + if (object.uid != null) + message.uid = String(object.uid); + if (object.targetResource != null) + message.targetResource = String(object.targetResource); + if (object.targetResourceDisplayName != null) + message.targetResourceDisplayName = String(object.targetResourceDisplayName); + switch (object.targetResourceType) { + default: + if (typeof object.targetResourceType === "number") { + message.targetResourceType = object.targetResourceType; + break; + } + break; + case "RESOURCE_TYPE_UNSPECIFIED": + case 0: + message.targetResourceType = 0; + break; + case "CLOUD_SQL_INSTANCE": + case 1: + message.targetResourceType = 1; + break; + case "COMPUTE_ENGINE_VM": + case 2: + message.targetResourceType = 2; + break; + case "COMPUTE_ENGINE_DISK": + case 3: + message.targetResourceType = 3; + break; + case "COMPUTE_ENGINE_REGIONAL_DISK": + case 4: + message.targetResourceType = 4; + break; + } + if (object.targetResourceLabels) { + if (typeof object.targetResourceLabels !== "object") + throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.targetResourceLabels: object expected"); + message.targetResourceLabels = {}; + for (var keys = Object.keys(object.targetResourceLabels), i = 0; i < keys.length; ++i) + message.targetResourceLabels[keys[i]] = String(object.targetResourceLabels[keys[i]]); + } + if (object.backupConfigsDetails) { + if (!Array.isArray(object.backupConfigsDetails)) + throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.backupConfigsDetails: array expected"); + message.backupConfigsDetails = []; + for (var i = 0; i < object.backupConfigsDetails.length; ++i) { + if (typeof object.backupConfigsDetails[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.ResourceBackupConfig.backupConfigsDetails: object expected"); + message.backupConfigsDetails[i] = $root.google.cloud.backupdr.v1.BackupConfigDetails.fromObject(object.backupConfigsDetails[i]); + } + } + if (object.backupConfigured != null) + message.backupConfigured = Boolean(object.backupConfigured); + if (object.vaulted != null) + message.vaulted = Boolean(object.vaulted); + return message; + }; + + /** + * Creates a plain object from a ResourceBackupConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {google.cloud.backupdr.v1.ResourceBackupConfig} message ResourceBackupConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ResourceBackupConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupConfigsDetails = []; + if (options.objects || options.defaults) + object.targetResourceLabels = {}; + if (options.defaults) { + object.name = ""; + object.uid = ""; + object.targetResource = ""; + object.targetResourceDisplayName = ""; + object.targetResourceType = options.enums === String ? "RESOURCE_TYPE_UNSPECIFIED" : 0; + object.backupConfigured = false; + object.vaulted = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.uid != null && message.hasOwnProperty("uid")) + object.uid = message.uid; + if (message.targetResource != null && message.hasOwnProperty("targetResource")) + object.targetResource = message.targetResource; + if (message.targetResourceDisplayName != null && message.hasOwnProperty("targetResourceDisplayName")) + object.targetResourceDisplayName = message.targetResourceDisplayName; + if (message.targetResourceType != null && message.hasOwnProperty("targetResourceType")) + object.targetResourceType = options.enums === String ? $root.google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType[message.targetResourceType] === undefined ? message.targetResourceType : $root.google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType[message.targetResourceType] : message.targetResourceType; + var keys2; + if (message.targetResourceLabels && (keys2 = Object.keys(message.targetResourceLabels)).length) { + object.targetResourceLabels = {}; + for (var j = 0; j < keys2.length; ++j) + object.targetResourceLabels[keys2[j]] = message.targetResourceLabels[keys2[j]]; + } + if (message.backupConfigsDetails && message.backupConfigsDetails.length) { + object.backupConfigsDetails = []; + for (var j = 0; j < message.backupConfigsDetails.length; ++j) + object.backupConfigsDetails[j] = $root.google.cloud.backupdr.v1.BackupConfigDetails.toObject(message.backupConfigsDetails[j], options); + } + if (message.backupConfigured != null && message.hasOwnProperty("backupConfigured")) + object.backupConfigured = message.backupConfigured; + if (message.vaulted != null && message.hasOwnProperty("vaulted")) + object.vaulted = message.vaulted; + return object; + }; + + /** + * Converts this ResourceBackupConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @instance + * @returns {Object.} JSON object + */ + ResourceBackupConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for ResourceBackupConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.ResourceBackupConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + ResourceBackupConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.ResourceBackupConfig"; + }; + + /** + * ResourceType enum. + * @name google.cloud.backupdr.v1.ResourceBackupConfig.ResourceType + * @enum {number} + * @property {number} RESOURCE_TYPE_UNSPECIFIED=0 RESOURCE_TYPE_UNSPECIFIED value + * @property {number} CLOUD_SQL_INSTANCE=1 CLOUD_SQL_INSTANCE value + * @property {number} COMPUTE_ENGINE_VM=2 COMPUTE_ENGINE_VM value + * @property {number} COMPUTE_ENGINE_DISK=3 COMPUTE_ENGINE_DISK value + * @property {number} COMPUTE_ENGINE_REGIONAL_DISK=4 COMPUTE_ENGINE_REGIONAL_DISK value + */ + ResourceBackupConfig.ResourceType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "RESOURCE_TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_SQL_INSTANCE"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_VM"] = 2; + values[valuesById[3] = "COMPUTE_ENGINE_DISK"] = 3; + values[valuesById[4] = "COMPUTE_ENGINE_REGIONAL_DISK"] = 4; + return values; + })(); + + return ResourceBackupConfig; + })(); + + v1.BackupConfigDetails = (function() { + + /** + * Properties of a BackupConfigDetails. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupConfigDetails + * @property {string|null} [backupConfigSource] BackupConfigDetails backupConfigSource + * @property {string|null} [backupConfigSourceDisplayName] BackupConfigDetails backupConfigSourceDisplayName + * @property {google.cloud.backupdr.v1.BackupConfigDetails.Type|null} [type] BackupConfigDetails type + * @property {google.cloud.backupdr.v1.BackupConfigDetails.State|null} [state] BackupConfigDetails state + * @property {google.cloud.backupdr.v1.IPitrSettings|null} [pitrSettings] BackupConfigDetails pitrSettings + * @property {google.protobuf.ITimestamp|null} [latestSuccessfulBackupTime] BackupConfigDetails latestSuccessfulBackupTime + * @property {string|null} [applicableResource] BackupConfigDetails applicableResource + * @property {string|null} [backupVault] BackupConfigDetails backupVault + * @property {Array.|null} [backupLocations] BackupConfigDetails backupLocations + * @property {google.cloud.backupdr.v1.IBackupDrPlanConfig|null} [backupDrPlanConfig] BackupConfigDetails backupDrPlanConfig + * @property {google.cloud.backupdr.v1.IBackupDrTemplateConfig|null} [backupDrTemplateConfig] BackupConfigDetails backupDrTemplateConfig + */ + + /** + * Constructs a new BackupConfigDetails. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupConfigDetails. + * @implements IBackupConfigDetails + * @constructor + * @param {google.cloud.backupdr.v1.IBackupConfigDetails=} [properties] Properties to set + */ + function BackupConfigDetails(properties) { + this.backupLocations = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupConfigDetails backupConfigSource. + * @member {string} backupConfigSource + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupConfigSource = ""; + + /** + * BackupConfigDetails backupConfigSourceDisplayName. + * @member {string} backupConfigSourceDisplayName + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupConfigSourceDisplayName = ""; + + /** + * BackupConfigDetails type. + * @member {google.cloud.backupdr.v1.BackupConfigDetails.Type} type + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.type = 0; + + /** + * BackupConfigDetails state. + * @member {google.cloud.backupdr.v1.BackupConfigDetails.State} state + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.state = 0; + + /** + * BackupConfigDetails pitrSettings. + * @member {google.cloud.backupdr.v1.IPitrSettings|null|undefined} pitrSettings + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.pitrSettings = null; + + /** + * BackupConfigDetails latestSuccessfulBackupTime. + * @member {google.protobuf.ITimestamp|null|undefined} latestSuccessfulBackupTime + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.latestSuccessfulBackupTime = null; + + /** + * BackupConfigDetails applicableResource. + * @member {string} applicableResource + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.applicableResource = ""; + + /** + * BackupConfigDetails backupVault. + * @member {string} backupVault + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupVault = ""; + + /** + * BackupConfigDetails backupLocations. + * @member {Array.} backupLocations + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupLocations = $util.emptyArray; + + /** + * BackupConfigDetails backupDrPlanConfig. + * @member {google.cloud.backupdr.v1.IBackupDrPlanConfig|null|undefined} backupDrPlanConfig + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupDrPlanConfig = null; + + /** + * BackupConfigDetails backupDrTemplateConfig. + * @member {google.cloud.backupdr.v1.IBackupDrTemplateConfig|null|undefined} backupDrTemplateConfig + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + BackupConfigDetails.prototype.backupDrTemplateConfig = null; + + // OneOf field names bound to virtual getters and setters + var $oneOfFields; + + /** + * BackupConfigDetails planSpecificConfig. + * @member {"backupDrPlanConfig"|"backupDrTemplateConfig"|undefined} planSpecificConfig + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + */ + Object.defineProperty(BackupConfigDetails.prototype, "planSpecificConfig", { + get: $util.oneOfGetter($oneOfFields = ["backupDrPlanConfig", "backupDrTemplateConfig"]), + set: $util.oneOfSetter($oneOfFields) + }); + + /** + * Creates a new BackupConfigDetails instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigDetails=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails instance + */ + BackupConfigDetails.create = function create(properties) { + return new BackupConfigDetails(properties); + }; + + /** + * Encodes the specified BackupConfigDetails message. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigDetails} message BackupConfigDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigDetails.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupConfigSource != null && Object.hasOwnProperty.call(message, "backupConfigSource")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.backupConfigSource); + if (message.backupConfigSourceDisplayName != null && Object.hasOwnProperty.call(message, "backupConfigSourceDisplayName")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.backupConfigSourceDisplayName); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.type); + if (message.state != null && Object.hasOwnProperty.call(message, "state")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.state); + if (message.pitrSettings != null && Object.hasOwnProperty.call(message, "pitrSettings")) + $root.google.cloud.backupdr.v1.PitrSettings.encode(message.pitrSettings, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.latestSuccessfulBackupTime != null && Object.hasOwnProperty.call(message, "latestSuccessfulBackupTime")) + $root.google.protobuf.Timestamp.encode(message.latestSuccessfulBackupTime, writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.applicableResource != null && Object.hasOwnProperty.call(message, "applicableResource")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.applicableResource); + if (message.backupVault != null && Object.hasOwnProperty.call(message, "backupVault")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.backupVault); + if (message.backupDrPlanConfig != null && Object.hasOwnProperty.call(message, "backupDrPlanConfig")) + $root.google.cloud.backupdr.v1.BackupDrPlanConfig.encode(message.backupDrPlanConfig, writer.uint32(/* id 10, wireType 2 =*/82).fork()).ldelim(); + if (message.backupDrTemplateConfig != null && Object.hasOwnProperty.call(message, "backupDrTemplateConfig")) + $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.encode(message.backupDrTemplateConfig, writer.uint32(/* id 11, wireType 2 =*/90).fork()).ldelim(); + if (message.backupLocations != null && message.backupLocations.length) + for (var i = 0; i < message.backupLocations.length; ++i) + $root.google.cloud.backupdr.v1.BackupLocation.encode(message.backupLocations[i], writer.uint32(/* id 12, wireType 2 =*/98).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupConfigDetails message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupConfigDetails.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.IBackupConfigDetails} message BackupConfigDetails message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupConfigDetails.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigDetails.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupConfigDetails(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.backupConfigSource = reader.string(); + break; + } + case 2: { + message.backupConfigSourceDisplayName = reader.string(); + break; + } + case 3: { + message.type = reader.int32(); + break; + } + case 4: { + message.state = reader.int32(); + break; + } + case 5: { + message.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.decode(reader, reader.uint32()); + break; + } + case 6: { + message.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + case 7: { + message.applicableResource = reader.string(); + break; + } + case 8: { + message.backupVault = reader.string(); + break; + } + case 12: { + if (!(message.backupLocations && message.backupLocations.length)) + message.backupLocations = []; + message.backupLocations.push($root.google.cloud.backupdr.v1.BackupLocation.decode(reader, reader.uint32())); + break; + } + case 10: { + message.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.decode(reader, reader.uint32()); + break; + } + case 11: { + message.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupConfigDetails message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupConfigDetails.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupConfigDetails message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupConfigDetails.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + var properties = {}; + if (message.backupConfigSource != null && message.hasOwnProperty("backupConfigSource")) + if (!$util.isString(message.backupConfigSource)) + return "backupConfigSource: string expected"; + if (message.backupConfigSourceDisplayName != null && message.hasOwnProperty("backupConfigSourceDisplayName")) + if (!$util.isString(message.backupConfigSourceDisplayName)) + return "backupConfigSourceDisplayName: string expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + case 4: + break; + } + 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.pitrSettings != null && message.hasOwnProperty("pitrSettings")) { + var error = $root.google.cloud.backupdr.v1.PitrSettings.verify(message.pitrSettings); + if (error) + return "pitrSettings." + error; + } + if (message.latestSuccessfulBackupTime != null && message.hasOwnProperty("latestSuccessfulBackupTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.latestSuccessfulBackupTime); + if (error) + return "latestSuccessfulBackupTime." + error; + } + if (message.applicableResource != null && message.hasOwnProperty("applicableResource")) + if (!$util.isString(message.applicableResource)) + return "applicableResource: string expected"; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + if (!$util.isString(message.backupVault)) + return "backupVault: string expected"; + if (message.backupLocations != null && message.hasOwnProperty("backupLocations")) { + if (!Array.isArray(message.backupLocations)) + return "backupLocations: array expected"; + for (var i = 0; i < message.backupLocations.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupLocation.verify(message.backupLocations[i]); + if (error) + return "backupLocations." + error; + } + } + if (message.backupDrPlanConfig != null && message.hasOwnProperty("backupDrPlanConfig")) { + properties.planSpecificConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.verify(message.backupDrPlanConfig); + if (error) + return "backupDrPlanConfig." + error; + } + } + if (message.backupDrTemplateConfig != null && message.hasOwnProperty("backupDrTemplateConfig")) { + if (properties.planSpecificConfig === 1) + return "planSpecificConfig: multiple values"; + properties.planSpecificConfig = 1; + { + var error = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.verify(message.backupDrTemplateConfig); + if (error) + return "backupDrTemplateConfig." + error; + } + } + return null; + }; + + /** + * Creates a BackupConfigDetails message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupConfigDetails} BackupConfigDetails + */ + BackupConfigDetails.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupConfigDetails) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupConfigDetails(); + if (object.backupConfigSource != null) + message.backupConfigSource = String(object.backupConfigSource); + if (object.backupConfigSourceDisplayName != null) + message.backupConfigSourceDisplayName = String(object.backupConfigSourceDisplayName); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "CLOUD_SQL_INSTANCE_BACKUP_CONFIG": + case 1: + message.type = 1; + break; + case "COMPUTE_ENGINE_RESOURCE_POLICY": + case 2: + message.type = 2; + break; + case "BACKUPDR_BACKUP_PLAN": + case 3: + message.type = 3; + break; + case "BACKUPDR_TEMPLATE": + case 4: + message.type = 4; + break; + } + 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 "ACTIVE": + case 1: + message.state = 1; + break; + case "INACTIVE": + case 2: + message.state = 2; + break; + case "ERROR": + case 3: + message.state = 3; + break; + } + if (object.pitrSettings != null) { + if (typeof object.pitrSettings !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.pitrSettings: object expected"); + message.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.fromObject(object.pitrSettings); + } + if (object.latestSuccessfulBackupTime != null) { + if (typeof object.latestSuccessfulBackupTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.latestSuccessfulBackupTime: object expected"); + message.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.fromObject(object.latestSuccessfulBackupTime); + } + if (object.applicableResource != null) + message.applicableResource = String(object.applicableResource); + if (object.backupVault != null) + message.backupVault = String(object.backupVault); + if (object.backupLocations) { + if (!Array.isArray(object.backupLocations)) + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupLocations: array expected"); + message.backupLocations = []; + for (var i = 0; i < object.backupLocations.length; ++i) { + if (typeof object.backupLocations[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupLocations: object expected"); + message.backupLocations[i] = $root.google.cloud.backupdr.v1.BackupLocation.fromObject(object.backupLocations[i]); + } + } + if (object.backupDrPlanConfig != null) { + if (typeof object.backupDrPlanConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupDrPlanConfig: object expected"); + message.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.fromObject(object.backupDrPlanConfig); + } + if (object.backupDrTemplateConfig != null) { + if (typeof object.backupDrTemplateConfig !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupConfigDetails.backupDrTemplateConfig: object expected"); + message.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.fromObject(object.backupDrTemplateConfig); + } + return message; + }; + + /** + * Creates a plain object from a BackupConfigDetails message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {google.cloud.backupdr.v1.BackupConfigDetails} message BackupConfigDetails + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupConfigDetails.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupLocations = []; + if (options.defaults) { + object.backupConfigSource = ""; + object.backupConfigSourceDisplayName = ""; + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.state = options.enums === String ? "STATE_UNSPECIFIED" : 0; + object.pitrSettings = null; + object.latestSuccessfulBackupTime = null; + object.applicableResource = ""; + object.backupVault = ""; + } + if (message.backupConfigSource != null && message.hasOwnProperty("backupConfigSource")) + object.backupConfigSource = message.backupConfigSource; + if (message.backupConfigSourceDisplayName != null && message.hasOwnProperty("backupConfigSourceDisplayName")) + object.backupConfigSourceDisplayName = message.backupConfigSourceDisplayName; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigDetails.Type[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.BackupConfigDetails.Type[message.type] : message.type; + if (message.state != null && message.hasOwnProperty("state")) + object.state = options.enums === String ? $root.google.cloud.backupdr.v1.BackupConfigDetails.State[message.state] === undefined ? message.state : $root.google.cloud.backupdr.v1.BackupConfigDetails.State[message.state] : message.state; + if (message.pitrSettings != null && message.hasOwnProperty("pitrSettings")) + object.pitrSettings = $root.google.cloud.backupdr.v1.PitrSettings.toObject(message.pitrSettings, options); + if (message.latestSuccessfulBackupTime != null && message.hasOwnProperty("latestSuccessfulBackupTime")) + object.latestSuccessfulBackupTime = $root.google.protobuf.Timestamp.toObject(message.latestSuccessfulBackupTime, options); + if (message.applicableResource != null && message.hasOwnProperty("applicableResource")) + object.applicableResource = message.applicableResource; + if (message.backupVault != null && message.hasOwnProperty("backupVault")) + object.backupVault = message.backupVault; + if (message.backupDrPlanConfig != null && message.hasOwnProperty("backupDrPlanConfig")) { + object.backupDrPlanConfig = $root.google.cloud.backupdr.v1.BackupDrPlanConfig.toObject(message.backupDrPlanConfig, options); + if (options.oneofs) + object.planSpecificConfig = "backupDrPlanConfig"; + } + if (message.backupDrTemplateConfig != null && message.hasOwnProperty("backupDrTemplateConfig")) { + object.backupDrTemplateConfig = $root.google.cloud.backupdr.v1.BackupDrTemplateConfig.toObject(message.backupDrTemplateConfig, options); + if (options.oneofs) + object.planSpecificConfig = "backupDrTemplateConfig"; + } + if (message.backupLocations && message.backupLocations.length) { + object.backupLocations = []; + for (var j = 0; j < message.backupLocations.length; ++j) + object.backupLocations[j] = $root.google.cloud.backupdr.v1.BackupLocation.toObject(message.backupLocations[j], options); + } + return object; + }; + + /** + * Converts this BackupConfigDetails to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @instance + * @returns {Object.} JSON object + */ + BackupConfigDetails.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupConfigDetails + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupConfigDetails + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupConfigDetails.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupConfigDetails"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.BackupConfigDetails.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} CLOUD_SQL_INSTANCE_BACKUP_CONFIG=1 CLOUD_SQL_INSTANCE_BACKUP_CONFIG value + * @property {number} COMPUTE_ENGINE_RESOURCE_POLICY=2 COMPUTE_ENGINE_RESOURCE_POLICY value + * @property {number} BACKUPDR_BACKUP_PLAN=3 BACKUPDR_BACKUP_PLAN value + * @property {number} BACKUPDR_TEMPLATE=4 BACKUPDR_TEMPLATE value + */ + BackupConfigDetails.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "CLOUD_SQL_INSTANCE_BACKUP_CONFIG"] = 1; + values[valuesById[2] = "COMPUTE_ENGINE_RESOURCE_POLICY"] = 2; + values[valuesById[3] = "BACKUPDR_BACKUP_PLAN"] = 3; + values[valuesById[4] = "BACKUPDR_TEMPLATE"] = 4; + return values; + })(); + + /** + * State enum. + * @name google.cloud.backupdr.v1.BackupConfigDetails.State + * @enum {number} + * @property {number} STATE_UNSPECIFIED=0 STATE_UNSPECIFIED value + * @property {number} ACTIVE=1 ACTIVE value + * @property {number} INACTIVE=2 INACTIVE value + * @property {number} ERROR=3 ERROR value + */ + BackupConfigDetails.State = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STATE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ACTIVE"] = 1; + values[valuesById[2] = "INACTIVE"] = 2; + values[valuesById[3] = "ERROR"] = 3; + return values; + })(); + + return BackupConfigDetails; + })(); + + v1.PitrSettings = (function() { + + /** + * Properties of a PitrSettings. + * @memberof google.cloud.backupdr.v1 + * @interface IPitrSettings + * @property {number|null} [retentionDays] PitrSettings retentionDays + */ + + /** + * Constructs a new PitrSettings. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a PitrSettings. + * @implements IPitrSettings + * @constructor + * @param {google.cloud.backupdr.v1.IPitrSettings=} [properties] Properties to set + */ + function PitrSettings(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * PitrSettings retentionDays. + * @member {number} retentionDays + * @memberof google.cloud.backupdr.v1.PitrSettings + * @instance + */ + PitrSettings.prototype.retentionDays = 0; + + /** + * Creates a new PitrSettings instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.IPitrSettings=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings instance + */ + PitrSettings.create = function create(properties) { + return new PitrSettings(properties); + }; + + /** + * Encodes the specified PitrSettings message. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.IPitrSettings} message PitrSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PitrSettings.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.retentionDays != null && Object.hasOwnProperty.call(message, "retentionDays")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.retentionDays); + return writer; + }; + + /** + * Encodes the specified PitrSettings message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.PitrSettings.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.IPitrSettings} message PitrSettings message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PitrSettings.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PitrSettings message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PitrSettings.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.PitrSettings(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.retentionDays = reader.int32(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PitrSettings message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PitrSettings.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PitrSettings message. + * @function verify + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PitrSettings.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) + if (!$util.isInteger(message.retentionDays)) + return "retentionDays: integer expected"; + return null; + }; + + /** + * Creates a PitrSettings message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.PitrSettings} PitrSettings + */ + PitrSettings.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.PitrSettings) + return object; + var message = new $root.google.cloud.backupdr.v1.PitrSettings(); + if (object.retentionDays != null) + message.retentionDays = object.retentionDays | 0; + return message; + }; + + /** + * Creates a plain object from a PitrSettings message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {google.cloud.backupdr.v1.PitrSettings} message PitrSettings + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PitrSettings.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) + object.retentionDays = 0; + if (message.retentionDays != null && message.hasOwnProperty("retentionDays")) + object.retentionDays = message.retentionDays; + return object; + }; + + /** + * Converts this PitrSettings to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.PitrSettings + * @instance + * @returns {Object.} JSON object + */ + PitrSettings.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for PitrSettings + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.PitrSettings + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + PitrSettings.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.PitrSettings"; + }; + + return PitrSettings; + })(); + + v1.BackupDrTemplateConfig = (function() { + + /** + * Properties of a BackupDrTemplateConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupDrTemplateConfig + * @property {string|null} [firstPartyManagementUri] BackupDrTemplateConfig firstPartyManagementUri + * @property {string|null} [thirdPartyManagementUri] BackupDrTemplateConfig thirdPartyManagementUri + */ + + /** + * Constructs a new BackupDrTemplateConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrTemplateConfig. + * @implements IBackupDrTemplateConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig=} [properties] Properties to set + */ + function BackupDrTemplateConfig(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDrTemplateConfig firstPartyManagementUri. + * @member {string} firstPartyManagementUri + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @instance + */ + BackupDrTemplateConfig.prototype.firstPartyManagementUri = ""; + + /** + * BackupDrTemplateConfig thirdPartyManagementUri. + * @member {string} thirdPartyManagementUri + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @instance + */ + BackupDrTemplateConfig.prototype.thirdPartyManagementUri = ""; + + /** + * Creates a new BackupDrTemplateConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig instance + */ + BackupDrTemplateConfig.create = function create(properties) { + return new BackupDrTemplateConfig(properties); + }; + + /** + * Encodes the specified BackupDrTemplateConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig} message BackupDrTemplateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrTemplateConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.firstPartyManagementUri != null && Object.hasOwnProperty.call(message, "firstPartyManagementUri")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.firstPartyManagementUri); + if (message.thirdPartyManagementUri != null && Object.hasOwnProperty.call(message, "thirdPartyManagementUri")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.thirdPartyManagementUri); + return writer; + }; + + /** + * Encodes the specified BackupDrTemplateConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrTemplateConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrTemplateConfig} message BackupDrTemplateConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrTemplateConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrTemplateConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrTemplateConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.firstPartyManagementUri = reader.string(); + break; + } + case 2: { + message.thirdPartyManagementUri = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDrTemplateConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrTemplateConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDrTemplateConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDrTemplateConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) + if (!$util.isString(message.firstPartyManagementUri)) + return "firstPartyManagementUri: string expected"; + if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) + if (!$util.isString(message.thirdPartyManagementUri)) + return "thirdPartyManagementUri: string expected"; + return null; + }; + + /** + * Creates a BackupDrTemplateConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupDrTemplateConfig} BackupDrTemplateConfig + */ + BackupDrTemplateConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupDrTemplateConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupDrTemplateConfig(); + if (object.firstPartyManagementUri != null) + message.firstPartyManagementUri = String(object.firstPartyManagementUri); + if (object.thirdPartyManagementUri != null) + message.thirdPartyManagementUri = String(object.thirdPartyManagementUri); + return message; + }; + + /** + * Creates a plain object from a BackupDrTemplateConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {google.cloud.backupdr.v1.BackupDrTemplateConfig} message BackupDrTemplateConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDrTemplateConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.firstPartyManagementUri = ""; + object.thirdPartyManagementUri = ""; + } + if (message.firstPartyManagementUri != null && message.hasOwnProperty("firstPartyManagementUri")) + object.firstPartyManagementUri = message.firstPartyManagementUri; + if (message.thirdPartyManagementUri != null && message.hasOwnProperty("thirdPartyManagementUri")) + object.thirdPartyManagementUri = message.thirdPartyManagementUri; + return object; + }; + + /** + * Converts this BackupDrTemplateConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @instance + * @returns {Object.} JSON object + */ + BackupDrTemplateConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDrTemplateConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupDrTemplateConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDrTemplateConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrTemplateConfig"; + }; + + return BackupDrTemplateConfig; + })(); + + v1.BackupDrPlanConfig = (function() { + + /** + * Properties of a BackupDrPlanConfig. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupDrPlanConfig + * @property {Array.|null} [backupDrPlanRules] BackupDrPlanConfig backupDrPlanRules + */ + + /** + * Constructs a new BackupDrPlanConfig. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrPlanConfig. + * @implements IBackupDrPlanConfig + * @constructor + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig=} [properties] Properties to set + */ + function BackupDrPlanConfig(properties) { + this.backupDrPlanRules = []; + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDrPlanConfig backupDrPlanRules. + * @member {Array.} backupDrPlanRules + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @instance + */ + BackupDrPlanConfig.prototype.backupDrPlanRules = $util.emptyArray; + + /** + * Creates a new BackupDrPlanConfig instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig instance + */ + BackupDrPlanConfig.create = function create(properties) { + return new BackupDrPlanConfig(properties); + }; + + /** + * Encodes the specified BackupDrPlanConfig message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig} message BackupDrPlanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanConfig.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.backupDrPlanRules != null && message.backupDrPlanRules.length) + for (var i = 0; i < message.backupDrPlanRules.length; ++i) + $root.google.cloud.backupdr.v1.BackupDrPlanRule.encode(message.backupDrPlanRules[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupDrPlanConfig message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanConfig.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanConfig} message BackupDrPlanConfig message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanConfig.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanConfig.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrPlanConfig(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + if (!(message.backupDrPlanRules && message.backupDrPlanRules.length)) + message.backupDrPlanRules = []; + message.backupDrPlanRules.push($root.google.cloud.backupdr.v1.BackupDrPlanRule.decode(reader, reader.uint32())); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDrPlanConfig message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanConfig.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDrPlanConfig message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDrPlanConfig.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.backupDrPlanRules != null && message.hasOwnProperty("backupDrPlanRules")) { + if (!Array.isArray(message.backupDrPlanRules)) + return "backupDrPlanRules: array expected"; + for (var i = 0; i < message.backupDrPlanRules.length; ++i) { + var error = $root.google.cloud.backupdr.v1.BackupDrPlanRule.verify(message.backupDrPlanRules[i]); + if (error) + return "backupDrPlanRules." + error; + } + } + return null; + }; + + /** + * Creates a BackupDrPlanConfig message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupDrPlanConfig} BackupDrPlanConfig + */ + BackupDrPlanConfig.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupDrPlanConfig) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupDrPlanConfig(); + if (object.backupDrPlanRules) { + if (!Array.isArray(object.backupDrPlanRules)) + throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanConfig.backupDrPlanRules: array expected"); + message.backupDrPlanRules = []; + for (var i = 0; i < object.backupDrPlanRules.length; ++i) { + if (typeof object.backupDrPlanRules[i] !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanConfig.backupDrPlanRules: object expected"); + message.backupDrPlanRules[i] = $root.google.cloud.backupdr.v1.BackupDrPlanRule.fromObject(object.backupDrPlanRules[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a BackupDrPlanConfig message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {google.cloud.backupdr.v1.BackupDrPlanConfig} message BackupDrPlanConfig + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDrPlanConfig.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.backupDrPlanRules = []; + if (message.backupDrPlanRules && message.backupDrPlanRules.length) { + object.backupDrPlanRules = []; + for (var j = 0; j < message.backupDrPlanRules.length; ++j) + object.backupDrPlanRules[j] = $root.google.cloud.backupdr.v1.BackupDrPlanRule.toObject(message.backupDrPlanRules[j], options); + } + return object; + }; + + /** + * Converts this BackupDrPlanConfig to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @instance + * @returns {Object.} JSON object + */ + BackupDrPlanConfig.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDrPlanConfig + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupDrPlanConfig + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDrPlanConfig.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrPlanConfig"; + }; + + return BackupDrPlanConfig; + })(); + + v1.BackupDrPlanRule = (function() { + + /** + * Properties of a BackupDrPlanRule. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupDrPlanRule + * @property {string|null} [ruleId] BackupDrPlanRule ruleId + * @property {google.protobuf.ITimestamp|null} [lastSuccessfulBackupTime] BackupDrPlanRule lastSuccessfulBackupTime + */ + + /** + * Constructs a new BackupDrPlanRule. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupDrPlanRule. + * @implements IBackupDrPlanRule + * @constructor + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule=} [properties] Properties to set + */ + function BackupDrPlanRule(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupDrPlanRule ruleId. + * @member {string} ruleId + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @instance + */ + BackupDrPlanRule.prototype.ruleId = ""; + + /** + * BackupDrPlanRule lastSuccessfulBackupTime. + * @member {google.protobuf.ITimestamp|null|undefined} lastSuccessfulBackupTime + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @instance + */ + BackupDrPlanRule.prototype.lastSuccessfulBackupTime = null; + + /** + * Creates a new BackupDrPlanRule instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule instance + */ + BackupDrPlanRule.create = function create(properties) { + return new BackupDrPlanRule(properties); + }; + + /** + * Encodes the specified BackupDrPlanRule message. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule} message BackupDrPlanRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanRule.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ruleId != null && Object.hasOwnProperty.call(message, "ruleId")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.ruleId); + if (message.lastSuccessfulBackupTime != null && Object.hasOwnProperty.call(message, "lastSuccessfulBackupTime")) + $root.google.protobuf.Timestamp.encode(message.lastSuccessfulBackupTime, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified BackupDrPlanRule message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupDrPlanRule.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.IBackupDrPlanRule} message BackupDrPlanRule message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupDrPlanRule.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanRule.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupDrPlanRule(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.ruleId = reader.string(); + break; + } + case 2: { + message.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.decode(reader, reader.uint32()); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupDrPlanRule message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupDrPlanRule.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupDrPlanRule message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupDrPlanRule.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + if (!$util.isString(message.ruleId)) + return "ruleId: string expected"; + if (message.lastSuccessfulBackupTime != null && message.hasOwnProperty("lastSuccessfulBackupTime")) { + var error = $root.google.protobuf.Timestamp.verify(message.lastSuccessfulBackupTime); + if (error) + return "lastSuccessfulBackupTime." + error; + } + return null; + }; + + /** + * Creates a BackupDrPlanRule message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupDrPlanRule} BackupDrPlanRule + */ + BackupDrPlanRule.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupDrPlanRule) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupDrPlanRule(); + if (object.ruleId != null) + message.ruleId = String(object.ruleId); + if (object.lastSuccessfulBackupTime != null) { + if (typeof object.lastSuccessfulBackupTime !== "object") + throw TypeError(".google.cloud.backupdr.v1.BackupDrPlanRule.lastSuccessfulBackupTime: object expected"); + message.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.fromObject(object.lastSuccessfulBackupTime); + } + return message; + }; + + /** + * Creates a plain object from a BackupDrPlanRule message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {google.cloud.backupdr.v1.BackupDrPlanRule} message BackupDrPlanRule + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupDrPlanRule.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.ruleId = ""; + object.lastSuccessfulBackupTime = null; + } + if (message.ruleId != null && message.hasOwnProperty("ruleId")) + object.ruleId = message.ruleId; + if (message.lastSuccessfulBackupTime != null && message.hasOwnProperty("lastSuccessfulBackupTime")) + object.lastSuccessfulBackupTime = $root.google.protobuf.Timestamp.toObject(message.lastSuccessfulBackupTime, options); + return object; + }; + + /** + * Converts this BackupDrPlanRule to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @instance + * @returns {Object.} JSON object + */ + BackupDrPlanRule.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupDrPlanRule + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupDrPlanRule + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupDrPlanRule.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupDrPlanRule"; + }; + + return BackupDrPlanRule; + })(); + + v1.BackupLocation = (function() { + + /** + * Properties of a BackupLocation. + * @memberof google.cloud.backupdr.v1 + * @interface IBackupLocation + * @property {google.cloud.backupdr.v1.BackupLocation.Type|null} [type] BackupLocation type + * @property {string|null} [locationId] BackupLocation locationId + */ + + /** + * Constructs a new BackupLocation. + * @memberof google.cloud.backupdr.v1 + * @classdesc Represents a BackupLocation. + * @implements IBackupLocation + * @constructor + * @param {google.cloud.backupdr.v1.IBackupLocation=} [properties] Properties to set + */ + function BackupLocation(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + + /** + * BackupLocation type. + * @member {google.cloud.backupdr.v1.BackupLocation.Type} type + * @memberof google.cloud.backupdr.v1.BackupLocation + * @instance + */ + BackupLocation.prototype.type = 0; + + /** + * BackupLocation locationId. + * @member {string} locationId + * @memberof google.cloud.backupdr.v1.BackupLocation + * @instance + */ + BackupLocation.prototype.locationId = ""; + + /** + * Creates a new BackupLocation instance using the specified properties. + * @function create + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.IBackupLocation=} [properties] Properties to set + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation instance + */ + BackupLocation.create = function create(properties) { + return new BackupLocation(properties); + }; + + /** + * Encodes the specified BackupLocation message. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @function encode + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.IBackupLocation} message BackupLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLocation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.type); + if (message.locationId != null && Object.hasOwnProperty.call(message, "locationId")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.locationId); + return writer; + }; + + /** + * Encodes the specified BackupLocation message, length delimited. Does not implicitly {@link google.cloud.backupdr.v1.BackupLocation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.IBackupLocation} message BackupLocation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + BackupLocation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a BackupLocation message from the specified reader or buffer. + * @function decode + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLocation.decode = function decode(reader, length, error) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.google.cloud.backupdr.v1.BackupLocation(); + while (reader.pos < end) { + var tag = reader.uint32(); + if (tag === error) + break; + switch (tag >>> 3) { + case 1: { + message.type = reader.int32(); + break; + } + case 2: { + message.locationId = reader.string(); + break; + } + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a BackupLocation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + BackupLocation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a BackupLocation message. + * @function verify + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + BackupLocation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 0: + case 1: + case 2: + case 3: + break; + } + if (message.locationId != null && message.hasOwnProperty("locationId")) + if (!$util.isString(message.locationId)) + return "locationId: string expected"; + return null; + }; + + /** + * Creates a BackupLocation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {Object.} object Plain object + * @returns {google.cloud.backupdr.v1.BackupLocation} BackupLocation + */ + BackupLocation.fromObject = function fromObject(object) { + if (object instanceof $root.google.cloud.backupdr.v1.BackupLocation) + return object; + var message = new $root.google.cloud.backupdr.v1.BackupLocation(); + switch (object.type) { + default: + if (typeof object.type === "number") { + message.type = object.type; + break; + } + break; + case "TYPE_UNSPECIFIED": + case 0: + message.type = 0; + break; + case "ZONAL": + case 1: + message.type = 1; + break; + case "REGIONAL": + case 2: + message.type = 2; + break; + case "MULTI_REGIONAL": + case 3: + message.type = 3; + break; + } + if (object.locationId != null) + message.locationId = String(object.locationId); + return message; + }; + + /** + * Creates a plain object from a BackupLocation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {google.cloud.backupdr.v1.BackupLocation} message BackupLocation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + BackupLocation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.type = options.enums === String ? "TYPE_UNSPECIFIED" : 0; + object.locationId = ""; + } + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.cloud.backupdr.v1.BackupLocation.Type[message.type] === undefined ? message.type : $root.google.cloud.backupdr.v1.BackupLocation.Type[message.type] : message.type; + if (message.locationId != null && message.hasOwnProperty("locationId")) + object.locationId = message.locationId; + return object; + }; + + /** + * Converts this BackupLocation to JSON. + * @function toJSON + * @memberof google.cloud.backupdr.v1.BackupLocation + * @instance + * @returns {Object.} JSON object + */ + BackupLocation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Gets the default type url for BackupLocation + * @function getTypeUrl + * @memberof google.cloud.backupdr.v1.BackupLocation + * @static + * @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com") + * @returns {string} The default type url + */ + BackupLocation.getTypeUrl = function getTypeUrl(typeUrlPrefix) { + if (typeUrlPrefix === undefined) { + typeUrlPrefix = "type.googleapis.com"; + } + return typeUrlPrefix + "/google.cloud.backupdr.v1.BackupLocation"; + }; + + /** + * Type enum. + * @name google.cloud.backupdr.v1.BackupLocation.Type + * @enum {number} + * @property {number} TYPE_UNSPECIFIED=0 TYPE_UNSPECIFIED value + * @property {number} ZONAL=1 ZONAL value + * @property {number} REGIONAL=2 REGIONAL value + * @property {number} MULTI_REGIONAL=3 MULTI_REGIONAL value + */ + BackupLocation.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "TYPE_UNSPECIFIED"] = 0; + values[valuesById[1] = "ZONAL"] = 1; + values[valuesById[2] = "REGIONAL"] = 2; + values[valuesById[3] = "MULTI_REGIONAL"] = 3; + return values; + })(); + + return BackupLocation; + })(); + return v1; })(); diff --git a/packages/google-cloud-backupdr/protos/protos.json b/packages/google-cloud-backupdr/protos/protos.json index ad1b78a1c71..44ce9ef7529 100644 --- a/packages/google-cloud-backupdr/protos/protos.json +++ b/packages/google-cloud-backupdr/protos/protos.json @@ -11,7 +11,7 @@ "csharp_namespace": "Google.Cloud.BackupDR.V1", "go_package": "cloud.google.com/go/backupdr/apiv1/backupdrpb;backupdrpb", "java_multiple_files": true, - "java_outer_classname": "DataSourceReferenceProto", + "java_outer_classname": "ProtectionSummaryProto", "java_package": "com.google.cloud.backupdr.v1", "php_namespace": "Google\\Cloud\\BackupDR\\V1", "ruby_package": "Google::Cloud::BackupDR::V1", @@ -6550,6 +6550,350 @@ "id": 2 } } + }, + "BackupDrProtectionSummary": { + "options": { + "(google.api.default_host)": "backupdr.googleapis.com", + "(google.api.oauth_scopes)": "https://www.googleapis.com/auth/cloud-platform" + }, + "methods": { + "ListResourceBackupConfigs": { + "requestType": "ListResourceBackupConfigsRequest", + "responseType": "ListResourceBackupConfigsResponse", + "options": { + "(google.api.http).get": "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs", + "(google.api.method_signature)": "parent" + }, + "parsedOptions": [ + { + "(google.api.http)": { + "get": "/v1/{parent=projects/*/locations/*}/resourceBackupConfigs" + } + }, + { + "(google.api.method_signature)": "parent" + } + ] + } + } + }, + "ListResourceBackupConfigsRequest": { + "fields": { + "parent": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "REQUIRED", + "(google.api.resource_reference).type": "locations.googleapis.com/Location" + } + }, + "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" + } + } + } + }, + "ListResourceBackupConfigsResponse": { + "fields": { + "resourceBackupConfigs": { + "rule": "repeated", + "type": "ResourceBackupConfig", + "id": 1 + }, + "nextPageToken": { + "type": "string", + "id": 2 + } + } + }, + "ResourceBackupConfig": { + "options": { + "(google.api.resource).type": "backupdr.googleapis.com/ResourceBackupConfig", + "(google.api.resource).pattern": "projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}", + "(google.api.resource).plural": "resourceBackupConfigs", + "(google.api.resource).singular": "resourceBackupConfig" + }, + "fields": { + "name": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "IDENTIFIER" + } + }, + "uid": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_info).format": "UUID4", + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResource": { + "type": "string", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResourceDisplayName": { + "type": "string", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResourceType": { + "type": "ResourceType", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "targetResourceLabels": { + "keyType": "string", + "type": "string", + "id": 6 + }, + "backupConfigsDetails": { + "rule": "repeated", + "type": "BackupConfigDetails", + "id": 7 + }, + "backupConfigured": { + "type": "bool", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "vaulted": { + "type": "bool", + "id": 9, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "ResourceType": { + "values": { + "RESOURCE_TYPE_UNSPECIFIED": 0, + "CLOUD_SQL_INSTANCE": 1, + "COMPUTE_ENGINE_VM": 2, + "COMPUTE_ENGINE_DISK": 3, + "COMPUTE_ENGINE_REGIONAL_DISK": 4 + } + } + } + }, + "BackupConfigDetails": { + "oneofs": { + "planSpecificConfig": { + "oneof": [ + "backupDrPlanConfig", + "backupDrTemplateConfig" + ] + } + }, + "fields": { + "backupConfigSource": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupConfigSourceDisplayName": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "type": { + "type": "Type", + "id": 3, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "state": { + "type": "State", + "id": 4, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "pitrSettings": { + "type": "PitrSettings", + "id": 5, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "latestSuccessfulBackupTime": { + "type": "google.protobuf.Timestamp", + "id": 6, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "applicableResource": { + "type": "string", + "id": 7, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupVault": { + "type": "string", + "id": 8, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "backupLocations": { + "rule": "repeated", + "type": "BackupLocation", + "id": 12 + }, + "backupDrPlanConfig": { + "type": "BackupDrPlanConfig", + "id": 10 + }, + "backupDrTemplateConfig": { + "type": "BackupDrTemplateConfig", + "id": 11 + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "CLOUD_SQL_INSTANCE_BACKUP_CONFIG": 1, + "COMPUTE_ENGINE_RESOURCE_POLICY": 2, + "BACKUPDR_BACKUP_PLAN": 3, + "BACKUPDR_TEMPLATE": 4 + } + }, + "State": { + "values": { + "STATE_UNSPECIFIED": 0, + "ACTIVE": 1, + "INACTIVE": 2, + "ERROR": 3 + } + } + } + }, + "PitrSettings": { + "fields": { + "retentionDays": { + "type": "int32", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupDrTemplateConfig": { + "fields": { + "firstPartyManagementUri": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "thirdPartyManagementUri": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupDrPlanConfig": { + "fields": { + "backupDrPlanRules": { + "rule": "repeated", + "type": "BackupDrPlanRule", + "id": 1 + } + } + }, + "BackupDrPlanRule": { + "fields": { + "ruleId": { + "type": "string", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "lastSuccessfulBackupTime": { + "type": "google.protobuf.Timestamp", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + } + }, + "BackupLocation": { + "fields": { + "type": { + "type": "Type", + "id": 1, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + }, + "locationId": { + "type": "string", + "id": 2, + "options": { + "(google.api.field_behavior)": "OUTPUT_ONLY" + } + } + }, + "nested": { + "Type": { + "values": { + "TYPE_UNSPECIFIED": 0, + "ZONAL": 1, + "REGIONAL": 2, + "MULTI_REGIONAL": 3 + } + } + } } } } diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js index 34422f5ac48..744efb47244 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js index a74b80de6f7..71be228e09e 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_plan_association.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js index 923ca067d04..aa8fe7e1485 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_backup_vault.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js index 23f73ab5e2f..19d882e52e5 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.create_management_server.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js index a480d8a31bd..dc9bee40a34 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js index 7c23ff0b23a..70a490a5b4b 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js index 14e7b0d4fa2..70e1ca0efc2 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_plan_association.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js index fdaace6b914..6a3e236ab2c 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_backup_vault.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js index ec29bc7662d..c7a17945e6b 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.delete_management_server.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js index 49101edc88d..eb9ebd76fe4 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backup_plan_associations_for_resource_type.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js index 9306acf839c..83d92447b52 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_backups_for_resource_type.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js index 1eed5c7fbb1..ba8227643a3 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_data_source_references_for_resource_type.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js index dd8f9c2dcc0..5bfda0bb76d 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.fetch_usable_backup_vaults.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js index 95703087caa..1db664e9c80 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js index e2e4a2bdb7c..cd367d4a1ce 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js index 5eedcbc578a..d79ba972be0 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_association.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js index 7385373d46c..7b00b5c17df 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_plan_revision.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js index 2538adfbc95..14fdb5572ad 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_backup_vault.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js index 59d79e6723d..b6be2c0fe07 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js index 7883c3b750c..8bcb3f16254 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_data_source_reference.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js index b562e39a2a3..03e80ac1640 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.get_management_server.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js index 705e463ce3c..55c53e70194 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.initialize_service.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js index 6fe29bc8480..3b8a476c2b0 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_associations.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js index d08353dd840..2fcc7d36b5b 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plan_revisions.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js index 29b6515587c..3be463bf2e7 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_plans.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js index dfcb8cd5288..e1bb4508c4e 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backup_vaults.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js index 677db55a76f..b2736b060b3 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_backups.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js index 94a13d6c9ad..c84c7594aa3 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_source_references.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js index 7d90b0c58f8..e27878ed103 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_data_sources.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js index 1d98e7b7f88..90c999155be 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.list_management_servers.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js index 2ab1df9ec14..26250028fd3 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.restore_backup.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js index 828beeb5072..b8c0ade8a11 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.trigger_backup.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js index 1164041efa2..80cb7a400e7 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js index 3f34d5289ba..45ee6f6baae 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js index f5fd25f1043..cb6d94b74b1 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_plan_association.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js index 6b4b90e509a..cf8aba9e2b3 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_backup_vault.js @@ -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. diff --git a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js index 609fcfa4098..23861e49849 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js +++ b/packages/google-cloud-backupdr/samples/generated/v1/backup_d_r.update_data_source.js @@ -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. diff --git a/owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js b/packages/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js similarity index 100% rename from owl-bot-staging/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js rename to packages/google-cloud-backupdr/samples/generated/v1/backup_dr_protection_summary.list_resource_backup_configs.js diff --git a/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json b/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json index 38a5feace79..e5916e1c98e 100644 --- a/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json +++ b/packages/google-cloud-backupdr/samples/generated/v1/snippet_metadata_google.cloud.backupdr.v1.json @@ -1898,6 +1898,62 @@ } } } + }, + { + "regionTag": "backupdr_v1_generated_BackupDrProtectionSummary_ListResourceBackupConfigs_async", + "title": "BackupDR listResourceBackupConfigs Sample", + "origin": "API_DEFINITION", + "description": " Lists ResourceBackupConfigs.", + "canonical": true, + "file": "backup_dr_protection_summary.list_resource_backup_configs.js", + "language": "JAVASCRIPT", + "segments": [ + { + "start": 25, + "end": 76, + "type": "FULL" + } + ], + "clientMethod": { + "shortName": "ListResourceBackupConfigs", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigs", + "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.backupdr.v1.ListResourceBackupConfigsResponse", + "client": { + "shortName": "BackupDrProtectionSummaryClient", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummaryClient" + }, + "method": { + "shortName": "ListResourceBackupConfigs", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary.ListResourceBackupConfigs", + "service": { + "shortName": "BackupDrProtectionSummary", + "fullName": "google.cloud.backupdr.v1.BackupDrProtectionSummary" + } + } + } } ] } diff --git a/packages/google-cloud-backupdr/src/index.ts b/packages/google-cloud-backupdr/src/index.ts index 38633481fbb..5bc8aa0b7be 100644 --- a/packages/google-cloud-backupdr/src/index.ts +++ b/packages/google-cloud-backupdr/src/index.ts @@ -20,8 +20,10 @@ import * as v1 from './v1'; const BackupDRClient = v1.BackupDRClient; type BackupDRClient = v1.BackupDRClient; +const BackupDrProtectionSummaryClient = v1.BackupDrProtectionSummaryClient; +type BackupDrProtectionSummaryClient = v1.BackupDrProtectionSummaryClient; -export {v1, BackupDRClient}; -export default {v1, BackupDRClient}; +export {v1, BackupDRClient, BackupDrProtectionSummaryClient}; +export default {v1, BackupDRClient, BackupDrProtectionSummaryClient}; import * as protos from '../protos/protos'; export {protos}; diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts b/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts index 7f2b6f2e8a2..2dda6fe7907 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_client.ts @@ -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. @@ -217,6 +217,9 @@ export class BackupDRClient { projectPathTemplate: new this._gaxModule.PathTemplate( 'projects/{project}' ), + resourceBackupConfigPathTemplate: new this._gaxModule.PathTemplate( + 'projects/{project}/locations/{location}/resourceBackupConfigs/{resource_backup_config}' + ), }; // Some of the methods on this service return "paged" results, @@ -7375,6 +7378,55 @@ export class BackupDRClient { return this.pathTemplates.projectPathTemplate.match(projectName).project; } + /** + * Return a fully-qualified resourceBackupConfig resource name string. + * + * @param {string} project + * @param {string} location + * @param {string} resource_backup_config + * @returns {string} Resource name string. + */ + resourceBackupConfigPath(project:string,location:string,resourceBackupConfig:string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.render({ + project: project, + location: location, + resource_backup_config: resourceBackupConfig, + }); + } + + /** + * Parse the project from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the project. + */ + matchProjectFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).project; + } + + /** + * Parse the location from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the location. + */ + matchLocationFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).location; + } + + /** + * Parse the resource_backup_config from ResourceBackupConfig resource. + * + * @param {string} resourceBackupConfigName + * A fully-qualified path representing ResourceBackupConfig resource. + * @returns {string} A string representing the resource_backup_config. + */ + matchResourceBackupConfigFromResourceBackupConfigName(resourceBackupConfigName: string) { + return this.pathTemplates.resourceBackupConfigPathTemplate.match(resourceBackupConfigName).resource_backup_config; + } + /** * Terminate the gRPC channel and close the client. * diff --git a/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json b/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json index 5d07fdd2244..0a7f3ffd5b0 100644 --- a/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json +++ b/packages/google-cloud-backupdr/src/v1/backup_d_r_proto_list.json @@ -7,5 +7,6 @@ "../../protos/google/cloud/backupdr/v1/backupvault_cloudsql.proto", "../../protos/google/cloud/backupdr/v1/backupvault_disk.proto", "../../protos/google/cloud/backupdr/v1/backupvault_gce.proto", - "../../protos/google/cloud/backupdr/v1/datasourcereference.proto" + "../../protos/google/cloud/backupdr/v1/datasourcereference.proto", + "../../protos/google/cloud/backupdr/v1/protection_summary.proto" ] diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts b/packages/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts similarity index 100% rename from owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts rename to packages/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client.ts diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json b/packages/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json similarity index 100% rename from owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json rename to packages/google-cloud-backupdr/src/v1/backup_dr_protection_summary_client_config.json diff --git a/owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json b/packages/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json similarity index 100% rename from owl-bot-staging/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json rename to packages/google-cloud-backupdr/src/v1/backup_dr_protection_summary_proto_list.json diff --git a/packages/google-cloud-backupdr/src/v1/gapic_metadata.json b/packages/google-cloud-backupdr/src/v1/gapic_metadata.json index 99e4f4b41c4..4d7fc4ea0bb 100644 --- a/packages/google-cloud-backupdr/src/v1/gapic_metadata.json +++ b/packages/google-cloud-backupdr/src/v1/gapic_metadata.json @@ -436,6 +436,34 @@ } } } + }, + "BackupDrProtectionSummary": { + "clients": { + "grpc": { + "libraryClient": "BackupDrProtectionSummaryClient", + "rpcs": { + "ListResourceBackupConfigs": { + "methods": [ + "listResourceBackupConfigs", + "listResourceBackupConfigsStream", + "listResourceBackupConfigsAsync" + ] + } + } + }, + "grpc-fallback": { + "libraryClient": "BackupDrProtectionSummaryClient", + "rpcs": { + "ListResourceBackupConfigs": { + "methods": [ + "listResourceBackupConfigs", + "listResourceBackupConfigsStream", + "listResourceBackupConfigsAsync" + ] + } + } + } + } } } } diff --git a/packages/google-cloud-backupdr/src/v1/index.ts b/packages/google-cloud-backupdr/src/v1/index.ts index 48638cc0789..576f9dae209 100644 --- a/packages/google-cloud-backupdr/src/v1/index.ts +++ b/packages/google-cloud-backupdr/src/v1/index.ts @@ -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. @@ -17,3 +17,4 @@ // ** All changes to this file may be overwritten. ** export {BackupDRClient} from './backup_d_r_client'; +export {BackupDrProtectionSummaryClient} from './backup_dr_protection_summary_client'; diff --git a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js index f26a63e5173..6557b418888 100644 --- a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js +++ b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.js @@ -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. @@ -22,6 +22,7 @@ const backupdr = require('@google-cloud/backupdr'); function main() { const backupDRClient = new backupdr.BackupDRClient(); + const backupDrProtectionSummaryClient = new backupdr.BackupDrProtectionSummaryClient(); } main(); diff --git a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts index ebee08c8273..b0ba9f95bdf 100644 --- a/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts +++ b/packages/google-cloud-backupdr/system-test/fixtures/sample/src/index.ts @@ -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. @@ -16,17 +16,23 @@ // ** https://github.com/googleapis/gapic-generator-typescript ** // ** All changes to this file may be overwritten. ** -import {BackupDRClient} from '@google-cloud/backupdr'; +import {BackupDRClient, BackupDrProtectionSummaryClient} from '@google-cloud/backupdr'; // check that the client class type name can be used function doStuffWithBackupDRClient(client: BackupDRClient) { client.close(); } +function doStuffWithBackupDrProtectionSummaryClient(client: BackupDrProtectionSummaryClient) { + client.close(); +} function main() { // check that the client instance can be created const backupDRClient = new BackupDRClient(); doStuffWithBackupDRClient(backupDRClient); + // check that the client instance can be created + const backupDrProtectionSummaryClient = new BackupDrProtectionSummaryClient(); + doStuffWithBackupDrProtectionSummaryClient(backupDrProtectionSummaryClient); } main(); diff --git a/packages/google-cloud-backupdr/system-test/install.ts b/packages/google-cloud-backupdr/system-test/install.ts index 2a505d6df0c..394f3362d20 100644 --- a/packages/google-cloud-backupdr/system-test/install.ts +++ b/packages/google-cloud-backupdr/system-test/install.ts @@ -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. diff --git a/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts b/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts index 985f77897d2..843d6ef43f6 100644 --- a/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts +++ b/packages/google-cloud-backupdr/test/gapic_backup_d_r_v1.ts @@ -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. @@ -7883,5 +7883,51 @@ describe('v1.BackupDRClient', () => { .getCall(-1).calledWith(fakePath)); }); }); + + describe('resourceBackupConfig', async () => { + const fakePath = "/rendered/path/resourceBackupConfig"; + const expectedParameters = { + project: "projectValue", + location: "locationValue", + resource_backup_config: "resourceBackupConfigValue", + }; + const client = new backupdrModule.v1.BackupDRClient({ + credentials: {client_email: 'bogus', private_key: 'bogus'}, + projectId: 'bogus', + }); + await client.initialize(); + client.pathTemplates.resourceBackupConfigPathTemplate.render = + sinon.stub().returns(fakePath); + client.pathTemplates.resourceBackupConfigPathTemplate.match = + sinon.stub().returns(expectedParameters); + + it('resourceBackupConfigPath', () => { + const result = client.resourceBackupConfigPath("projectValue", "locationValue", "resourceBackupConfigValue"); + assert.strictEqual(result, fakePath); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.render as SinonStub) + .getCall(-1).calledWith(expectedParameters)); + }); + + it('matchProjectFromResourceBackupConfigName', () => { + const result = client.matchProjectFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "projectValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchLocationFromResourceBackupConfigName', () => { + const result = client.matchLocationFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "locationValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + + it('matchResourceBackupConfigFromResourceBackupConfigName', () => { + const result = client.matchResourceBackupConfigFromResourceBackupConfigName(fakePath); + assert.strictEqual(result, "resourceBackupConfigValue"); + assert((client.pathTemplates.resourceBackupConfigPathTemplate.match as SinonStub) + .getCall(-1).calledWith(fakePath)); + }); + }); }); }); diff --git a/owl-bot-staging/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts b/packages/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts similarity index 100% rename from owl-bot-staging/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts rename to packages/google-cloud-backupdr/test/gapic_backup_dr_protection_summary_v1.ts